Tuesday, February 28, 2012

How to zip or archive or tar a directory and exclude one directory


tar -czpf /path/to/backups/my_backup.tar.gz --exclude path/to/images/tmp path/to/images/

How to enable mod_deflate module on apache2 on Opensuse


Error shown in error log of apache.

[Sun Apr 11 22:41:23 2010] [error] an unknown filter was not added: DEFLATE
  [Sun Apr 11 22:48:54 2010] [error] an unknown filter was not added: DEFLATE
  [Sun Apr 11 22:50:23 2010] [error] an unknown filter was not added: DEFLATE

This means mod_deflate has not been installed. 

To tweak your Apache setup, use the following two lines:
sudo a2enmod deflate
  sudo /etc/init.d/apache2 force-reload
And you'll get rid of those errors.

Saturday, January 21, 2012

How to see disk space utilization in Linux

Listing size and % usage of each partition.

[root@288832-web3 ~]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 279G 265G 0 100% /
/dev/sda2 2.1G 355M 1.7G 18% /tmp
/dev/sda1 104M 26M 73M 26% /boot
tmpfs 13G 0 13G 0% /dev/shm
------------------------------------------------------------------

Find How Much Disk Space Is Being Used Show Display
Login as root
then cd /
then execute: du -hc --max-depth=1
Output:
[root@hostname /]# du -hc --max-depth=1
0 ./net


1.6G ./usr
16K ./lost+found
515M ./proc
8.0K ./misc
648M ./var
112K ./dev
8.0K ./mnt
66M ./lib
8.0K ./selinux
7.3M ./bin
77M ./root
4.2M ./boot
28K ./tmp
2.7M ./backups
20M ./sbin
8.0K ./media
8.0K ./srv
0 ./sys
43M ./etc
42M ./home
8.0K ./opt
3.0G .
3.0G total

Taken from: http://www.wallpaperama.com/forums/linux-command-to-find-how-much-disk-space-is-being-used-show-display-t713.html

Saturday, December 18, 2010

How to hide mounted drive folders on the desktop

1 - Press Alt & F2 and enter this command: gconf-editor

2 - Now browse down to the following key: apps \ nautilus \ desktop

3 - You should see a key in the right-hand pane called volumes_visible. Remove the checkbox from it, and the icons will instantly disappear from the desktop. Remember that you can always access the drives from the “Computer” icon, or easily in the file browser.

You can also check the option to show My Computer icon on the Desktop

My first Ubuntu and its customizations

1. Moving window controls to right

How to change window buttons?

From the Ubuntu 10.04, Lucid Lynx Desktop,

* press "Alt+F2" - You will get the "Run Application" Window.
* Type "gconf-editor" - You will get a Configuration Editor Screen as shown in the figure.
* Goto "Apps -> Metacity -> General" under the window dropdown menu.
* On the right side you can see a key named "button_layout"

It will have a value "maximize,minimize,close" in a different order. Change it to "menu:maximize,minimize,close". The editing can be done by right clicking on the value and pressing "Edit Key".

Press ok. This should do it.