Skip to main content

Posts

Showing posts from November, 2008

Ubuntu 8.10 Intrepid Ibex Screen Saver Configuration

Screen savers were originally designed to protect the monitor from creating a permanent impression on the screen after projecting a static image for too long of time. These days monitors and LCDs do not have near the tendency to be damaged by a static image. However, screen savers are valuable for security and for entertainment. Office workers often will configure the screen saver so that it is activated after a very short amount of time and can only be unlocked by a password. This way they can walk away from their desk without allowing access to their computer to another worker. Of course, this will be handy for anyone trying to limit access to a desktop. The password to unlock the screen is the password of the user. Screen savers provide a lot of configurable options in terms of choosing the screen saver a user would like to use and when it will be activated. Screen savers can be linked to power saving options so that after a period of time the screen saver will activate reduced ...

Troubleshooting LTSP: Firewall

Firewall You will want to do a lot of testing with the firewall before you call it good. This is an area that often will cause you problems. If you are using the ufw firewall then you will want to enable it first. ufw enable Linux Terminal Server Firewall (DHCP,SSH, Samba) You will need to enable several ports for a LTSP server as it will provide DHCP on ports 67,68 UDP and you may have Samba enabled on ports 139,445 and of course you will want SSH on port 22. ufw allow 67/udp ufw allow 68/udp ufw allow 445/tcp ufw allow 13/tcp

Troubleshooting LTSP: Slow Network Speed

The terminal server is especially sensitive to slow networks. This is simply because the entire operating system is transferred over via the network. You should have at least a 100MB backbone for your network and you should be using switches not hubs. Remove the hubs as they will send messages to all computers on the network as they cannot isolate messages to an individual computer. Ubuntu has several network cards that it is particularly problematic with. I have found that when I experience a slow connection the majority of the time it was a network card that had a bug in the Ubuntu implementation. Check to see if that is the case for your network card as replacing it with a different brand card often made a significant difference. Another issue that may arise to slow down your network is the ipv6 implementation. Turn off ipv6 in Ubuntu and that may help as well.

Setting UP LTSP 5 on Ubuntu 8.04

When you set up LTSP on Ubuntu 8.04 you will notice that it is very easy to get going in LTSP 5. Most of the configuration is automatically done for you. Install the Ubuntu 8.04.1 Desktop CD. You must have a graphical interface running on the server to be provided for the clients. Once you have installed the Desktop, be sure your network is set to operate on a static IP Address. Next you will need to install several programs required for the ltsp setup. sudo apt-get install ltsp-server-standalone openssh-server Create your Thin Client environment on the server with this command: $ sudo ltsp-build-client Update the Desktop System $ sudo apt-get update $ sudo apt-get upgrade Configure DHCP You will supply IP Addresses to the thin clients using DHCP. The file you want to edit is /etc/ltsp/dhcpd.conf. Note this is not the normal dhcpd.conf file that you would edit, this is a special file for LTSP only. Here is a partial example file. The first line ensures that clients will use...

HowTo recompile Debian packages

This article will show how you can  rebuild any debian package . You might need to rebuild a package for various reasons: add/remove some compilation options, make some changes to the sources, or compile a newer version from testing/sid into stable, etc. Regardless of your reason, this can be done very easy using debian tools. First you will need to have some basic debian building tools installed: apt-get install devscripts build-essential 1. Get the source package Debian repositories contain the  sources  for all existing  debian packages . In order to get a source package you will need to have in your  /etc/apt/sources.list  a  deb-src  line (this is exactly as a regular  deb  repository line, but it is for sources). This will look like: deb-src http://ftp.us.debian.org/debian/ etch main non-free contrib change it accordingly to your needs (a close mirror, testing or sid instead of etch, and so on). Once you have your sources file updated refresh your packages lists: apt-get update N...

kill command on Debian

