Archive for the ‘ubuntu’ Category

lxdm (LXDE) not starting at boot

Friday, January 6th, 2012

I’ve just found the solution for this that’s been bodering me for the last month or so. I filled up a bug at launchpad that contains all the info: https://bugs.launchpad.net/ubuntu/+source/lxdm/+bug/912772

After digging around I found that the upstart job /etc/init/lxdm.conf ran and stopped inmmediatly. A couple of weeks later (BTW, upstart debug log sucks!), I found that in this file there’s a condition that checks the content of /etc/X11/default-display-manager (line 28) and expects to found “/usr/sbin/lxdm”. In my case, the content of the file was “lxdm” therefore the condition was not satisfied and lxdm failed to start (actually it was being forced to stop).

After changing the content of /etc/X11/default-display-manager to “/usr/sbin/lxdm”, lxdm (LXDE) started to work at boot time showing login screen as expected.

 

Script to install NVIDIA drivers on Linux

Saturday, July 16th, 2011

If you ever struggled with the installation of the NVIDIA drivers on Linux (or Debian using this) then you should definitely check this out!

Really interesting, simple and useful script to install proper NVIDIA drivers on your Linux box.

http://smxi.org/docs/sgfxi-manual.htm

Simply run:

cd /usr/local/bin && wget -Nc smxi.org/sgfxi && chmod +x sgfxi && sgfxi

as root user (or with sudo) and the script will automatically decide which version to install and will set up the xorg.conf file for you. It also works with other graphics cards manufacturers.

java.io.FileNotFoundException: /usr/lib/libnss3.so error on Debian Wheezy

Saturday, July 16th, 2011

 


Edit:
this should have been fixed by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634058

 

 

I came across this error the other day running a java application on Debian Wheezy:

java.security.ProviderException: Could not initialize NSS
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:201)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:262)
at sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:244)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:244)
at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:224)
at sun.security.jca.ProviderList.getProvider(ProviderList.java:232)
at sun.security.jca.ProviderList.getIndex(ProviderList.java:262)
at sun.security.jca.ProviderList.getProviderConfig(ProviderList.java:246)
at sun.security.jca.ProviderList.getProvider(ProviderList.java:252)
at java.security.Security.getProvider(Security.java:473)
at jd.http.XTrustProvider.install(XTrustProvider.java:70)
at jd.http.Browser.init(Browser.java:1317)
at jd.update.Main.main(Main.java:119)
Caused by: java.io.FileNotFoundException: /usr/lib/libnss3.so
at sun.security.pkcs11.Secmod.initialize(Secmod.java:186)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:197)
… 18 more
ERROR Could not initialize NSS

Apparently an update broke the configuration of the OpenJDK installation. So to fix it I had to manually edit the file /etc/java-6-openjdk/security/nss.cfg:

name = NSS
#nssLibraryDirectory = /usr/lib
nssLibraryDirectory = /usr/lib/i386-linux-gnu
nssDbMode = noDb
attributes = compatibility

