Category Archives: Linux

Ubuntu: Auto Install From USB Key Using Kickstart

1.  Create a bootable USB key using an alternate version of any Ubuntu iso. 2. Edit syslinux/txt.cfg label install-serv menu label ^Auto Install 11.04 Server menu default kernel /install/vmlinuz append noprompt cdrom-detect/try-usb=true persistent vga=788 \ initrd=/install/initrd.gz quiet \ ks=http://your.kickstart.domain.com/your-kickstart-file.cfg –

Posted in Linux | Tagged , | Leave a comment

fswebcam: Unable to load font ‘luxisr’: Could not find/open font

# apt-get install -y apt-file # apt-file update # apt-file search luxisr.ttf ttf-xfree86-nonfree: /usr/share/fonts/truetype/ttf-xfree86-nonfree/luxisr.ttf

Posted in Linux | Tagged , , , , , , | Leave a comment

SVN: Send Emails With Every Commit

SVNROOT=/svn cd $SVNROOT/hooks cp post-commit.tmpl post-commit chmod 755 post-commit vim post-commit Send Nicely Formatted Emails post-commit: REPOS=”$1″ REV=”$2″ SHARE=”/usr/share/subversion” $SHARE/hook-scripts/commit-email.pl “$REPOS” “$REV” -l /tmp/log –from svn you@email.com Modify URLs in email to link to ViewVC pages /usr/share/subversion/hook-scripts/commit-email.pl: @@ -451,23 +451,24 … Continue reading

Posted in Linux | Tagged , | 1 Comment

Ubuntu: How To Setup ViewVC Via APT-GET

apt-get install -y apache2 viewvc libapache2-mod-python2.6 vim /etc/viewvc/viewvc.conf Single Repository: svn_roots = svn: /svn root_as_url_component = 1 Multiple Repositories: root_parents = /svn : svn root_as_url_component = 1 Apache Virtualhost: ServerName your.domain.com DocumentRoot /your/web/directory ScriptAlias /viewvc “/usr/lib/cgi-bin/viewvc.cgi” Browser: http://your.domain.com/viewvc Do not … Continue reading

Posted in Linux | Tagged , , , | Leave a comment

Linux: How To Setup SVN+SSH Repository And Server

Server: SVNROOT=/home/svnroot mkdir -p $SVNROOT svnadmin create $SVNROOT chown -R $USER: $SVNROOT Client: svn co svn+ssh://svn.cs.lmu.edu$SVNROOT

Posted in Linux | Tagged , , | Leave a comment

VIM: Open Files At The Same Line Where You Left Off Last

Add this to your .vimrc file: au BufWinLeave * mkview au BufWinEnter * silent loadview

Posted in Linux | Tagged , | Leave a comment

Bash: How To Get Absolute Value Using BASH

echo ‘-12′ | nawk ‘{ print ($1 >= 0) ? $1 : 0 – $1}’

Posted in Languages, Linux | Tagged | 1 Comment

Bash: How To Do Floating Point Division in BASH Shell

# echo – | awk ‘{ print 3/9}’ 0.333333

Posted in Linux | Tagged , , , | 1 Comment

Bash: Get File Size

#!/bin/bash FILENAME=/home/heiko/dummy/packages.txt FILESIZE=$(stat -c%s “$FILENAME”) echo “Size of $FILENAME = $FILESIZE bytes.”

Posted in Linux | Tagged , , , | Leave a comment

Linux: How To Disable Debugfs

sudo mv /etc/init/ureadahead.conf /etc/init/ureadahead.conf.disable

Posted in Linux | Leave a comment

Linux: Automatically Remove Old Files And Directories

Remove files and directories older than 30 days old: tmpreaper –mtime-dir –verbose 30d [directory]

Posted in Linux | Leave a comment

Linux: Install NIS With No Interaction

How to install NIS silently, bypassing the NIS Domain prompt On a test system, do the normal install of NIS $ apt-get install nis Then, install the debconf-utils package to read the variables it set during install $ apt-get install … Continue reading

Posted in Linux | Leave a comment

Linux: How To Mount ISO File

mount -o loop -t iso9660 filename.iso /whatever/mount/point/dir

Posted in Linux | Leave a comment

Linux: df: /nfs/user: Stale NFS file handle

# umount /nfs/user

Posted in Errors, Linux | Leave a comment

Linux: How To Run A Service At Startup

# chkconfig sendmail on

Posted in Linux | Leave a comment

Linux: How To Scan For Rootkits

# apt-get install -y chkrootkit # apt-get install -y rkhunter

Posted in Linux, Security | Leave a comment

Linux: How To Forward SSH Agent With Sudo

Edit your sudoers file: # su # /usr/sbin/visudo Add this line: Defaults env_keep=SSH_AUTH_SOCK Or for multiple variables: Defaults env_keep=”SSH_AUTH_SOCK EDITOR”

Posted in Linux | 1 Comment

Subversion: svn: Can’t open file ‘txn-current-lock’: Permission denied

To solve this problem, run svnserve as root (or as the user who has permissions to your svn root dir): # sudo bash # svnserve -d –foreground -r /home/svn OR # chown -R subversion: /home/svn # su – subversion # … Continue reading

Posted in Errors, Linux | Leave a comment

Linux: How To Setup NIS

How To Setup NIS on Ubuntu Server 10.04.1 Follow the steps here: https://help.ubuntu.com/community/SettingUpNISHowTo Some additional notes: Quick NIS Client Setup Script #!/bin/bash echo “+::::::” >> /etc/passwd echo “+::::::::” >> /etc/shadow echo “+:::” >> /etc/group echo “ypserver my-nis-server.com” >> /etc/yp.conf How … Continue reading

Posted in Linux | Leave a comment

OpenLDAP: failed init (bdb)

Find the bdb module: # find /usr -name back_bdb.la /usr/lib/ldap/back_bdb.la Add this to your slapd.conf: modulepath /usr/lib/ldap moduleload back_bdb.la Restart slapd: # /etc/init.d/slapd restart Stopping OpenLDAP: slapd. Starting OpenLDAP: slapd.

Posted in Linux | 2 Comments