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.

Wednesday, November 16, 2011

List files in FTP and Download/Unzip it

curl ftp://ftp.aoml.noaa.gov/phod/pub/IES_FTP/abaco/ > temp.txt


for each in `cat temp.txt | awk '{print $9}'`; do wget ftp://ftp.aoml.noaa.gov/phod/pub/IES_FTP/abaco/$each && unzip $each; done;

Tuesday, October 25, 2011

Exporting path...

I always seem to forget this line...

I currently have this in .bashrc, but it may not be the best place to put it.

export PATH=$PATH:/new/path/to/add:/other/new/path

Renaming file numbers

This little script will rename badly named files into nice 3 digit numbers.

For example, if you have files, 1,2,3,...10,11,12, it will rename the files into 01, 02, 03, etc.

#!/bin/bash
echo $1;
mkdir $1/output

for each in `ls $1`
do
filename=$(echo $each | cut -f1 -d '.' | tr -d '[[:digit:]]')
extension=$(echo $each | cut -f2 -d'.')
number=$(echo $each | tr -cd '[[:digit:]]')
echo $number;
cp $1/$each $1/output/$filename`printf "%03d" $((10#$number))`.$extension
done

Wednesday, October 19, 2011

I Wish There Was....

I am not one to stand out or break out from the norm, but I have an idea that I think has a lot of potential.

I think that there should be a new playlist format that explicitly uses Musicbrainz Ids... or at least a music player which allows users to see the MBID....


Friday, October 7, 2011

Script to connect to HunterNet


The connection to my university wifi is terrible and requires authentication. I have written a small script here which allows me to connect to the internet without a browser. 


#!/bin/bash


IP=$(ip addr show wlan0 | grep inet | head -n1 | cut -f6 -d ' '| cut -f1 -d '/')
MAC=$(ip addr show wlan0 | grep link | head -n1 | cut -f6 -d ' ')


echo $IP;
echo $MAC;
echo `curl -d "user=USERNAME&password=PASSWORD" https://securelogin.arubanetworks.com/cgi-bin/login?cmd=login&mac=$MAC&ip=$IP`


echo "CONNECTED!"