Archive for the ‘linux’ Category

Useful Linux Commands: Find and Search

Monday, September 1st, 2008

Learning Linux commands is probably the largest hump anybody new to Linux faces. Over the last year, I’ve compiled some useful, and somewhat non-obvious scripts that are really helpful to me on a weekly basis. Here are commands that deal with finding files and searching for text within a file:

Find and delete a directory:

find /PATH/TO/DIR -type d -name SEARCH -exec rm -rf {} \;

Find and delete a file:

find /PATH/TO/DIR -name SEARCH -exec rm -rf {} \;

Search within files:

 grep -r "SEARCH" *.EXTENSION /PATH/TO/DIR

Find and search within files:

find /PATH/TO/DIR -name "SEARCH" | xargs -I{} grep -H SEARCH {}

For more advanced options there’s always:

man find
man grep

Removing Trackerd

Wednesday, August 27th, 2008

Trackerd is probably the least useful tool that comes with Ubuntu. While indexing, it maxes out cpu and memory. Of course it allows you to search, but the search never finds what I’m looking. In my experience, i’ve found that find and grep are much more useful, especially if its only within a subdirectory.

Trying to remove trackerd is much harder than one would think. Using apt/aptitude proved fruitless since trying to remove/purge trackerd or tracker-utils does absolutely nothing. From Travis, I use these two scripts to basically prevent trackerd from running:

killall trackerd
mv /usr/bin/trackerd /usr/bin/trackerd-old

You might want to use ‘whereis trackerd’ to find out where your trackerd binary is actually located before using the move command.

Ubuntu Sound and Video Problems

Monday, June 23rd, 2008

For the longest time, I’ve had terrible luck with sound and video problems with Ubuntu on a Dell Dimension E521 with nVidia sound and video cards. I thought it was terrible support by nVidia. Everytime I would update my computer, it would totally trash my video settings and sometimes, my sound settings.

Today after doing a bunch of updates, both my video and sound went to crap. With the help of my favorite Linux hacker, Travis, we figured out that I was actually running the server version of the Linux kernel. Next, I uninstalled all instances of the server kernels, uninstalled all nvidia drivers and modules, and rebooted. From there, I followed the basic steps to install nVidia drivers, configured my screen settings and now I am able to run all of the fancy Compiz visuals and my Ubuntu install has never been better.

Sopcast and TVAnts: Stream Live TV or Movies From Home

Sunday, June 22nd, 2008

I’m a really big sports fan, especially soccer. Living in the United States, this means that most international games are always 7 or more hours earlier than usual, and sometimes, they don’t even broadcast locally.

Using Sopcast and TVAnts, I’m able to watch any game I want, when I want. Granted, this is streaming P2P video so it is not the best quality and due to the latency, images can get choppy. For popular content like the current Euro 2008 or most UEFA Champions League matches, speed and quality can rival that of Vimeo or Youtube.

After painstakingly getting Sopcast to work on my linux box, I found this really easy to use tutorial on installing both Sopcast and TVAnts:
http://simonsmess.blogspot.com/2007/11/watching-sopcast-tvants-on-ubuntu.html

For TVAnts, get a link from a website or open the program under wine, double click a channel and write down link from popup box. This will start the stream on your local computer where you can use VLC or other capable media programs to view that stream.

With Sopcast, the method to start the stream is very similar. You can download the actual program and run it under wine or use the command line version which also creates a stream from your local computer like TVAnts.

Now that you have a link and you are streaming, use your favorite media play to stream or record that link. My favorite, VLC, makes it fairly easy to open and save that link. To just open the link, VLC has an option under “File” >> “Open Network Stream”. To save the stream is the same except you specifiy where you want your stream to be saved.

In order to provide Tivo-like recording, I use my crontabs to start and stop the stream. Here is a pretty good tutorial on using crontabs. Of course it would be much easier to use MythTV if the content was available on your tv, but Sopcast and TVAnts provide a way to accomplish almost the same functionality with a more work.