Saturday, November 10, 2012

Moving Directories which have a file of interest.

This command looks for files that have a ".ape" extension. It then takes the parent directory and moves it (the directory) to another location.

find . -name "*.ape" -type f -exec dirname {} \; | uniq | while read each; do mv "$each" dir2/; done;

Thursday, August 23, 2012

How to mark all of your mail as read.


In Gmail, Create a filter like this

Matches: to:(*)
Do this: Skip Inbox, Mark as read


Monday, June 18, 2012

A one liner to rename files sequentially

This one line script will rename image files into nice sequential files such as

IMG_000.JPG
IMG_001.JPG
etc.

EII=0; for each in `ls -rt`; do mv $each IMG.`printf "%03d" $EII`.JPG; EII=`expr $EII + 1`; done;

Monday, May 28, 2012

Screencasting in Linux

I discovered a very useful command to record a desktop window using FFMPEG.
Credits to egrounds.org

Using the video captured from FFMPEG, and audio captured from an external Zoom H1 digital recorder,
I can combine these two recordings into a decent screencast.



#!/bin/sh

INFO=$(xwininfo -frame)
WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+')
WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/+/,/' )

echo $WIN_GEO
echo $WIN_XY

ffmpeg -f x11grab -r 15 -s $WIN_GEO -i :0.0+$WIN_XY -vcodec mpeg4 -sameq -y /tmp/$1.avi


Wednesday, December 14, 2011

Remove Spaces In Files


This command is very useful.
Credits to : http://www.swflug.org/index.php?option=com_content&task=view&id=71&Itemid=47


for file in *; do mv "$file" `echo $file | sed -e 's/  */_/g' -e 's/_-_/-/g'`; done 

Wednesday, November 23, 2011

How to record Games in Linux with RecordMyDesktop and PulseAudio

This tutorial is for those of you who have been struggling to record games on Linux. On the surface, this task may sound trivial, but getting started will reveal that it isn't so easy. The current online instructions that I have found are complicated and unnecessary. In my exploration, I spent about 3 hours playing around with JACK and other resources with no luck. JACK doesn't play very well with PulseAudio which comes on the more recent Ubuntu distributions. Working around it can be quite nightmarish so here I offer you an alternative.

TASK: Record Desktop Games With Game Audio.

INSTALLATION:
The applications you will need are gtk-recordmydesktop and PulseAudioDeviceChooser. In the terminal you can install with the following line:

sudo apt-get install gtk-recordmydesktop padevchooser

or with the more friendly Ubuntu Software Center.




INSTRUCTIONS:

Once these two applications are installed, open the PulseAudioVolumeControl
Applications > Sound&Video > PulseAudio Volume Control


In this window, go to the Input Devices tab and show All Input Devices

Scroll down to Monitor of Internal Audio Analog Stereo and click the checkbox. This will change your default input audio what you normally hear as output. I lowered the volume a little for quality, but you may have different preferences.


(When you are finished, restore the default by clicking on Internal Audio Analog Stereo)

Now you can open gtk-RecordMyDesktop
Applications > Sound&Video > Desktop Recorder


I think that using gtk-RecordMyDesktop is pretty straight forward. Clicking on Advanced I modified the Performance as shown. Nothing special on the Sound tab. 

All that's left is to click Save As  to name you file, Select your Window, and then hit record!


That's how you record audio and video together.


Saturday, November 19, 2011

An idea for the future...

I want to work on developing a webapp music player that integrates MusicBrainz services. The webapp should play local files with MusicBrainz meta-data.