Friday, March 25, 2016

Skype on Ubuntu 14.04

sudo dpkg --add-architecture i386
sudo sh -c "echo 'deb http://archive.canonical.com/ trusty partner' >> /etc/apt/sources.list.d/canonical_partner.list"
sudo apt-get update
sudo apt-get install skype
LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 skype

Friday, March 18, 2016

Install xvfb Ubuntu

sudo apt-get install xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps

xvfb-run app

 xvfb-run -a python get_lyrics.py http://lyrics.wikia.com/wiki/Des%27ree:Save_Me

 xvfb-run -a -e /dev/stdout python -u get_lyrics.py http://lyrics.wikia.com/wiki/Des%27ree:Save_Me 2>&1

Wednesday, March 16, 2016

Install MATLAB Ubuntu 14.04

sudo apt-get install libxtst6:i386
sudo apt-get install lib32z1
sudo apt-get install gcc-multilib

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer

sudo apt-get install libxtst6:i386 libXext6:i386 libxi6:i386 libncurses5:i386 libxt6:i386 libxpm4:i386 libxmu6:i386 libxp6:i386 lib32stdc++6

Edit /etc/udev/rules.d/70-persistent-net.rules and change the name to eth0

Wednesday, February 24, 2016

Install headless bittorrent client

apt-get source bittornado 
 
I set up aliases to btdownloadcurses.py and btdownloadmany.py
 
 
btdownloadcurses --max_uploads 4 --max_upload_rate 32 to_be_downloaded.torrent
 
btdownloadmany --max_uploads 4 --max_upload_rate 32 .
 
  
where . is a directory full of torrent files. 

Wednesday, February 10, 2016

Monday, February 8, 2016

Streaming NES (.NSF) file audio over a network using gstreamer

Now, to check on alsa
cat /proc/asound/cards should show some available cards

alsamixer should also work if you run it from the commandline. If alsamixer gives the following error:
cannot open mixer: No such file or directory

You may need to add yourself to the audio group in /etc/group, then log out and back in to update permissions.

First, we test remote piping of sound.

On the listening machine (Macbook Air for me, so using sox vs. aplay as you would/could in Linux):
nc -l 8000 | sox -traw -r44100 -b16 -e unsigned-integer - -tcoreaudio

On the source machine (Ubuntu 12.04 for me):
cat /dev/urandom | nc ip_addr_of_listening_machine 8000

If you hear white noise, the connection between machines seems to work correctly.

Next, we want to set up gstreamer

sudo apt-get install gstreamer0.10*

Check that we can play the .nsf files from gstreamer (where ${file} is the file to play)

gst-launch-0.10 -v filesrc location="${file}" ! nsfdec ! pulsesink 

You should hear the game audio of your choice. If this doesn't work, you may need to install libgme-dev by doing:

sudo apt-get install libgme-dev

Now you can try a file over the network.

gst-launch-0.10 -v filesrc location="${file}" ! nsfdec ! audioconvert ! wavenc ! udpsink port=8888

You can then connect to this port with netcat and listen to the wavenc encoded data (basically just raw PCM, if you missed the header).

nc sourceserver 8888 | sox -traw -r44100 -b16 -e unsigned-ineger -tcoreaudio