How does video encoding work? MP4? I-Frames?! P-Frames!?!?! GOP!!!?!?!!?

This is a placeholder for me comprehending how video encoding works… I’ll update/edit as I become more familiar.. please don’t assume I have any idea what im talking about.

But, basically you have a GOP (group of pictures) and that GOP has a specified number of frames per second. So lets say you have a 30 FPS video, it has 30 frames per second of data, you can have a number of GOP that is different than that though.

So lets say you have a GOP size of 90, but your frame rate is 30 FPS. You will then have 29 P-Frames per I-Frame, For a total of 87 P-frames and 3 I-Frames.

I-Frames are ENTIRE picture, P-Frames are the “guess” at what changed since the last I-Frame. More I-Frames = more bandwidth.

https://en.wikipedia.org/wiki/Video_compression_picture_types

Centos 8 disable NetworkManager for the last time…

Well RedHat has made it clear they’re going to enforce their horrible application NetworkManager for a role that has been fine for 25 years as some basic text files… so lets disable it one last time before EL9.

sudo dnf install -y network-scripts
sudo systemctl disable --now firewalld NetworkManager
sudo systemctl enable network && sudo systemctl start network
sudo touch /etc/sysconfig/disable-deprecation-warnings

Reboot your MacOS java experience

Most us devops engineer nerds have to deal with old java versions for things like IPMI and network device configuration tools… New versions of Java literally refuse to work due to security issues… soooo I present to you.. a solution!

  1. Install OpenJDK from AdoptOpenJDK: https://adoptopenjdk.net/index.html
  2. Install OpenWebStart https://openwebstart.com/download/

Once you’ve done that, simply open the jnlp file with “OpenWebStart” and it will just “work”. You may need to open the settings app for OpenWebStart and select the OpenJDK JVM over Horacle java.

OpenStack allow IPV6 into your instances.

These rules below will allow you to add Ipv6 to all of your instances.. by default openstack only allows ipv6 between the same security group.

openstack security group list
+--------------------------------------+---------+------------------------+----------------------------------+------+
| ID                                   | Name    | Description            | Project                          | Tags |
+--------------------------------------+---------+------------------------+----------------------------------+------+
| 9817adcc-e504-479b-97e5-cc884c17d3dc | default | Default security group | 3d1f410104144004a65e74c7d8fa2612 | []   |
| a45b2351-331c-4a71-ab42-10f3f04364f6 | default | Default security group | 877dce1df8ea4f8ba6a28803ef40f0dd | []   |
| afe5f296-1971-49a9-9ef4-f6af98bd83f9 | default | Default security group | 26ef6bf16c1544699b6de2639f006950 | []   |
| def5f039-c5bc-4f0e-a2e0-3ffe537f9bee | default | Default security group |                                  | []   |
| e38fe90f-70b1-4411-984b-ace5b6f04530 | default | Default security group | 776cf3cded7541419baeef3002ebf742 | []   |
+--------------------------------------+---------+------------------------+----------------------------------+------+
#Add the rules to the security group for project "776cf3cded7541419baeef3002ebf742"
openstack security group rule create --protocol ipv6-icmp --ingress  e38fe90f-70b1-4411-984b-ace5b6f04530
openstack security group rule create --ethertype ipv6 --protocol tcp --ingress  e38fe90f-70b1-4411-984b-ace5b6f04530
openstack security group rule create --ethertype ipv6 --protocol udp --ingress  e38fe90f-70b1-4411-984b-ace5b6f04530

MacOS keybound Audio Switcher

I constantly switch between speakers and headset.. like 5-6 times per day for conference calls and such…. and changing the audio source was super annoying.. SO THIS BECAME A THING.

Automator:

Using MacOS “Automator” and “switchaudio-osx” from Brew I was able to automate switching to my logitech 533 headset automagically. I have this setup on a key binding for control+F13

The code:

on run {input, parameters}
	set theSwitch to "/usr/local/Cellar/switchaudio-osx/1.0.0/SwitchAudioSource"
	set theSource to do shell script theSwitch & " -c"
	try
		if theSource = "Built-in Output" then
			do shell script theSwitch & " -t output -s \"G533 Gaming Headset\""
			do shell script theSwitch & " -t input -s \"G533 Gaming Headset\""
			display notification "Audio switched to G533 Headset." with title " Audio Input/Output Switcher"
		else
			do shell script theSwitch & " -t output -s \"Built-in Output\""
			do shell script theSwitch & " -t input -s \"Built-in Microphone\""
			display notification "Audio switched to Internal iMac Devices." with title " Audio Input/Output Switcher"
		end if
	end try
	return input
end run

You’re welcome.

How to repackage your initrd for a newer kernel on CentOS 7

The CentOS kernel is really old… some hardware requires a newer kernel, like intel VROC requires kernel 4.15+ to work properly…

This guide assumes you’ve installed the kernels for the CentOS AltArch kernel repo: http://mirror.centos.org/altarch/7/kernel/x86_64/

#Download latest pxe kernel initramfs
wget http://mirror.centos.org/centos-7/7/os/x86_64/images/pxeboot/vmlinuz -O /tmp/pxeinitrd.img

#Make a directory
mkdir /tmp/pxeinitrd
cd /tmp/pxeinitrd

#Extract the kernel into the folder
/usr/lib/dracut/skipcpio /tmp/pxeinitrd.img | xzcat | cpio -idmv

#Remove the old kernel modules
rm -rf lib/modules/*

#Copy in the kernel modules from your new kernel, in this case its 4.19.84-300.x64_64 or CentOS AltArch
rsync -r /lib/modules/4.19.84-300.el7.x86_64/* lib/modules/4.19.84-300.el7.x86_64/

#Compile the ramdisk..
find . 2>/dev/null | cpio -c -o | xz -9 --format=lzma > /tmp/initrd.4.19.84-300.el7.x86_64.img

#Grab your files and stick em in your pxe directory
cp /tmp/initrd.4.19.84-300.el7.x86_64.img /var/lib/tftpboot/images/centos7/initrd.img
cp /boot/vmlinuz-4.19.84-300.el7.x86_64 /var/lib/tftpboot/images/centos7/vmlinuz

Make your ElasticSearch Fly!

Just run this to reduce the write workload of your cluster… (this isn’t safe for critical data.. fine for logging ect.)

curl -XPUT 'http://127.0.0.1:9200/_all/_settings?preserve_existing=true' -d '{
"index.number_of_replicas" : "0",
"index.translog.durability" : "async",
"index.refresh_interval" : "60s"
}'