Screencasts on Ubuntu

For a colleague I just made a screencast of a problem we were discussing. I was trying to use the minimum amount of tools in Gnome/Ubuntu and wanted to share the proces with you all.

Goal: Create a screencast recording of my desktop with narrated (recorded) audio at the same time.

If you are very curious and want to see the result immediately, look at the video below:

“Apache Kafka files store data without encryption”

I use Pop!_OS 21.04, which is based of Ubuntu. In Pop!_OS I use Gnome with Wayland.
All the instructions below will work with Ubuntu and any Ubuntu based distribution as well.

This howto is divided in several sections:

  • Desktop (Video) recording
  • Audio recording
  • Putting the video and audio recording together

Additional tools used in the video:

  • Show the webcam (guvcview)
  • Written annotation on a page (xournal++)
  • Written annotation on screen (Draw On You Screen)

Video recording:

Since I want to use the most simple method, my approach is to use the built-in screen cast ability in Gnome.

Press Ctrl+Alt+R to start the screen cast recording.

When the recording is in progress, you see a red filled circle in your notification area:

When you press Ctrl+Alt+R again, the circle disappears and the recording is saved to the Videos folder in your home folder:

Note: This video file is without audio.

Audio recording

As the most simple solution I used the builtin Sound Recorder in Gnome:

Press “Record” to start your recording and click “Done” when you would like to end your recording. You can see me pressing the buttons in the recorded screen cast.

Important: You need to press the screencast start keyboard command Ctrl+Alt+R and the Record button at the same time, or your video and audio will be out of sync.

When you stop the recording, the Ogg Vorbis file will be saved in the default location in your home folder, which is: ~/Recordings.

Combine the video and audio

Right now you have two separate files, not really useful when they are not combined.

To combine them, I used the following command:

ffmpeg -y -i Videos/Screencast\ from\ 05-12-2021\ 02:51:06\ PM.webm -i Recordings/Clip\ 5 -map 0:v -map 1:a -c copy file.webm

Explanation of the command:

ffmpeg
 this is the command itself
-y
 overwrite output files without asking
-i {file location}
 input file + file location
 Note that there are two input files (video & audio)
-map
 Designate one or more input streams as a source for the output file. The number is the first (0) or second (1) input file. The map itself shows what we are using in the output. In this case it is 0:v to use the video for the first input file and 1:a to use the audio of the second input file
-c copy file.webm
 Specify the output file, in this case it will be copied to file.webm in the same directory as where you run the command.

The result is what happens here:

GIF recording of putting the video and audio together (Recorded with Peek GIF Recorder)

This is the minimum necessary to create a screencast!

For example, you can send this webm video output file to people over email / file share / whatever you’d like. You can also upload it to Youtube, which can process the output file and you are done to spread some knowledge!

Add some extra spice to your screencast

To add some engagement with whoever will view your screencast, you can show your own webcam in the screen. You can use the built in program Cheese

Another option is to use guvcview, which has a cleaner interface (no buttons on the webcam output window)

Install with sudo apt install guvcview , start the program with guvcview.

Then select your video input device. You can minimize the settings pane so that you’re left with only the video of your webcam for the introduction/conclusion of your video.

Annotation

For annotation I use Xournalpp (xournal++) which helps me in drawing with my XP-Pen drawing tablet. I think it makes the screen cast a bit more entertaining compared to showing plain text but you can decide for yourself.

You can also use a Gnome Extension called Draw on You Screen by Abakkk, with this extension you can do annotations directly on the screen and thus show your thoughts / comments / pointers on screen directly.

Note: I don’t use this extension in my example video though.

Conclusion

I hope this blog post helps you in creating screen casts with the simplest possible tools. Good luck and hope to see your videos around on the web!

How to put GPX file on Garmin watch with USB

So I’m kinda tired of Garmin apps needing internet all the time. Also it’s an extra step for me to first upload my GPX files in any Garmin app before I can sync it to the watch. And the Garmin apps don’t make sense to me. The libraries are overly complicated (for my use)

First: Connect your Garmin watch to your device.

Make sure the Garmin watch is in USB storage mode (in the settings)

Second: Open the watch in your file explorer and navigate to the "NEWFILES" directory.

Third: Place your GPX file there.

As soon as you disconnect the watch, the files there will be imported into the Courses folder and you can use them for your activities.

Update HP Proliant Microserver BIOS without Windows

I wanted to update my MicroServer Gen8 bios to the latest version but the download site on HPE only showed .EXE files. Since I’m only running Linux on my machines it was not possible to execute that file.

You can however update the BIOS via ILO (Integrated Lights Out) if you extract the BIOS file from the executable.

First download the .EXE from the HPE site: https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX_e9bfdf20809a426cb16ef9cd81

(Currently the latest version is SP99427.exe. If you want to be sure you’re using the latest BIOS then click the tab “Revision History” to see if there are newer BIOS files available)

Extract the contents of the executable. Have a look at the directory structure below and extract the file marked "CPQJ06xx.xxx"(where “x” might change depending on versions)

