Archive for March, 2008
How to: Install Ubuntu packages with HTML link
Saturday, March 15th, 2008Apturl allows you to install Ubuntu packages from a website using the following syntax: apt:packagename (where packagename is the name of the package you wish to install
For example, I wanted to install a new pixel ruler (link courtesy of Borntwisted) called KRuler. If I was to install this directly from my web browser I would need to write the link in my HTML like so:
- <a href=”apt:kruler”>Click here to install Kruler</a>
This would then give me the following link:
If you click the link (providing you are using Ubuntu as your Operating System) you will get the follwoing:

Once you click ok, and type in your admin password you will get the download screen as it downloads the package ready for installation

And then the obligatory install screen will be shown:

This is a perfect tool for bloggers, how to’ers and manual writers writing for Ubuntu installs etc. I know I will be using it in all my future blogs and how to’s in the future.
Go ahead, give it a shot
How to: Increase ext3 and reiserfs performance
Tuesday, March 11th, 2008NOTE: This How To: is for Ubuntu Linux (all versions) but should work on any version of Linux that supports the ext3 filesystem and reiserfs filesystem. This How To: is offered as is and I cannot take responsibility for any problems you suffer as a result of modifying yoru core system files.
ext3 Filesystem
The ext3 or third extended filesystem is a journalled file system that is commonly used by the Linux operating system. It is the default file system for many popular Linux distributions
Features of ext3 File System
The ext3 file system is essentially an enhanced version of the ext2 file system. These improvements provide the following advantages
Availability
After an unexpected power failure or system crash, each mounted ext2 file system on the machine must be checked for consistency by the e2fsck program. This is a time-consuming process that can delay system boot time significantly, especially with large volumes containing a large number of files. During this time, any data on the volumes is unreachable.
The journaling provided by the ext3 file system means that this sort of file system check is no longer necessary after an unclean system shutdown. The only time a consistency check occurs using ext3 is in certain rare hardware failure cases, such as hard drive failures. The time to recover an ext3 file system after an unclean system shutdown does not depend on the size of the file system or the number of files; rather, it depends on the size of the journal used to maintain consistency. The default journal size takes about a second to recover, depending on the speed of the hardware.
Data Integrity
The ext3 file system provides stronger data integrity in the event that an unclean system shutdown occurs. The ext3 file system allows you to choose the type and level of protection that your data receives. By default, Most Linux Distributions configures ext3 volumes to keep a high level of data consistency with regard to the state of the file system.
Speed
Despite writing some data more than once, ext3 has a higher throughput in most cases than ext2 because ext3’s journaling optimizes hard drive head motion. You can choose from three journaling modes to optimize speed, but doing so means trade offs in regards to data integrity.
Easy Transition
It is easy to change from ext2 to ext3 and gain the benefits of a robust journaling file system without reformatting.
ReiserFS
ReiserFS is a general-purpose, journaled computer file system designed and implemented by a team at Namesys led by Hans Reiser.ReiserFS is currently supported on Linux and may be included in other operating systems in the future. Introduced in version 2.4.1 of the Linux kernel, it was the first journaling file system to be included in the standard kernel.
ReiserFS Features
ReiserFS has fast journaling, which means that you don’t spend your life waiting for fsck every time your laptop battery dies, or the UPS for your mission critical server gets its batteries disconnected accidentally by the UPS company’s service crew, or your kernel was not as ready for prime time as you hoped, or the silly thing decides you mounted it too many times today.
ReiserFS is based on fast balanced trees. Balanced trees are more robust in their performance, and are a more sophisticated algorithmic foundation for a file system. When we started our project, there was a consensus in the industry that balanced trees were too slow for file system usage patterns. We proved that if you just do them right they are better–take a look at the benchmarks. We have fewer worst case performance scenarios than other file systems and generally better overall performance. If you put 100,000 files in one directory, we think its fine; many other file systems try to tell you that you are wrong to want to do it.
ReiserFS is more space efficient. If you write 100 byte files, we pack many of them into one block. Other file systems put each of them into their own block. We don’t have fixed space allocation for inodes. That saves 6% of your disk.
Ext3 & ReiserFS has three kinds of journaling methods
1) Journal Data Writeback
2) Journal Data Ordered
3) Journal Data
By default the the 2nd method is used.To speed things up we will make it use method 1. The price to pay is that it may allow old data to appear in files after a crash and journal recovery.
How to make ext3 or reiserfs use journal data writeback
First you need to take a back up of the fstab file using the following command
- sudo cp /etc/fstab /etc/fstab.orig
Edit the /etc/fstab file using the following command
- sudo gedit /etc/fstab
Add the thing marked in bold to your fstab root mount line.
- /dev/hda1 / ext3 defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid,nouser,data=writeback 0 1
Save that file and exit
You need to take a Grubmenu file backup using the following command
- sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.orig
Now you need to edit the grub menu list file using the following command
- sudo vi /boot/grub/menu.lst
look for the following two lines
- # defoptions=quiet splash
- # altoptions=(recovery mode) single
change to
- # defoptions=quiet splash rootflags=data=writeback
- # altoptions=(recovery mode) single rootflags=data=writeback
Save that file and exit
Now you need to update the grub using the following command
- sudo update-grub
the added flags will automatically be added to the kernel line and stay there in case of kernel update
Changes to Ext3 FileSystem Only
Note:- tune2fs only works for ext3. Reiserfs can’t change the journal method
Before rebooting change the filesystem manually to writeback using the following command
- sudo tune2fs -o journal_data_writeback /dev/hda1
Check that it is running or not using the following command
- sudo tune2fs -l /dev/hda1
Remove update of access time for files
Having the modified time change you can understand but having the system updating the access time every time a file is accessed is not to my liking. According to the manual the only thing that might happen if you turn this off is that when compiling certain things the make might need that info.
To change this do the following
- sudo vi /etc/fstab
add the following marked in bold
- /dev/hda1 / ext3 defaults,errors=remount-ro,noatime,auto,rw,dev,exec,suid,nouser,data=writeback 0 1
Now reboot and enjoy a much faster system
Mount network shares at boot. (Ubuntu)
Monday, March 10th, 2008If, like me you have your media and web server kept on another machine, and get annoyed having to put your username and password in each time you want to grab a file or listen to music, then this is for you.
This is the most secure method I could come up with, simply put, if your main machine is not logged on as you, then the shares cannot be accessed without the username and password. When you are logged on these details will be called from a file that is owned by the root user.
This tutorial will assume you have samba already installed on your media/web server. Without it, this will not work.
The following must be done on the SERVER machine
- sudo gedit /etc/samba/smb.conf
I am using GEDIT here to make it easier for you to amend the file. I much prefer PICO, or you may wish to use VI, if your balls are bigger than King Kongs.
Make the following changes:
- workgroup = “WORKGROUP”
Note: The name of the workgroup (in quotes) must be the same on your windows and/or your Ubuntu box. If you do not know the name or your workgroup, look under “My Network Places” on your windows box, select “Microsoft Windows Network” and you will see a list of your workgroups.
Default workgroup on windows XP, home edition is MSHOME (not WORKGROUP).
underneath it, add
- netbios name = name_of_your_server (no spaces)
For example
- netbios name = my_new_smb_server
Make sure the “security” option is set to “user” before moving on.
Scroll down to the bottom of the file and add the following lines:
- [Name_of_folder]
- path = /path/to/file
- browseable = yes
- writable = yes
- read only = no
- guest ok = no
- create mask = 0644
- directory mask = 0755
- force user = root
- force group = root
Do not forget to change the name of the folder and the path to the folder. The name you give this folder will appear in the network folder on your Ubuntu box. ie. Music or Vids etc. and the PATH will be something like this path = /home/user/Music. You will get the jist of it.
Save the changes and close the file.
Restart the samba daemon
- sudo /etc/init.d/samba restart
The following must be done on YOUR computer
Open a terminal session and type the following commands one by one, allowing each of them to finish before executing the next one.
- sudo apt-get install samba
- sudo apt-get install smbfs
Now that you have the core files installed we need to do some configuration.
All folders that you wish to have mounted go into a root level folder called /media. This is much nicer than previous and other version of linux where it was called /mnt. now most will know this means MOUNT but some may not. Anyway, lets get on with it.
Lets make that new directory. If you decided to call your share name “Music” in the part above, you would do this:
- sudo mkdir /media/Music
Obviously, you name it how you want it. for example, I have many shares such as /media/Vids, /media/Music, /media/WWW etc etc.
Now type the following command
- gksudo gedit /root/.smbcredentials
This will create a hidden file called .smbcredentials in your root folder. We will store your username and password in this file for ease of access later on
Insert the following lines into the file: (substituting “yourusername” and “yourpassword” for your ubuntu machine login details)
- username=yourusername
- password=yourpassword
Save and exit the file and issue these commands one by one:
- sudo chmod 700 /root/.smbcredentials
- sudo cp /etc/fstab /etc/fstab_backup
- gksudo gedit /etc/fstab
Now you should be presented with another file. In here we will make the mods that mount those folders on boot up so you don’t have to touch them again. Put the following line at the bottom of the file, making the changes to the location of your server machine. for example, mine is at 192.168.1.125 so I would do this
- //path_to_server/folder_name /media/folder_name smbfs credentials=/root/.smbcredentials,dmask=777,fmask=777 0 0
Once you have added all your mount points and changed the names to correspnd with your details., save and exit the file.
Now issue this final command:
- sudo mount -a
Your new mount points will appear as drive locations on your Desktop and in the Places menu
Citrix ICA Client install on Ubuntu (Feisty and Gutsy)
Monday, March 10th, 2008Citrix is a system that allows you to run applications you have at work/home from anywhere in the world or on your local area network (LAN) from a remote workstation.
You have real time access to run your applications as fast as if you are in the office. It does not matter if you’re using a dialup modem, DSL, ISDN, or T1 to access citrix remotely. Connection speeds become even less of an issue with high speed broadband connections pretty much the norm around the world now.
Citrix was built for virtualisation in mind, and obvioulsy owing to the fact that Microsoft is pretty much everywhere these days the main applications are easy to install on a windows machine, I am not going to cover that in the slightest.
To install Citrix ICA presentation client on your Ubuntu PC then follow the steps below.
Open a Terminal session
The three links below are using the new AptURL command which is installed by default on Ubuntu Gutsy and allows people like myself and any other tutorial writer to make it easier for you to install the packages you need. Just click the link and it will install the package for you. If this does not work, type the following command into the terminal window.
- sudo apt-get install apturl
Now that is out of the way, continue on.
- Click here to install libxaw6
- Click here to install libmotif3
- Click here to install alien (used to convert RPM to DEB packages)
You will now need to download the RPM file from Citrix. NOTE: It is version 10.6 (at time of writing) and is the second download icon (again, at time of writing). As the file names will change with new releases you will need to modify the tutorial to reflect this. You can however just grab the file from me.
Grab the file from here. I believe it is version 10.0 which is slightly out of date but works solidly so I recommend using it.
- http://www.citrix.com/site/SS/downloads/details.asp?dID=2755&downloadID=3323#top
Save the file to your desktop (this tutorial assumes you save it to your desktop, if not please change commands accordingly)
In your terminal window you now need to change to the directory where you saved the file, then we will begin converting and installing.
- cd Desktop
Now that you are on the desktop we now need to convert the file into a .Deb package that Ubuntu can handle.
- sudo alien ICAClient-10.0-2.i386.rpm
Once the file is converted we now need to install it.
- sudo dpkg -i icaclient_10.0-3_i386.deb
Now need to make this work through Firefox web-browser. We will create some symbolic links for Firefox so that it knows how to open the Citrix application file when you attempt to login.
- sudo ln -s /usr/lib/ICAClient/npica.so /usr/lib/mozilla/plugins/npica.so
- sudo ln -s /usr/lib/ICAClient/npica.so /usr/lib/mozilla-firefox/plugins/npica.so
Restart Firefox
Navigate to your Citrix server and login. Click on the application you want to launch. If it asks you to save/open with you will need to choose “open with” and navigate to the following folder:
- /usr/lib/ICAClient
and choose to open with the following application.
- wfica
You should now be good to go.
Edit
I am aware that some people get Font errors with the Citrix Client, it is safe to ignore but if you wish to fix them you can drop me a line in the comments and I will write up the fix.
mod_rewrite on Apache(2) Server
Monday, March 10th, 2008Mod_Rewrite uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly. It supports an unlimited number of rules and an unlimited number of attached rule conditions for each rule to provide a really flexible and powerful URL manipulation mechanism. The URL manipulations can depend on various tests, for instance server variables, environment variables, HTTP headers, time stamps and even external database lookups in various formats can be used to achieve a really granular URL matching.
In most Apache servers the mod_rewrite module is not activated by default. If you wish to have your URL’s changed on the fly and rewritten into nice, human readable format then you will need to enable this module. Follow the steps below to enable mod_rewrite.
Open a Terminal window and type:
- sudo a2enmod
You will be presented with the following, but you can safely ignore what is in front of you and just follow the next steps.
- Which module would you like to enable?
- Your choices are: actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authnz_ldap authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta cgid cgi charset_lite dav_fs dav dav_lock dbd deflate dir disk_cache dump_io env expires ext_filter file_cache filter headers ident imagemap include info ldap log_forensic mem_cache mime mime_magic mod_python negotiation php5 proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy rewrite setenvif speling ssl status suexec unique_id userdir usertrack version vhost_alias
- Module name?
Enter the module name “rewrite” and press enter. Now you need to open the default file with sudo rights and change the “AllowOverride” option from “None” to “All” in the first 2
- sudo pico /etc/apache2/sites-enabled/000-default
Below is what it should look like when you are finished.
<VirtualHost*>- ServerAdmin root@xpheas.com
- DocumentRoot /var/www
<Directory/>- Options FollowSymLinks
- AllowOverride All
</Directory><Directory /var/www>- Options Indexes FollowSymLinks MultiViews
- AllowOverride All
- Order allow,deny
- allow from all
</Directory>
Restart the webserver.
- sudo
/etc/init.d/apache2 force-reload
Now the module is enabled, all that is left is to rewrite your .htaccess for URL changing.
Now that you have mod_rewrite enabled you are going to want to use it. In my next tutorial I will show you how to rewrite your .htaccess file to change ugly URLS into nice URLS. An exmaple of each is below so you can understand what I mean.
Ugly URL
- http://example.com/blog/?p=17
Nice URL, which of course is more search engine friendly and will provide much better SEO.
- http://example.com/blog/index.php/2007/09/17/dont-tase-me-bro/
Search
Previous Posts
- How to: Install Ubuntu packages with HTML link Posted by Soddengecko March 15, 2008
- How to: Increase ext3 and reiserfs performance Posted by Soddengecko March 11, 2008
- Mount network shares at boot. (Ubuntu) Posted by Soddengecko March 10, 2008
- Citrix ICA Client install on Ubuntu (Feisty and Gutsy) Posted by Soddengecko March 10, 2008
- Multi-TouchScreen Computing Posted by Soddengecko June 7, 2007
- Install Lexmark Printers (Ubuntu) Posted by Soddengecko September 28, 2006
- Have Xampp run at boot time Posted by Soddengecko September 27, 2006
- Fix Firefox sound issues (Ubuntu Dapper) Posted by Soddengecko September 27, 2006
- Realplayer Sound fix (Ubuntu all versions) Posted by Soddengecko September 27, 2006
- Ubuntu ‘Open as Root’ Script Posted by Soddengecko September 26, 2006
Recently Updated
Archives
People
Linkies
- Matthew Moore This blog belongs to an associate of mine. He likes to jibber jabber on a bit, and he has decided to document his exercising habits lately, but look back and check out some of the good stuff. Added on March 22nd, 2008 @ 12:08
- Fight for Kisses Probably the best shaving advert I have seen. Not much by the way of pretentious bullshit and it actually has a couple of funny moments. Worth a watch. Added on October 25th, 2007 @ 09:52
- Speedtest.net Speedtest.net is a broadband connection analysis tool with a huge selection of geographically dispersed testing servers. Ookla provides this service free to hundreds of thousands of people every day. If you are experiencing slowness with your Internet connection or are simply interested in testing your speed, Speedtest.net is for you. Added on October 15th, 2007 @ 22:09
- Sadikhov Forums A forum of like minded people helping others achieve the coveted CCNA qualification. The site is aimed at helping those understand the complex issues presented in the exams and making sure you understand them before wasting your money. Added on October 15th, 2007 @ 22:09
- RouterSim.com RouterSim has been the leader in IT simulation training since 1999. RouterSim’s Industry expert Todd Lammle offers you the best learning tools available. We have expanded our offerings to match your budget and needs. RouterSim offers simulators, computer-based training videos, online CCNA simulation testing, and exam preparation software. Added on October 15th, 2007 @ 22:08
- Generic Linux rules of thumb for security The only secure box is turned off and locked in the back room — but it’s also not much use to anyone Added on October 15th, 2007 @ 22:06



by @ 16:37