Commenting out the highlighted orange line and adding the highlighted green line. The reason of it is that OpenJDK has split this configuration according to the box architecture (see https://bugs.launchpad.net/ubuntu/+source/nss/+bug/778726). However on my box it failed updating the reference to the new location of the libnss3.so file (I am on Debian Wheezy which is not stable yet so I guess something went wrong).

Spreading LXDE

Saturday, April 30th, 2011

The “Lightweight X11 Desktop Environment” is an extremely fast-performing and energy-saving desktop environment. (…) LXDE uses less CPU and less RAM than other environments. It is especially designed for cloud computers with low hardware specifications, such as, netbooks, mobile devices (e.g. MIDs) or older computers. LXDE can be installed with many Linux distributions including Ubuntu, Debian and Fedora. It is the standard for Knoppix and lubuntu. LXDE also runs with OpenSolaris and BSD. (…)The source code of LXDE is licensed partly under the terms of the the General Public License and partly under the LGPL.

 

I have it installed in an old Pentium 4 with 1.5GB of RAM and it works smoothly and flawlessly. If you need a lightweight desktop environment or want to try something different or you are simply tired of KDE an Gnome, well LXDE is a great alternative.

 

Check it out at: http://www.lxde.org

xfburn: CD/DVD burner for Linux

Wednesday, April 20th, 2011

xfburn is a great front-end tool for writing CD/DVD. Simple and very useful.

Check it out at http://www.xfce.org/projects/xfburn

Restore deleted folder in SVN after commit

Saturday, January 29th, 2011

If you delete a remote folder in SVN accidentally it gets tricky to restore it back. This can happen by commiting an unwanted deletion. So, basically, what you have to do is:

  • Create a working copy of the deleted folder’s parent. You can use -N parameter that indicates “No checkout”. This will prevent from actually downloading any code. Run:

svn co -N SVN_PARENT_URL .

  • Get a copy of the deleted folder from the revision before the deletion. Run:

svn copy SVN_PARENT_URL/DELETED_FOLDER_NAME@REV DELETED_FOLDER_NAME

  • Commit to HEAD. This will actually commit a new revision with the contents of the revision before the deletion. Therefore restoring the “original” folder. Run:

svn commit -m “Restoring” DELETED_FOLDER_NAME


Source: http://www.freshblurbs.com/svn-restore-deleted-folder-revision

.

Spreading Firefox

Thursday, November 4th, 2010

Spread Firefox Affiliate Button

World Of Goo: an excellent game available for Linux

Friday, May 28th, 2010

World of Goo is an addictive, state-of-the-art, smooth and pleasant to the eye game. Plus, it is available for Linux natively!!! Plus it is only U$D20.-

Check it out here:

http://2dboy.com/games.php

I hope companies start believing there is a “Linux game market” out there waiting and wanting games to run natively.

How to remove .svn directories recursively

Saturday, April 10th, 2010

Just type this in your console:

rm -rf `find . -type d -name .svn`


Mic not working with C-Media soundcard and Ubuntu Karmic 9.10

Thursday, February 4th, 2010

The problem was that this on-board sound card is surround and, when in surround mode, the mic mini-plug input becomes Center /LFE output.

I fixed it this way:

1) Open “alsamixer”
2) Go to “Mic-In Mode” bar
3) Check that in “Item” (top-left corner), it reads “Mic-In Mode [Mic-In]”
4) If not (probably “Mic-In Mode [Center/LFE Output]“) hit up/down arrow keys until “Mic-In Mode [Mic-In]” is selected.
5) Check that mic is not muted. Go to “Mic” bar and check that it is not muted “Mic [Off]“. If it is, hit M key, you’ll get “Mic” only.

That should be it.

Installing ImageMagick from source in Ubuntu

Monday, December 7th, 2009
Start by removing any old versions previously installed via apt-get:
sudo apt-get remove imagemagick

Then update apt-get and install some supporting packages:

sudo apt-get update
sudo apt-get install libperl-dev gcc libjpeg62-dev libbz2-dev libtiff4-dev libwmf-dev libz-dev
libpng12-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev liblcms1-dev
libexif-dev perl libjasper-dev libltdl3-dev graphviz gs-gpl pkg-config

Use wget to grab the source from ImageMagick.org.

Once the source is downloaded, uncompress it:

cdtar xvfz ImageMagick.tar.gz

Now configure and make:

cd ImageMagick-6.5.0-0
./configure
sudo make
sudo make install

To avoid an error such as:

convert: error while loading shared libraries: libMagickCore.so.2: cannot open shared object file: No such file or directory

Add the following line to ~/.bashrc:

export LD_LIBRARY_PATH=/usr/local/lib
sudo ldconfig

You can confirm the install and available formats with:

identify -list format

Source: http://www.digitalsanctum.com/2009/03/18/installing-imagemagick-from-source-on-ubuntu-804/

Listening to Last.fm from Ubuntu

Wednesday, November 18th, 2009

A friend reccommended me Last.fm player for Ubuntu.

Simply run:

sudo apt-get install lastfm

That’s it, it works flawlessly and it consumes about 10-12KiB/s of your bandwitdh. Pretty cool, right? Now configure it with your last.fm account details and enjoy Last.fm Radios on your Linux box.

