Monthly Archives: May 2009

Google Wave

The guys behind the Google Maps are working on a tool for communication and collaboration on the web. It’s called Google Wave and it’s planned for release later this year. The nice thing is that will be open source’d and you can allready use their API to start building your stuff.
You can watch the video from the Google I/O where they unveiled the project.

httpvh://www.youtube.com/watch?v=v_UyVmITiYQ

Android applications running on Ubuntu

500px-android-logosvg Canonical will develop an environment wich will allow Andoid applications to run on Ubuntu. Source.
Also, HP considers dropping Windows for Android in netbooks. Source.

Random crash of the X server in Jaunty

I experienced a lot of random X server crashes using the proprietary driver for the NVIDIA graphic card on my Thinkpad T61 running Ubuntu 9.04 x86 with Compiz activated.
I managed to fix the problem by installing the lastest NVIDIA driver. I wrote a little script to automate the process and save time. I recommend you to run this in command line mode. Here it is:

#!/bin/bash
 
# Check if the X server is running
pid_of_X=`ps aux | grep X | grep -v 'grep' | grep root | awk '{ print $2 }'`
 
if [ -z "$pid_of_X" ];
  then
    echo -e '\n\n\n\n\n\n\n\n\n'
    echo -e 'X is not running! - Good!\n'
	# Stop the xserver (GDM)
	sudo /etc/init.d/gdm stop
	cd $HOME/Desktop
 
	if [ -e latest.txt ]; # Check for 'latest.txt' file
	  then
	    rm -f latest.txt
	fi
 
	if [ -e NVIDIA-Linux-x86-* ]; # Check for 'NVIDIA-Linux-x86-*' file
	  then
	    rm -f NVIDIA-Linux-x86-*
	fi
 
	# Get the latest driver from NVIDIA's ftp
	nvidia_ftp='ftp://download.nvidia.com/XFree86/Linux-x86'
	wget -c -T 10 $nvidia_ftp/latest.txt
 
	new_driver_version=`cat latest.txt | awk '{ print $1 }'`
	new_driver_filename=`cat latest.txt | awk '{ print $2 }'`
 
	wget -c -T 10 $nvidia_ftp/$new_driver_filename
 
	chmod +x $HOME/Desktop/NVIDIA-Linux-x86-*
 
	# Remove all nvidia* packages in the system
	sudo dpkg -l | grep nvidia | awk '{ print $2 }' | xargs sudo aptitude -y purge
 
	# Remove all the nvidia kernel objects currently installed
	export kernel_version=`uname -r`
	sudo rm -f `find /lib/modules/$kernel_version -iname nvidia.ko`
 
	# Install the new driver
	sudo sh $HOME/Desktop/NVIDIA-Linux-x86-*.run
 
	rm -f NVIDIA-Linux-x86-*
	rm -f latest.txt
 
	echo -e '\n\n\n\n\n\n\n\n\n'
	echo -e '---------\n'
	echo -e 'All done!\n'
	echo -e 'Starting GDM in 5 seconds...\n'
	sleep 5
 
	# Start GDM
	sudo /etc/init.d/gdm start
 
  else
    echo -e '\n\n\n\n\n\n\n\n\n'
    echo -e 'X is running!\n'
    echo -e 'You should run this script in console mode!\n'
 
    echo -e 'Press CTRL+ALT+F1 to go to console mode, then run this script again!\n'
    echo -e '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'
    echo -e 'Aborting in 5 seconds!'
    echo -e '\n\n\n\n\n\n\n\n\n'
    sleep 5
    exit 0
fi

Custom usplash resolution in Ubuntu

Recently I made a clean install of Ubuntu 9.04 on my Thinkpad T61.
I configured the figerprint, the accelerometer is reporting correct values.
I did not like the default resolution at boot. So I created a custom usplash.conf file:

sudo joe /etc/usplash.conf

I should contain these lines:

xres=1680
yres=1050

The next step was to update the “initial RAM disk”, that is used when the system boots up:

sudo update-initramfs -u

Next, I modified my /boot/grub/menu.lst file.
I added as a parameter for the current kernel the value vga=872:

kernel		/boot/vmlinuz-2.6.28-11-generic root=UUID=7281a5b5-6dd5-4011-beff-27339b4b9693 ro splash vga=872

Nice and clean!

Auto update for Debian/Ubuntu

I use the following script to automatically update my Ubuntu box.
I don’t recommend using this on your production servers!

#!/bin/bash
 
#################################################
##                                             ##
## auto-update.sh v1.0                         ##
## Use this script to set up automatic updates ##
## on your debian/ubuntu box.                  ##
##                                             ##
#################################################
 
## Creating /usr/bin/auto-update.sh file
sudo touch /usr/bin/auto-update.sh
sudo chmod 700 /usr/bin/auto-update.sh
sudo chown root:root /usr/bin/auto-update.sh
echo '#!/bin/bash' | sudo tee -a /usr/bin/auto-update.sh
echo 'touch /var/log/auto-update.log' | sudo tee -a /usr/bin/auto-update.sh
echo 'echo '------------------' >> /var/log/auto-update.log' | sudo tee -a /usr/bin/auto-update.sh
echo 'echo `date` >> /var/log/auto-update.log' | sudo tee -a /usr/bin/auto-update.sh
echo 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin' | sudo tee -a /usr/bin/auto-update.sh
echo 'export PATH' | sudo tee -a /usr/bin/auto-update.sh
echo '/usr/bin/aptitude update >> /var/log/auto-update.log' | sudo tee -a /usr/bin/auto-update.sh
echo '/usr/bin/aptitude -y safe-upgrade >> /var/log/auto-update.log' | sudo tee -a /usr/bin/auto-update.sh
echo 'exit' | sudo tee -a /usr/bin/auto-update.sh
 
# Creating a cron job for root user (it will run /usr/bin/auto-update.sh every day at 14:30)
echo '30 14 * * * /usr/bin/auto-update.sh > /dev/null' > cron_file.txt && sudo crontab -u root cron_file.txt && rm -f cron_file.txt

Note that there are some dangers regarding automatic updates. You can read more about it here.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close