User Tools

Site Tools


linuxsnippets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
linuxsnippets [2007/11/07 14:35] 193.196.193.21linuxsnippets [2008/07/27 14:16] 193.190.253.149
Line 1: Line 1:
 +====== Linux Snippets ======
  
 +
 +
 +
 +
 +===== Disable firewall logging to console =====
 +
 +Edit ''/etc/init.d/klogd'' and set 
 +
 +<file>
 +KLOGD="-c 4"
 +</file>
 +
 +
 +
 +
 +
 +
 +===== mysqldump Options =====
 +
 +  #> mysqldump -u user -p --complete-insert --add-drop-table --databases db1 db2
 +
 +other options
 +
 +<code>
 +--no-data
 +--no-create-info
 +--no-create-db
 +</code>
 +
 +===== Show humanreadable date from timestamp =====
 +
 +  $> perl -e 'print scalar(localtime(1098189697))."\n";'
 +
 +===== Swapfile =====
 +
 +Sometimes you need some swap space. Here is how to add some to a running system:
 +
 +  # dd if=/dev/zero of=/extraswap bs=1M count=512
 +  # mkswap /extraswap
 +  # swapon /extraswap
 +
 +===== Fedora yum Setup =====
 +
 +Import GPG keys for installing via yum
 +
 +  rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
 +
 +===== UTF-8 Terminal on an latin1 system =====
 +
 +Sometimes you need a terminal which can display UTF-8 but your system still uses latin1. Here is what I did:
 +
 +Install a unicode aware teminal emulator:
 +
 +  #> apt-get install rxvt-unicode
 +
 +Make sure you have a UTF-8 locale available eg. ''en_US.utf-8'' (check with ''locale -a''), use ''dpkg --reconfigure locales'' to build one if needed.
 +
 +Add this to your ''~/.bashrc''
 +
 +<file>
 +  alias uterm='LANG=en_US.utf8 urxvt'
 +</file>
 +
 +Now run ''uterm'' whenever you need the UTF-8 terminal.
 +
 +
 +===== Find string in various files =====
 +<code>
 +find . | xargs grep 'string' 
 +</code>
 +
 +Or if you don't need the flexibility of find:
 +
 +<code>
 +grep -R "string" *
 +</code>
 +
 +(-R for recursive; the star as a file matching pattern)
linuxsnippets.txt · Last modified: 2012/08/15 16:21 by 91.64.56.15