Category Archives: Linux

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 | Leave a 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

APT: not fully installed or removed

If you get an error like this: apt-get remove slapd … The following packages will be REMOVED: slapd 0 upgraded, 0 newly installed, 1 to remove and 39 not upgraded. 1 not fully installed or removed. Here’s how to fix … Continue reading

Posted in Linux | Leave a comment

Linux: How To Setup Apache With SSL (HTTPS)

Here’s a quickstart basic setup of SSL on Apache running on Ubuntu Desktop 10.04.1: Create your RSA Private Key: $ openssl genrsa -rand file1:file2:file3 -out server.key 1024 Where file1, file2, and file3 are random data (zip files work well here … Continue reading

Posted in Linux | Tagged , , | Leave a comment

Linux: How To Setup AutoFS

Installing AutoFS on Ubuntu Desktop 10.04.1 I followed most of the instructions here: https://help.ubuntu.com/community/Autofs First, install this on the client: # apt-get install -y autofs Edit the /etc/auto.master file: /home /etc/auto.home +auto.master … which means for the local mount point … Continue reading

Posted in Linux | Leave a comment