Ubuntu
Install Subversion and Subclipse for Eclipse on Ubuntu
If you do not have Eclipse installed yet, run:
sudo apt-get install eclipse
Install Subversion
sudo apt-get install subversion
Install the Subversion plugin for Eclipse
Get the Java bindings for Subversion:
sudo apt-get install libsvn-java
Now we are ready to install the plugins in Eclipse.
Open Eclipse.
Go to Help -> Install New Software
Then hit the “Add” button.
Put “Subclipse 1.6.x (Eclipse 3.2+)” under Name and “http://subclipse.tigris.org/update_1.6.x” under Location:
The above is for Elclips 3.2+ and Subversion 1.6.x.
If you have different Eclipse or Subversion versions, check this list and substitute accordingly:
Name: Subclipse 1.6.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.6.x
Name: Subclipse 1.4.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.4.x
Name: Subclipse 1.2.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.2.x
Name: Subclipse 1.0.x (Eclipse 3.0/3.1)
URL: http://subclipse.tigris.org/update_1.0.x
More info about the different versions: http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA
Then hit “OK”. You will now be presented with these options:
If you are unsure what Subclipse component you will need, you can check all of them. Also, keep in mind that you can always go back to this in the future and install/uninstall any of the components as needed.
Then “Next” and “Finish” on the subsequent screens.
After the plugins are installed, it will prompt you to restart Eclipse. Go ahead and do so.
You are not done yet. You need to fix the JavaHL.
Edit the eclipse.ini file:
sudo vi /usr/lib/eclipse/eclipse.ini
Add the following line under -vmargs:
-Djava.library.path=/usr/lib/jni
Here is what my eclipse.ini file looks like:
$ cat /usr/lib/eclipse/eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090520
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-startup
--launcher.library
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-startup
/usr/lib/eclipse/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
/usr/lib/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090520
-vmargs
-Djava.library.path=/usr/lib/jni
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=//usr/share/eclipse/dropins
-Xms40m
-Xmx256m
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=//usr/share/eclipse/dropins
For more info on fixing JavaHL if you need it: http://subclipse.tigris.org/wiki/JavaHL#head-bb1dd50f9ec2f0d8c32246430c00e237d27a04fe
You should be able to use Subversion with Eclipse for your projects at this point.
Extract Audio (.mp3) from Video Files Like .flv, .mov, .avi and Others with Ubuntu
It is very easy to extract the audio track from video files using Linux. All you need is ffmpeg and some codecs.
Let’s get started…
Note: The commands below are for Ubuntu (or Debian derivatives) but you can do the same with any other Linux distribution provided you can install the necessary packages.
1. Add the Medibuntu’s repository to your sources.list:
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
2. Install ffmpeg:
sudo apt-get install ffmpeg
3. Let’s get the restricted packages and some codecs installed:
sudo apt-get install ubuntu-restricted-extras libmp3lame0 libdvdcss2 w32codecs
The above command is for i386 architecture. If you have an amd64 architecture, substitute w32codecs with w64codecs.
Note: This is not a complete list of codec packages by any stretch of the imagination. It will get you started though and you will be able to do most formats, but you might have to add codecs as you go along.
4. Now we are ready to extract the audio from the video files:
ffmpeg -i input_file.flv output_file.mp3
The above command will extract the audio from a Flash video file. You can do the same for a QuickTime file as well:
ffmpeg -i input_file.mov output_file.mp3
Or for an Audio Video Interface file:
ffmpeg -i input_file.avi output_file.mp3
YouTube and other video web sites:
Having done all this, now we can download flash files from places like YouTube and strip the audio from them. All you need besides the steps above is a way to save the Flash files (.flv) from YouTube. An easy way to do that is by using Firefox Add-ons like Download Flash and Video or Flash Video Downloader.
The quality of the audio in the YouTube videos for example is 64 bit/sec. Most of the mp3 files are normally compressed to 128 bit/sec or above. Obviously the quality will not be the same, but a human year cannot tell the difference.
The quality of the extracted mp3 will depend on the quality of the audio track in the video file. So the above statement about the 64 bit/sec audio is mostly the case for the files on some video sharing sites.
How to Resume Partial File Transfers
I work primarily with UNIX and Linux machines and scp is my main choice to transfer files with. It is both convenient, short and secure.
Example:
scp localfile user@remotecomputer:/path/to/target/dir
Recently I was transferring an 8GB file and due to a network issue, the transfer was interrupted at nearly 40%.
I found a solution at joen.dk ,which uses rsync to resume the transfer:
rsync --partial --progress --rsh=ssh host:remote_file local_file
Now we can improve this slightly by shortening the above command. We can substitute –rsh=ssh with -e ssh, and use -P instead of –partial –progress. Also, you can add user@host if you need to specify a different remote shell user:
rsync -P -e ssh user@host:remote_file local_file
This above example will work with any file that was partially transfered. How the transfer was started does not really matter. It could be through scp, nc or even ftp. After you execute the above command it will take rsync a little time to verify the previously downloaded part before it continues with the rest. Be patient, depending on your network speed rsync could take some time to go through what you have already transfered. Of course this is much faster than if you were to start the download all over again and it shows you the progress in percentages.
Keep in mind that there have to be a couple of requirements in place in order to resume the file transfer with rsync:
1. You should have remote shell access.
2. The remote machine should have rsync installed. Since rsync is by default on most Linux distributions that generally should not be an issue.
Convert Quicktime Movies to AVI encoded with MPEG-4 (MOV to AVI) with Linux/Ubuntu
A lot of camcorders record in the .mov (Quicktime) format. It has high quality video and depending on the underlying codec it provides a good compression, but it is too proprietary and very often you might not be able to play it on different devices.
AVI on the other hand is more widely accepted format. AVI, like MOV, is a media container that envelops encoded media. In this example we will convert Quicktime video (.mov) to .avi that contains media encoded with mpeg-4.
If you want to preserve the original quality and resolution with pcm_u8 (analog 8bit) audio:
ffmpeg -i inputfile.mov -sameq -vcodec msmpeg4v2 -acodec pcm_u8 outputfile.avi
Obviously I would prefer something better for the sound so I normally use the mp3 as an audio codec. To do this make sure that you have the libmp3lame0 package installed to do that:
sudo apt-get install libmp3lame0
And then:
ffmpeg -i inputfile.mov -sameq -vcodec msmpeg4v2 -acodec libmp3lame outputfile.avi
If you want to change the resolution then add the -s option and specify the horizontal and vertical resolution. Make sure to preserve the original aspect ratio:
ffmpeg -i inputfile.mov -s 960x540 -sameq -vcodec msmpeg4v2 -acodec libmp3lame outputfile.avi
Broadcom Wireless Chipset (BCM4311, BCM4312, BCM4321, and BCM4322) on Ubuntu Karmic.
If you have a Broadcom wireless chipset BCM4311, BCM4312, BCM4321, or BCM4322 it will not work with Ubuntu Karmic after an upgrade or an install.
To get it working, you need to install the STA driver. You can get it from the Broadcom site:
http://www.broadcom.com/support/802.11/linux_sta.php
Follow the instructions in the README.txt file which is on same page.
After you have finished installing it the wireless will work, but only until the next reboot. To make this permanent follow these steps:
1. Run:
sudo rmmod ssb
For some reason you cannot blacklist the ssb module. It always runs on boot even if it is in the blacklist.conf file.
After that you need to run this to get rid of the ssb module permanently:
sudo update-initramfs -u
2. Now that we got rid of ssb, we need to make sure that lib80211 is loaded on boot. To do that add lib80211 to the end of the /etc/modules file:
echo "lib80211" | sudo tee -a /etc/modules
I went ahead and added wl to it as well:
echo "wl" | sudo tee -a /etc/modules
So the /etc/modules file looks like this:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
lp
rtc
lib80211
wl
3. Now we need to make sure that “insmod wl.ko” as specified in the README.txt file runs every time we boot. There might be a better way to do this but I just added it to the /etc/rc.local file.
Before I did this I copied the wl.ko file to the /lib/modules/2.6.31-14-generic/kernel/lib directory. This way we can get rid of the source files we downloaded from the Broadcom site along with the binaries we compiled and not worry about losing the wl.ko file:
sudo cp wl.ko /lib/modules/2.6.31-14-generic/kernel/lib
Then add the line “insmod /lib/modules/2.6.31-14-generic/kernel/lib/wl.ko” at the end of the rc.local file, right above the exit 0 line:
sudo gedit /etc/rc.local
Here is how the rc.local file looks:
cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
insmod /lib/modules/2.6.31-14-generic/kernel/lib/wl.ko
exit 0
4. Last step is to pin down the linux kernel so that we don’t upgrade the kernel accidentally along with the other updates:
System -> Administration -> Synaptic Package Manager
Then click on the “Status” button and select “Installed”. Then search for “linux-”. Select all packages that start with “linux-” and then Package -> Lock Version.
Search
Recent Comments
- zjhlogo on How to connect your Android phone to Ubuntu to do development, testing, installations or tethering
- dimitar on Quickly remove special characters from file names
- John on Quickly remove special characters from file names
- John on Quickly remove special characters from file names
- Alin on Quickly remove special characters from file names