Enable "public_html" for users in Ubuntu for Apache2

Tuesday, July 14th, 2009

To enable the “public_html” folder for users in Ubuntu using Apache2, you only have to follow 3 steps. These are:

  1. Add the Apache2 userdir module: In Ubuntu, this functionality comes as a default module for Apache2. If you don’t have it enabled, just enter sudo a2enmod userdir in a console. This command will add and/or enable the module.
  2. Create the public_html directory: Create the public_html directory in the users home Enter mkdir /home/a_user/public_html in a console.
  3. Restart Apache2: restart Apache2 so that the changes take effect. Enter sudo /etc/init.d/apache2 force-reload in a console.

After Apache2 finishes restarting, you will be able to access the user’s public_html directory entering the address as follows in a web browser (I.E. Firefox :D) http://localhost/~a_user

Cheers

Subversion (SVN) with WebSVN, DAV and Apache2 under Ubuntu

Saturday, July 4th, 2009

Install Subversion:

Use the following command to install Subversion and the Apache2 module:

sudo apt-get install subversion libapache2-svn

Create a repository:

Use the following command to create a repository:

sudo svnadmin create /var/svn/new-project/

Add permission to the directory for the Apache user only:

chmod -R 775 /var/svn/new-project

chown -R www-data:www-data /var/svn/new-project

Configure Apache

Open /etc/apache2/mods-available/dav_svn.conf and add a new “virtual directory”:

<location /svn>
DAV svn

SVNParentPath /var/svn

AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd

AuthzSVNAccessFile /etc/apache2/dav_svn.authz

Require valid-user

</location>

Create the users password file. Use the following command the first time only, the -c parameter will create AND override the file if it exists:

htpasswd2 -c /etc/apache2/dav_svn.passwd username

To add other users or change password use:

htpasswd2 -m /etc/apache2/dav_svn.passwd username

In /etc/apache2/dav_svn.authz, add the users permissions

[/]
me=rw

[new-project:/]
other.user=rw

Finally, restart Apache so that the changes take effect:

apache2ctl restart

Upgrading Ekiga Softphone version in Ubuntu

Friday, June 19th, 2009

Ubuntu (specially 8.10 Intrepid Ibex) comes with a very old version of Ekiga Softphone. In order to solve this we have a personal site at Launchpad, the PPA for Troels Liebe Bentsen.

Just follow the instructions described in this page: http://wiki.ekiga.org/index.php/Snapshots at the bottom of the page under the title “Ubuntu”.

Beware to use the information found at the PPA for Troels Liebe Bentsen page. That is:

1) the repository information for your Ubuntu version (for Intrepid use: deb http://ppa.launchpad.net/tlbdk/ppa/ubuntu intrepid main & deb-src http://ppa.launchpad.net/tlbdk/ppa/ubuntu intrepid main)

2) the repository signature found here.

SVN back-up and restore

Friday, May 22nd, 2009

To back-up my SVN repository, I have the following script:


#!/bin/bash
SVNDIR=/var/svn
DATE=`date +%d-%m-%Y`
TARNAME=svn_dump_$DATE.bz2
cd $SVNDIR
rm -f *.svndump
rm -f *.bz2
for repo in $(ls -d */)
do
filename=`basename $repo | cut -d\. -f1`
svnadmin dump $repo > $SVNDIR/$filename.svndump
done
tar -cvz -f $SVNDIR/$TARNAME *.svndump
cp $TARNAME /home/yo/svn_dump

Basically, it iterates thru all my repositories in SVNDIR and dumps them (the back up process itself) with svadmin dump.... After that it tars and compress the *.svndump files in one single file TARNAME and then copies it to its final destination /home/yo/svn_dump from where I grab the tar.bz2 files and burn them in a DVD or whatever.

I also have a cron job as follows:

0 0 * * 7 /home/yo/bin/scripts/svndump.sh >/dev/null 2>&1

which runs the script above once a week.

