Skip to main content

Posts

Removing audio noise from a video

The basic steps are to extract the audio, remove noise, and then re-insert the noise-free audio back into the video wrapper. Step I: Extract the noisy audio 1. Open Audacity 2. Open the video file in Audacity 3. Select a region of pure background noise (which should be periods of silence). Then use the Audacity menu to select Effects -> Noise reduction 4. Select Get Noise Profile (Important: don’t click ok) 5. Then go back to the waveform and select the entire waveform 6. Again select Effects -> Noise reduction 7. But this time just click ok 8. Audacity will work on the file to reduce the noise. Check the region selected before to see if noise is removed/reduced 9. Repeat the steps #3 to #7 as many times as necessary till all noise is gone 10. Now Export the file to mp3. Make to change the extension as Audacity uses “aiff” even when the file type is selected to be mp3. Step II: Remove audio from video file 1. Go to the folder containing th...
dpkg: error: duplicate file trigger interest for filename `/usr/lib/gio/modules' and package `libglib2.0-0:i386' The dpkg trigger file has duplicates. We would need to manually remove all of them. $ cd /var/lib/dpkg/triggers/ $ sudo vim File /usr/share/octave/packages octave /usr/lib/libreoffice/share/extensions libreoffice-common /usr/lib/x86_64-linux-gnu/gio/modules libglib2.0-0 /usr/lib/gio/modules libglib2.0-0 /usr/share/glib-2.0/schemas libglib2.0-0 /usr/lib/i386-linux-gnu/gio/modules libglib2.0-0:i386 /usr/lib/gio/modules libglib2.0-0:i386 /usr/share/glib-2.0/schemas libglib2.0-0:i386 /etc/dbus-1/system.d dbus/noawait /usr/share/dbus-1/system-services dbus/noawait /usr/lib/vlc/plugins vlc-nox/noawait Notice the duplicates in bold. Remove them manually. If there are many duplicates then a quick way to see the duplicates is to run $ cat File | cut -d " " -f 2 | uniq -c 1 octave 1 libreoffice-common 3 libglib2.0-0 3 ...

Common questions on climate change

1.  Are renewable energy systems even viable or are they just an Utopian dream of impractical scientists? And even if they are viable wouldn’t it cost an arm and a leg to make them viable? Among the multitude of scientific journal articles, which answers both these questions separately, one article answers both these questions succinctly in a single paper. In 2011 Jacobson et al. proposed a 100% WWS (wind, water, solar) energy system which can supplant the current fossil fuel industry. They found that production cost of WWS is exactly same as current fossil fuel-derived energy systems and that includes costs of production, storing, and transmission (with transmission losses). Their conclusion is that “ … barriers to a 100% conversion to WWS power worldwide are primarily social and political, not technological or even economic.” 2. Which countries invest the most in renewables? The current standing (May, 2017) is: www.businessinsider.com/top-renewable-energy-inv...

Command-line password generator for Linux

Linux has its own cryptographic generator which can easily be harnessed by the common user to generate extremely strong passwords. This password generator can be found at /dev/random. /dev/random generates pseudorandom numbers based on the available entropy of the system (see wiki page ). A derivate of /dev/random called /dev/urandom does the same thing but it is more accessible while being slightly (theoretically) less secure. So what stops us from grabbing outout from /dev/urandom using cat ? An output of the content of /dev/urandom will demonstrate that it is practically gibberish with very few usable random characters. The output of cat / dev / urandom should convince the user.  However, it is possible to trim out the unwanted characters and only keep alphabets, numbers, and special characters with a simple filtering by the tr command. cat / dev / urandom | head - c 10 | tr - dc "A-Za-z0-9_!" This command will produce the desired output but it w...

Turning normal HDTV into Smart HDTV

One word ChromeCast. That will do it. There is no need to pay a premium for a Smart TV when Chromecast can outperform any of them for a fraction of the cost. Also, there are reports of some Smart TVs stealing user browsing behavior for commercial purposes. The worst was the claim that some TVs secretly listen to the conversation of the people in the room. I cannot verify the truthfulness of these reports but all these are viable possibilities if a malicious app has been secretly installed in the Smart TV. So I would rather play it safe and use Chromecast (since Google has all my data anyways). So we need to buy the Chromecast device and install the Chromecast app on the phone and that will transform the non-smart TV into an entertainment hub. However, just installing the Chromecast app on the phone does not satisfy a power user. Therefore, I chose to explore the possibilities of "Home entertainment". 1. Streaming movies from phone - Install Chromecast app. This is simple a...

Setting up Crafty chess engine on Linux/Ubuntu

Crafty installation is pretty simple. The command sudo apt-get install crafty will install crafty at /usr/games/crafty and the book files at /usr/share/crafty/books.bin. If the book files are not installed they can be manually installed by sudo apt-get install crafty-books-medtosmall Sometimes the book are not automatically installed in the home folder and it will result in the following error when crafty is run from the command line. Machine is NUMA, 1 nodes ( 6 cpus/node ) unable to open book file [ ./book.bin ] . book is disabled unable to open book file [ ./books.bin ] . ERROR, unable to open game history file, exiting This implies that we need to import the book.bin and books.bin which contain a vast array of opening moves into the local ~/.crafty directory. For that, we need to run the setup_crafty.sh. However, it needs to be made executable by the normal user first. As root go to the directory /usr/share/doc/crafty and do the following, su cd /usr/s...

Generate email filters in Gmail from list of emails

I have a lot of students from different classes who email me regularly. It is helpful to tell who belongs to which class. So I created a filter in Gmail which will sort the student's email according to their email ID. This scenario is also applicable to industry where we want to sort emails using filters. Most of the time people are able to do it by hand. However, for me it was challenging to do it by hand since I had 400 students. Therefore I fell back to Bash tools to automate the task. The first thing is to extract all the email IDs from a CSV file and save it as a list. cat file.csv | cut -d"," -f10 The 10th column had the email IDs in the CSV file. The fields are separated by commas in CSV files. Therefore, I have used -d"," as the delimiter in the cut command. "rwrwfa" "ebbra" "rksda" "ru57a" But they have the " which I need to get rid off. Easy use tr. cat file.csv | cut -d"," -f12 | s...

Google script to generate expense spreadsheet in Google Sheets

Google has started scripting support for all its products. So Google docs now support scripting which will allow end users to automate routine tasks. Google Scripts is a Javascript cloud scripting language (as opposed to Javascript being client-side only) which can make life easier for most of us (Or at least the tech-savvy ones). But if you are not a programmer, don't despair -- this tutorial does not assume coding experience but the ability to copy and paste in the right places. Now all Google products support scripting and this includes Google Maps. So for example, if you want to write a script which will import the restaurant data from Google Maps, then make it into a list in Google Sheets, and then sort the list by distance from home and email that list to colleagues, it is now possible to achieve all of this due to the support of Google Scripts. This means that now many things can be automated and the end result is an increased level of productivity. Let's say, we ha...