Wednesday, August 23, 2017

Getting pulseaudio volume for default sink, once and for all

This was done with pulseaudio 8.0

So, here it is:

echo $(( ($(pacmd list-sinks | sed -n -e "/$(pacmd stat | grep "Default sink name" | cut -d ' ' -f4)/,\$p" | grep -m1 volume | cut -d '/' -f2,4 | tr -d '% ' | tr '/' '+')) / 2 ))

Wow.. that's a mouthful. Let's break it down...

Wednesday, May 17, 2017

Drive images with progress indication

# make a drive image
sudo bash -c "pv -EE /dev/sdX >my_disk.img"

# make a compressed drive image
sudo bash -c "pv -EE /dev/sdX | gzip >my_disk.img.gz"

Monday, June 13, 2016

Resizing a VirtualBox disk image

This should go without saying, but make sure you have a good backup of everything before you do any of this.. If in doubt, just backup the whole VirtualBox folder. You have been warned.

Sunday, May 1, 2016

Configuring Gnome-Shell from the command line

Here's some useful tricks to automate the configuration of the gnome shell

Ubuntu-Gnome 16.04 on Thinkpad x230

This is mostly for myself, but perhaps someone else might get some ideas from it..

Tuesday, April 26, 2016

Edit gnome settings with your favorite editor

Using the vipe command, we can read from stdin, edit the contents in the default editor and send it down the pipe.

Saturday, March 26, 2016

find files from a certain date range in linux

When you need to find a file from a specific range of dates, like a reciept that you know you saved but can't remember where.. You can use the find command along with some parameters to find files newer than a specific date, older or between two dates.