To restore a svn dump file I have to:
1) Untar the tar.bz2 back up file.
2) With the result I run: svnadmin load /path/to/reponame < filename.svndump
3) Set the correct permissions to the restored repositories. This is needed if you restore the back-up in a different path or computer.

That's pretty much what I do. My source code is safe in several different places (I'm a little bit paranoid, I know...)

Using SVN with Subclipse

Saturday, May 2nd, 2009

If you want to know the basics of SVN with Subclipse there’s no need to add anymore than what this article already says.

http://www.saltycrane.com/blog/2007/03/how-to-setup-subclipse-project-to/

Was really helpful and clear to me.

Installing Transmission torrent client as a service in Ubuntu Hardy

Thursday, November 27th, 2008

I have a PC that I use as server running Ubuntu 8.04 Hardy Heron and I wanted to install a command-line torrent client and run it as a service to download & seed stuff with no need of a monitor or X attached to it (because I don’t have any of them :P ). So after trying a few clients I decided to stick to Transmission, Ubuntu’s default torrent client.

To get this working, this is what I did:

1) In order to use it as a service, you have to download transmission-cli package which has the transmission-daemon & transmission-remote bins.

2) Before this, I added a new apt sources to the /etc/sources.list because Ubuntu’s sources has a very out-of-date version. So open /etc/sources.list and add the following lines:

deb http://ppa.launchpad.net/bortis/ubuntu hardy main
deb-src http://ppa.launchpad.net/bortis/ubuntu hardy main

Then update & install.

3) You should now have the client intalled. But to use it as a service / daemon, go to:

http://trac.transmissionbt.com/wiki/HeadlessUsageDebian

http://trac.transmissionbt.com/wiki/HeadlessUsage/General
and follow the instructions.

Remember to set the correct permissions to the TRANSMISSION_HOME & TORRENTFOLDER directories to allow writing & reading to the user you set in USERNAME.

I had some problems with transmission populating the default config file “settings.json”. What I did was to manually create the file and add this default content:

{
    "blocklist-enabled": 0,
    "download-dir": "\/shares\/internal\/PUBLIC\/Torrent\/work",
    "download-limit": 100,
    "download-limit-enabled": 0,
    "encryption": 0,
    "max-peers-global": 200,
    "peer-port": 51413,
    "pex-enabled": 1,
    "port-forwarding-enabled": 1,
    "rpc-access-control-list": "+127.0.0.1",
    "rpc-authentication-required": 0,
    "rpc-password": "",
    "rpc-port": 9091,
    "rpc-username": "",
    "upload-limit": 40,
    "upload-limit-enabled": 1
}

You can find out what options for this config files are available at:

http://trac.transmissionbt.com/wiki/EditConfigFiles

Hope it helps, cheers!

Epiphany Webkit

Saturday, September 6th, 2008

Note: this post was created using Epiphany Web Browser 2.22.3

I am very happy with the new version of Epiphany, Gnome’s web browser. With its brand new WebKit HTML engine, it works fast and fluently.

Right now I am using a PPA version of it since it has not been included in the official Ubuntu repositories. It will be on October 30th, when Ubuntu 8.10 becomes alive!

Install it and try it by yourself. To install it just add the following two lines to your /etc/apt/sources.list:

deb http://ppa.launchpad.net/stemp/ubuntu hardy main #WebKit & Midori
deb http://ppa.launchpad.net/michelinux/ubuntu hardy main #Epiphany-WebKit


Then just run:

sudo apt-get update
sudo apt-get install epiphany-webkit

Source: http://theindexer.wordpress.com/2008/07/04/install-epiphanywebkit-on-hardy-heron/

Archive directory with tar with "exclude" parameter.

Monday, September 1st, 2008

You can archive a directory using tar and exclude files or sub-directories using the “exclude” parameter:

tar cvjf ORIG DEST –exclude=PATTERN

*ORIG: the origin directory. I.E: /home/me

*DEST the destination archive file. I.E: /home/me/Desktop/home.tar.bz2

*PATTERN: file & subdirectories exclusion pattern. I.E: .* (excludes all hidden files)

Note: –exclude has two hyphens