Skip to main content

Posts

Showing posts from 2008

My Ubuntu

List empty directories using the command 'find'

This is what i tried to list all empty directories : ~$ find . -type d -empty and this is what i got ./.config/transmission/torrents ./.config/transmission/blocklists ./.config/transmission/resume ./.gnome2/eog ./.gnome2/panel2.d/default/launchers ./.gnome2/file-roller ./.update-notifier ./.dosemu/drive_c/tmp ./Templates ./.themes ./.kde/share/mimelnk ./.kde/share/servicetypes ./.kde/share/apps/amarok/albumcovers/cache ./.kde/share/apps/amarok/undo ./.kde/share/apps/konqueror ./.kde/share/applnk ./.kde/share/services ./.gimp-2.6/tmp ./.gimp-2.6/gfig ./.gimp-2.6/scripts ./.gimp-2.6/plug-ins ./.gimp-2.6/gimpressionist ./.gimp-2.6/tool-options ./.gimp-2.6/curves ./.gimp-2.6/themes ./.gimp-2.6/fonts ./.gimp-2.6/levels ./.gimp-2.6/interpreters ./.gimp-2.6/templates ./.gimp-2.6/modules ./.gimp-2.6/gflare ./.gimp-2.6/brushes ./.gimp-2.6/fractalexplorer ./.gimp-2.6/environ ./.gimp-2.6/patterns ./.gimp-2.6/palettes ./.gimp-2.6/gradients ./.icons ./.adobe/Flash_Player/AssetCache/K2USXEKE ./Publi...

Beryl in ubuntu 8.10

Yesterday i tried to install beryl in my ubuntu 8.10....this is what i found.. $ sudo apt-get install beryl-manager Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package beryl-manager Beryl has been overtaken by compiz and I don't think beryl exists any more. So look for compizconfig-settings-manager instead.

Windows Games on Linux

I’d like to focus this time on one special site, which goes so well together with Windows game emulation on Linux that it’s frequently mentioned at WineHQ itself: Home of the Underdogs . “Underdogs”, as it’s commonly referred to, is a site devoted to archiving the forgotten video games of history, from the earliest day to titles as recent as last year, which deserve better recognition. You’re almost guaranteed to find something interesting that you’ve never heard of before. There’s games that just didn’t sell well, games that were released by an obscure company with no promotion, games that were produced by a company that went under, and all sorts of odd bits and pieces. Downloading free abandonware makes for some fun Wine tasting. On a random romp where I just grabbed whatever looked interesting and tried it out, I encountered these gems: Sanitarium While I have yet to have the game go to the second stage without crashing, I might get it fixed. This game is an adventure runner...

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....