Posts Tagged ‘howto’

No Sound in Firefox in Jaunty — SOLVED!

Sunday, April 26th, 2009

I upgraded to the new Ubuntu, Jaunty Jackalope, on the day it came out. “At last!” I thought. “Time to solve the problems I created for myself by upgrading to a non-Long-Term-Support release last fall!” Dreaming of a world in which pulseaudio didn’t randomly need to be restarted every few hours, I started the upgrade running… only to load Firefox and discover an even worse fate — no sound in anything Flash-based! No Pandora!! PANIC TIME!!!

Anyway, it turned out to be super easy to fix. Just go to Adobe’s website and download the .deb of the latest Flash, then install, restart Firefox, good to go. Now I can get my Sarah Haskins1 fix complete with sound!

1Feminism in one breath, from an interview with Haskins:
The core issue “how do I fight bias against me because of my gender” is still there but has gotten more complicated and wrapped into all kinds of identity issues about how you present yourself as a woman and I pretty much think it’s your choice and fuck pantyhose.

Command Line Magic

Monday, May 19th, 2008

Using the command line rather than a graphical interface is one of the things that a lot of people find most intimidating about the idea of using Linux. While (my last post notwithstanding!) you can accomplish most things without ever opening up the Terminal, I’ve grown more and more enamored of using the command line whenever possible.

I found gaining fluency with the command line to be like apprenticing to a magician; at first, you utter the magic incantations syllable by syllable knowing only what will result from the whole. But the more spells you learn, the easier it becomes to notice that each part has meaning, eventually acquiring the knowledge to recombine them in ways you’ve never seen and feel confident that you can predict what will result. Once you gain experience, it’s simply faster to rattle off a handful of magic words than to navigate through the space of the graphical desktop.

If you have a Linux or Mac OS X machine, you can try this at home (Windows has a command line too, but it’s not as integrated with the rest of the system and uses different syntax). Open the “Terminal” application and give it a try:

echo 'hello world'

will print the phrase ‘hello world’

pwd

will give you the name of the directory you’re currently in

ls

will list all the files in your directory

cat groceries.txt

will print the contents of groceries.txt (if groceries.txt is a text file) to the screen

man grep

will print the manual page for the command grep

Commands can have arguments that modify their functions:

ls -l

will list all the files in your directory, in a longer format

firefox &

will launch firefox in the background

The output from a command can be piped into another command:

cat groceries.txt | grep apples

will grep (search) for the phrase ‘apples’ in the printed text of groceries.txt

ls | grep groceries

will search for ‘groceries’ in the list of files in the current directory

echo 'bananas' >> groceries.txt

will append the line ‘bananas’ to the bottom of the file groceries.txt

Not only that, but commands can be used to search for other commands:

man -k search

will give you a list of the names and short descriptions of all the commands whose short descriptions include the phrase ’search’

Share folders between two Ubuntu computers on the same LAN with NFS

Saturday, May 17th, 2008

While most things about Ubuntu work pretty much the way you want/expect the first time, one exception is sharing folders between two computers on the same LAN (”Local Area Network” — in this case, multiple computers in the same house sharing an internet connection via a router). Surprisingly, it’s easier/more intuitive to do this between an Ubuntu computer and a Windows computer! I wish Ubuntu would make a more intuitive, graphical way for non-technical users to do this — though I certainly have fun tinkering with these things and learning more about networking (or what-have-you) as I go.

Through some command-line magic, I’ve gotten my laptop to be able to access the music folder on my desktop — right now I’m playing music on my laptop that’s actually stored on my desktop’s much bigger hard drive. Sweet! How did I manage this?

Say you have two computers, both running Linux (in this case they’re both running Ubuntu and I can’t vouch that this will work on any other distro, but I suspect it would) — the server, which has the folder you want to share on its physical media, and the client, which will connect to the server and access its data.

On the client:
1. In a Terminal window, run

sudo apt-get install nfs-common

— this installs the software you’ll need.
2. Run

ifconfig

to find your IP on the local network; it should look something like

inet addr:192.168.1.101

(If you see more than one instance of “inet addr” in the output of ifconfig, choose the address that doesn’t begin with 127.)

On the server:
3. In a Terminal window, run

sudo apt-get install nfs-kernel-server

4. Edit the

/etc/hosts

file and add a line that looks like this:

neuron 192.168.1.101

where “neuron” is replaced with the hostname or a nickname for your client (in this case, “neuron” is the name of my laptop) and “192.168.1.101″ is replaced with the IP you found in step 2.
5. Test this — in a Terminal, run

ping -c 1 neuron

(or whatever name you used) and see if you get a response. If you get a response like “unknown host”, something is wrong — re-check your work from the previous steps (and check that the two computers are really on the same network!). If you get a response like “… 64 bytes from neuron… 1 packets transmitted, 1 received … ” then everything is hunky-dory so far and you are ready to move on!
6. Edit the

/etc/hosts.allow

file and add a line that looks like this:

ALL: 192.168.1.101

(again, use the IP that you found in Step 2).
7. Edit the

/etc/exports

file and add a line that looks like this:

/home/music 192.168.1.101(rw,sync,subtree_check,no_root_squash)

where again 192… is replaced with the IP from step 2, and “/home/music” is replaced with the full path to the folder you want to share. Note that for some reason it is important that the parenthesized arguments don’t have a space between them.
8. Run

sudo /etc/init.d/nfs-kernel-server restart

9. Run

ifconfig

and get the IP of your server, the same way that you found it for the client.

Back on the client!
10. Edit

/etc/hosts

and add a line like

192.168.1.103 boffin

where “192.168.1.103″ is replaced with the IP of your server (from step 9) and “boffin” is replaced with the hostname/nickname of your server (”boffin” is the name of my desktop).
11.

ping -c 1 boffin

to check that this worked, just like in Step 5.
12. Make a mountpoint for your shared directory — in my case, I used

mkdir /media/boffin-music

13. Mount the shared directory at the mountpoint, like this:

sudo mount -t nfs boffin:/home/music /media/boffin-music

replacing “boffin” with your server’s name, “/home/music” with the location on the server of your shared folder, and “/media/boffin-music” with the mountpoint you created in step 12.
14. Now you should be able to browse to the mountpoint and see your shared files, and open them, and use them. Awesome!