.
├── How to Use.txt
├── logo.gif
├── README.1ST
├── rev_hist.txt
├── ROMPaq Flat Files
│   ├── CPQJ0613.684
│   ├── CPQSRVR2.CPU
│   ├── README.1ST
│   ├── Readme.txt
│   └── ROMPAQ.EXE
├── ROMPaq USB Key
│   ├── CPQJ0613.684
│   ├── CPQSRVR2.CPU
│   ├── HPEUSB.exe
│   ├── Readme.txt
│   └── ROMPAQ.EXE
├── Start_files
│   ├── colorschememapping.xml
│   ├── filelist.xml
│   └── themedata.thmx
└── Start.htm
3 directories, 18 files

Then log in to ILO and navigate to the page “Firmware” via the Menu Option “Administrator”

At the bottom of the page select “Browse” to select the CPQJ06 file and then click Upload.

Let the upload complete and reboot your Microserver. When you start the microserver it displays the BIOS version and date in the first line.

You can also see the version in the ILO overview page.

HP Smart Array P222: The cache is permanently disabled

I just installed a new Hardware RAID card in my microserver (gen8), and as soon as I booted it gave me this error and refused configuration of the Raid arrays on the P222.

It seems related to the battery which is connected to the cache module on my card. The battery was empty when I first booted the system.

Solution was to power up the system, leave it in POST while the battery was being charged.

After about an hour I tried again and I was able to clear the cache, clear the configuration for the RAID array and create a fresh array on the controller.

Note; perhaps the period of an hour could be shorter or longer in your specific case. The battery provided with my unit was quite small so it was charged enough after an hour to continue without errors. But I guess that that might differ per unit.

Note; Several posts on HP and server forums were suggesting that the unit might be defective and said to return the battery / cache module / Smart Array card.
This post is mostly here to encourage patience; Getting a cup of coffee and checking again after an hour was the solution in my case.

Create a Java path entry for all users

I install Java on all my machines and used to add the java path and home variables to the user (or my user) bash profile but every time I added another user this is a manual step.

Until I found this small trick. Add a system wide profile path setting by creating a file in:

/etc/profile.d/filename

All files in profile.d are added to every users login. Much cleaner than adding it to every user’s profile.

This is the contents of my file:

/etc/profile.d/java-path.sh

export JAVA_HOME="/opt/java"
export PATH=$JAVA_HOME/bin:$PATH

These variables are set next time you log in with any user on that system.

Easy way to see your external IP from Command Line

It’s not always clear from which IP you might be reaching hosts on the internet. These IP’s are important to know since they are often the IP’s that you will whitelist on receiving systems.

The easiest way to find out what your external IP is, would be executing this command:

curl https://ipinfo.io/ip

Hope this helps 🙂

Install Python without Admin rights (windows)

Appearently it’s quite simple to install python on a windows machine, even if you don’t have admin rights.

Remember, this only works if you downloaded the MSI installer version.

Open a command line in the same folder where you downloaded the python installer (Click here for the Python download page)

Execute this command on the CLI:

msiexec /a python-2.7.16.amd64.msi /qb TARGETDIR=C:\python27

Replace the version with your downloaded version

Disable autoplay movies in Chrome

This has been annoying me for a while, a lot of sites seem to allow auto playing movies (sometimes with sound) when I visit them.

It is probably my problem, becoming a grumpy old bastard but I dislike the autoplay option.

Luckily, you can disable this feature in Chrome by opening a new tab and entering this url:

chrome://flags/#autoplay-policy

Then choose “Document user activiation is required” and you feel like you’re be back in 2017, without all this video stuff 🙂

Copy all files with Ansible Copy

I wanted to copy all files in a directory, but didn’t want to create a “with_items” because I am lazy.

The solution is to use “with_fileglob” which can use wildcards and thus select multiple files.

## Example
- name: Copying certificates to tmp
  copy:
    src: "{{ item }}"
    dest: /tmp
    owner: apache
    group: apache
    mode: 0600
  with_fileglob:
    - "files/tmp/*"

This will copy all files in the tmp folder to the client.

Ps. Another option is to use synchronize, but you need rsync on the host and client which is why I prefer copy.

Ansible – Continue nicely when shell exits with error

Sometimes a command gives an exit code which isn’t considered an error in your playbook. You could use “ignore_errors” but it will stand out when you run your playbook, and it’s the first thing new colleagues point out when we run a play together.

This example shows you how to use the exit code in a when clause without ansible throwing (and catching) the exception.

- name: Check if md5sum of the current  is the same
  shell: 'md5sum --check /install/md5sum_of_installer'
  register: installer_md5sum_check
  failed_when: ( installer_md5sum_check.rc not in [ 0, 1 ] )

- name: Run Installer if md5sum is different or missing
  include_role:
    name: my_install_role
  when: installer_md5sum_check.rc == 1
  ## rc 0: the md5sum output was "OK", thus was already installed
  ## rc 1: it was not the same (or the file was missing)

- name: Create md5sum for the installer
  shell: 'md5sum /install/my_installer.zip > /install/md5sum_of_installer'
  when: installer_md5sum_check.rc == 1
  ## We can only arrive here when the installer role was successfully finished