In technical terms, kill simply sends a signal. By default it sends a signal which requests termination ( TERM , or signal 15); but you can also specify a signal, and signal 9 ( KILL ) is the signal which forces termination. The command name kill is not necessarily appropriate to the signal sent; for example, sending the TSTP (terminal stop) signal suspends the process but allows it to be continued later. kill %1 - means Kill off job 1. Bash will report the job information: $ kill %1 [1]- Terminated man cp $ Bash is only asking the job to quit, and sometimes a job will not want to do so. If the job doesn't terminate, you can add the -9 option to kill to stop asking and start demanding. For example: $ kill -9 %1 [1]- Killed man mv $ The -9 option forcibly and unconditionally kills off the job.

Sendmail Multiple Queues

Sendmail  will use by default  a single mail queue . This is what most users will need, and if you don’t have any special requirement you will not care about this. Still for high traffic mail servers it might be useful to  split the queue over several directories , as thousands of files in a single directory will become a performance penalty at some point and also processing the queue sequentially will become very slow.  This post will show how we can implement multiple mail queues with modern sendmail versions . Let’s start by assuming we want to use  8 mail queues . First thing is to  create the actual directories  as sendmail will not do this by default: mkdir /var/spool/mqueue/q{1,2,3,4,5,6,7,8} And fix the permissions to the ones of the original folder /var/spool/mqueue. For ex. this might look like: chown -R smmta:smmsp /var/spool/mqueue/q* using a default sendmail install running on debian. Fix the users to the specific ones found on your system (ls -al /var/spool/mqueue if you ...

Remove debian udev persistent-net-rules

Debian  has a customization to  udev  that will keep  network interface names persistent after hardware changes  and reboots. Normally this is what you want and you will not care about this, but there are cases where this can be very annoying and we just have to  disable  it. I am speaking about situations when you will copy the files from a system and use them to recreate a new system, or when using some virtualization tools and cloning your vm; these situations will always result in network problems caused by the udev persistent rules. If this is an isolated issue you can obviously just  edit the udev rule generated  and fix it (normally we want to have eth0 the existing interface and not something crazy like eth8, for ex.); this is found inside  /etc/udev/rules.d/z25_persistent-net.rules To completely disable this feature and no longer try to keep a static name for each device (in this case a static name for each mac address) we just have to remove  the existing rules files (z25_per...

Ext3 - Reserved blocks percentage

According to  tune2fs  manual,  reserved blocks  are designed to keep your system from failing when you run out of space. Its reserves space for privileged processes such as daemons (like syslogd, for ex.) and other root level processes; also the reserved space can prevent the filesystem from fragmenting as it fills up. By default this is  5%  regardless of the size of the partition. On large partitions (250GB drives and up are quite common these days), the default 5% reserved space can be quite a lot (12.5Gb in my example). For ext3 partitions you can tune this parameter by using tune2fs with the parameter  -m . For ex. to decrease this to 3% you would run (for ex. on /dev/sda1): tune2fs -m3 /dev/sda1 You should be very careful when ‘playing’ with this parameter and be sure you know what you are doing before changing this value.

Determine the Directory Size Recursively

Sometimes you want to ascertain the space hogs on your system. You might have noticed that a certain top level directory is larger than usual, but you are unsure what subdirectory or subdirectories are the culprits. Here's an example of what can be done: #cd / huge_directory #du -k . (current directory size given in kilobytes) To find the sizes recursively (subdirectories): #cd / huge_directory #sh #for  size  in 'ls' do du -k  $size echo  $size done done

Inline Shell Script with a For Loop

Often I'm asked how to traverse a list of items in a file. You can easily go through a list of items using a for loop. Here's an example of copying selected contents of originalDir to destinationDir via the command line. #sh #for i in `cat   /home/esofthub/mylist.dat ` #do #cp -pr / originalDir /$i / destinationDir /. #echo $i done #done sh – shell cat – lists each item in the list one iteration at a time cp – the copy utility for a local workstation (plain files and directories, no symbolic links) -pr – these options preserve the permission, "p" and copies recursively, "r" echo – lists the item copied

HOWTO mount ISO and DD Image Files

Occasionally, I'll download an image file and want to see what is on it, or make a few changes to it before burning it to CD. The image file (dd, iso, etc) can be mounted using the loop device. You will need to know the type of filesystem the image uses. Most Linux/Unix-based OS's have an application that will help you identify the filesystem type. Debian includes the command /lib/udev/vol_id, SUSE has the same command but in a different location (/sbin/vol_id). If you know how to get this information on a SUN box, please leave a comment for us. If you don't have a command that will tell you the filesystem type, you can guess. Most images downloaded from the Internet will be iso9660, Windows filesystems are normally ntfs, Linux are commonly ext2, and Macintosh are udf or hfs. As a last resort, you can work your way down the list of filesystem types listed in the mount man pages. After you know the filesystem type, you are ready to mount. Note: replace   with the filesystem ...

HOWTO Remove a File or Directory Recursively

# rm  filename  (removes a single file) # rm  filename ? (matches single character. e.g.  filename1 ,  filename2 , filename3 ) # rm  filename [1-5] (matches  filename1  thru  filename5 ) # rm  filename * (removes everything that matches  filename . e.g. filename122, filename222, filename.backup ) # rm -rf /home/esofthub/ directoryname  (the -r deletes  directoryname recursively and all its contents without prompting (-f) read only files/directories) # rm -Rf /home/esofthub/ directoryname  (the -R deletes directoryname  recursively and all its contents without prompting (-f) read only files/directories) # pwd Note: Make darn sure you're in the right directory!! For example, you might be inadvertently deleting the contents of  /etc  instead of user defined etc, such as,  /tmp/etc/  or  /raid/etc or /home/esoft/etc . # rm * ((wildcard *) removes everything within a directory # rmdir /home/esofthub/ directoryname  (deletes empty directories)

Common UNIX Find Commands

One of the most useful utilities in the UNIX systems resources directory is the find command. System administrators use this powerful utility frequently. Here are a few common tasks performed by the ubiquitous find command. I'll add more as time goes on. # cd /export/home/esofthub Find a file or directory # find . -name TEMP -print or # find . -name TEMP -exec echo {} \; Find core files in this directory tree and remove them # find . -name "core" -exec rm -f {} \; Find junk directories and remove their contents recursively # find . -name "junk" -exec rm -rf {} \; Find files not starting with "junk" OR not ending with "log" # find . ! \( -name "junk*" -o -name "*log" \) -print Find a pattern in a file using the recursive grep (ignore case) # find . -type f | xargs grep -i  MYPATTERN # find . -name '*.sh' -exec grep -i  MYPATTERN  {} \; Find files modified in the past 7 days # find . -mtime -7 -type f Find files owne...

Create Live USB of any Linux OS

I found a very easy tool to make live usb linux OS..here it is.. 1. Download Ubootnetin. Download 32-bit (i386) Ubuntu/Debian .deb Package Download 64-bit (amd64) Ubuntu/Debian .deb Package Download openSUSE .rpm Packages (Third-party) 2. Its an executable (not install package)...so just run it.. 3. Select the OS you want from the list.. or Select a disk image. The current version has built-in support for the following distributions, though installing other distributions is also supported: Ubuntu (and official derivatives) 6.06 LTS 6.10 7.04 7.10 8.04 LTS 8.10 Daily CD Images Debian Stable/Etch Testing/Lenny Unstable/Sid Linux Mint 3.1 4.0 5-r1 openSUSE 10.2 10.3 11.0 Factory Arch Linux 2007.08 Damn Small Linux 4.4 SliTaz Stable Cooking Puppy Linux 4.00 FreeBSD 6.3 7.0 NetBSD 4.0 Fedora 7 8 9 Rawhide PCLinuxOS 2007 2008 Gentoo 2007.0 2008.0 Zenwalk 5.2 Slax 6 Dreamlinux 3.2 Elive Development CentOS 4 5 Mandriva 2007.1 2008.0 2008.1 FaunOS 0.5.4 Frugalware Linux Stable Testi...

Ubuntu 30-Mount Check Annoyance

If you’ve used Ubuntu Linux for longer than a month, you’ve no doubt realized that every 30 times you boot up you are forced to run a filesystem check. This filesystem check is necessary in order to keep your filesystem healthy. Some people advise turning the check off completely, but that is generally not a recommended solution. Another solution is to increase the number of maximum mounts from 30 to some larger number like 100. That way it’s about 3 times less annoying. But this solution is also not recommended. Enter AutoFsck. AutoFsck is a set of scripts that replaces the file system check script that comes shipped with Ubuntu. The difference is that AutoFsck doesn’t ruin your day if you are so unfortunate to encounter the 30th mount. The most important difference is that AutoFsck does its dirty work when you shut your computer down, not during boot when you need your computer the most! The 30th time you mount your filesystem, AutoFsck will wait until you shut down your computer....

Testing your system for USB boot compatibility

The following tutorial will enable a user to check if a computer system can boot from a USB device and ultimately help determine if the computer can boot a Linux version from USB. In most cases if the test is successful, you should have no problem running Linux portably. In addition to testing your PC for USB Linux boot capability, the " Memtest86 " system memory diagnostics program that is included, allows the user to scan their system memory for errors by simply booting memtest from a USB device or flash drive. Basic USB Boot Test Essentials: USB flash device USBTest.zip (includes Memtest, Syslinux and a custom batch file) Installing Memtest on USB to test for USB Boot compatibility: The following explains how to install Memtest on a USB device and further run Memtest from USB. Enabling us to test whether a system can boot from USB. Download the USBTest.zip and extract the contents of the zip to your flash drive. See Screenshot below: Navigate to your flash drive and ...

DOSBOX RUN DOS APPLICATIONS AND GAMES IN UBUNTU LINUX

DOSBOX RUN DOS APPLICATIONS AND GAMES IN UBUNTU LINUX sudo apt-get install dosbox (Your can use Synaptic Package Manager and search for dosbox) After Installation you can make a folder xxxxx in your home directory (eg: $mkdir mydos) copy your favorite dos programs and games like Turboc, dave, digger etc in this directory Now you can run dosbox by typing dosbox in a terminal or by select it from menu You will get a small dos window with Z:\> prompt in Z prompt type the following Z:\> mount c /home/xxx/mydos This command for mounting your dos directory to C Drive (in my case my dos files are in /home/xxx/mydos ) Now You are ready for running your dos programms Z:\> c: ( change drive to c:) Z:\> dir (this will list your dos files placed in /home/xxx/mydos) if ther is our old famous digger game Z:\> digger and Enjoy it. More Topics : Themes for Ubuntu Intrepid Ibex Edit NTFS partitions on Linux (Ubuntu, Debian ...)... Who is Linux Torvalds? Origin: Famou...

Howto find Disk usage of Packages in ubuntu

The following command help you to find the disk space used by different packages in ubuntu open a terminal window and run the command dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}' That will sort the packages by size, putting the largest ones on the bottom. you can pipe(|} the output for last 10 by using | tail -n 10 at the end of the command

How to Restore Your USB Key to it's original state

After having tooled around with a USB Linux version using your multi partitioned flash pen drive, you might find it necessary to revert it back to a single fat partition (restore the flash pen drive to it's original state) that can again be read by all computers. For those working from Linux this task can easily be accomplished via the following Linux tutorial. Windows users can Download and use either the SP27608 HP-USB Format tool or follow the Windows instructions below that utilizes the newer HP USB Format tool. WARNING: This process will delete any information that is currently stored on the USB key. Proceed with caution! Restoring your USB key to it's original state via Windows: Download the HP USB Format tool Run the USB Format tool. Select your Device from the list, select your File system type, and click Start to format the drive: That's it, your USB flash drive should now be formatted in a singular partition just as it was from the factory Restoring yo...