Today's video and podcast players have a very useful feature that allows playing back the video/audio at an increased playback speed. Hour-long podcasts can be listened to in 45 minutes. While mplayer allows increasing/decreasing your playback speed using keyboard shortcuts, the audio rate changes result in changes to pitch. Folks begin to sound like the chipmunks, or the late Barry White. You can…
For decades, Linux installations was done using CDs, later DVDs. As the installation sizes increased and the popularity of CD/DVDs dropped the more recent releases are done via USB media. With a source iso image, and an unmounted USB on /dev/sd1, you can create a bootable USB disk using the following command; $ sudo dd bs=4M if=~/Downloads/ubuntu-24.04.1-desktop-amd64.iso of=/dev/sd1>…
For the better part of my career I used 'find' incorrectly, or at the very least very naively. The '-exec' trickery eluded me for over a decade; I often relied on running child processes or _worse_ saving results to a file to run subsequent command on. For instance, if I wanted to examine log files that had 'error' in it, I'd fashion a command to open VI with the arguments of the result from a gr…
Quick review of basic find command before getting to the content. $ find . -name "*.txt" -exec grep -l dog {} \; Executing commands via exec must end with \; and often use {} as a placeholder for each file that the find commands locates. In the above example, imagine the command first locates the desired files, in this case files in the current and child directories that end with .txt . These X…
Occasionally there is a need in bash scripting to execute a series of commands in sequence conditionally. Command2 needs to be run after command1 if, and only if, the command1 succeeded (or failed). One means of performing this is to execute the command, assign the return value to a variable, and evaluate the return value executing the subsequent command based on the value. $ cat -n foo 1…
Bash has a little known concept of read-only variables. When specifying 'readonly' during a variable assignment prevents the variable from being reassigned. For example; 1 #!/bin/bash 2 3 readonly x=0 4 echo $x 5 x=1 6 echo $x Line 3 specifies a read-only assignment of variable x to 0, an attempt to reassign on line 5 will be disregarded and produce an error message. The error doesn't prevent…
A common, and often overlooked, need for scripting is addressing hanging, or unresponsive commands. What should your script do if one of it's ste ps takes much, much, much longer than expected? A hanging, or unresponsive, subprocess will result in a hanging job which in turn can prevent oth er jobs from running. Let's spend a bit of time how to address such an need. The 'timeout' command is…
Running concurrent commands in a script generally is done by executing processes in the background. Numerous commands can be spawned concurrently then synchronized by waiting for some, or all, of them to complete before proceeding or terminating the parent script. 1 #!/bin/bash 2 3 sleep 10 & 4 pId1=$! 5 6 sleep 2 & 7 pId2=$! 8 9 sleep 3 & 10 pId3=$! 11 12 echo "waiting for jobs to complete" 13…
Last year I cut my teeth at creating a Python package; Dividere Recently, building the package was encountering an error: python3 setup.py sdist bdist_wheel running sdist running egg_info creating dividere.egg-info writing dividere.egg-info/PKG-INFO writing dependency_links to dividere.egg-info/dependency_links.txt writing requirements to dividere.egg-info/requires.txt writing top-level names to…
Sometimes it's useful to slow, or extend the introduction of a video. For example, suppose you're utilizing a slow video transition (like a fade out/in effect) but don't want to miss the beginning frames of the second video. By extracting the first frame of the video, elongating it to X seconds we can preserve the transition effect without losing video content. Let's take a peek at how to…
'Some folks' use youtube-dl on a regular basis, to pull raw video and create new content. Early in 2023 it appeared to stop working. $ youtube-dl https://www.youtube.com/watch?v=8QWjCzULyNA [youtube] 8QWjCzULyNA: Downloading webpage ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on…
As camera resolutions continue to improve the feasibility of capturing a full scene of a classroom, lecture, presentation hall, or the such and autonomously focusing attention on the presenter becomes more practical. Generally, a camera operator pans and zooms in on the presenter as they make their way around the stage to draw the audience attention to the intended target. Professionally filmed…
I started dabbling with Python back in 2012'ish, using it pretty regularly over the years but generally keeping my projects close to home. Recently, I dipped my toe into publishing a Python package, out to the known universe. Back in the late 90's, the Precambrian Digital Age, I took a couple courses that continue to pique my interest time and time again. Parallel processing was primarily…
Like many folks, I've occasionally been drawn to 'write a book', despite a real need for it. Mid 2020, I had a couple inspiring computer science majors contact me via Reddit for advice, mostly involving 'what is CS' and 'How do I get into CS', but one exchange left me puzzled. A young man from Ireland, just leaving high school was accepted into university but later rejected as a result of Covid…
Systems that utilize a database benefit from an automated means of translating database CRUD operations to application language. Products like 'ObjectStore' aim to provide mechanisms to exchange data to/from applications to the database in a seamless fashion. This can be done by providing the means of converting C++ objects into SQL query/insert/update commands and converting query responses back…
It’s an interesting thing about tools, when they deliver what you need from them you’re often uninterested in ’how the sausage is made’, but digging into the details often re-enforces your understanding in the end. Kinda like eating your broccoli, its oftentimes good for you, and likely you’ll be better off having done it. There is just shy of a bazillion things you can learn about FFmpeg and the…
I received an anonymous comment on a past post FFMpeg Blending specifically asking how two video files could be concatenated with a blending effect transition. Note: anonymous commenter/reader, if you find yourself returning and find this post useful please drop a quick comment so I know the effort in addressing your question wasn't a lost. Thanks! In past posts I feel we've covered most of the…
Big hair, mullets and acid-washed jeans...the 1980's introduced us to a number of iconic treasures. But, for me, and many young teenage boys I yearned for the iconic "throaty V8's" that took center stage during the nightly broadcasts. My hand-painted Schwinn was magically transformed by imagination as we cruised around the neighborhood. With that memory in mind, I collected a number of these…
As our pandemic takes it's second revolution around the sun the list of things to occupy the surplus of time has taken a hit. Here are but a number of things I spent time with in 2020 in an attempt to keep busy. Grow a Beard In the spirit of the 'decade of the unnecessary beard' I stepped forward and extended the traditional facial follicle growing season from the normal Nov-Dec to Nov-Feb, two…
Recently presented 'Data Visualization with PyGal' to the Python Mn Meetup group https://www.meetup.com/PyMNtos-Twin-Cities-Python-User-Group/ A pretty remarkable group, full of very knowledgeable and supportive individuals. I'd highly recommend attending this meetup if you're interested in Python, ranging from beginner to advanced. I slapped together a video on YouTube for your amusement; Slides…
FFmpeg allows dynamic filter adjustments, in past posts we've demonstrated how filters can be adjusted with respect to frame number and/or timestamp. A more unconventional use allows real-time adjustments of filters by an independent process. FFmpeg allows the ability of sending filter parameters by means of the 'zmqsend' utility. This would allow modifying filter parameters during the processing…
Seem like every couple months I need to re-look up how to perform numeric formatting with bash. Here's a quick example of how to do it. $ cat /tmp/go #!/bin/bash for i in `seq 100`; do N=$(printf %03d $i) echo $N done $ ./go 001 002 003 ... 097 098 099 100 I find doing this that one is no longer the loneliest number, it's paired with a couple of real zeros, but never lonely. Cheers.
On a number of occasions I found it necessary to locate a list of files by extension (e.g. header/source files) and found that if I needed to locate files of multiple extensions I took the 'cowards way out', executing two 'find' commands and appending the results to a temporary output file, then using the output file as input to the next command in the pipeline (e.g. grep). e.g. $ find . -type f…
As we enter our 6th month of self-quarantining, I find the hermit lifestyle no longer to my liking. A virtual friend is needed and this post, my friend, is your ticket to electronic companionship. Enjoy. # apt-get install espeak Then, simply run it. $ espeak "hello, how are you doing?" Whelp, look at you! You made it to the end you big big overachiever. If you found enjoyment in this particular…
As much as I like using Wireshark, I'm a sucker for a command interface. The trouble is properly defining a filter has been difficult to say the least, boring simple post, but below is a list of brief examples and descriptions. #!/bin/bash #--grab the first 10 packets and write to file tcpdump -c 10 -i wlan0 -w /tmp/data.pcap #--grab the first 10 packets to/from host and write to file tcpdump -c…