Most recent edit on 2010-08-31 22:59:45 by JimLucas
Additions:
0 0 * * 0 /bin/sh somecommandhere
0 0 * * 0 root /bin/sh somecommandhere
Deletions:
0 * * * * /bin/sh somecommandhere
0 * * * * root /bin/sh somecommandhere
Edited on 2010-08-31 22:56:47 by JimLucas
Additions:
# mkdir /mnt/cdrom
# mkdir /mnt/hd2
3. unmount iso
5. unmount usb
Deletions:
# mkdir /mnt/cdrom
# mkdir /mnt/hd2
3. un-mount iso
4. un-mount usb
Edited on 2010-08-31 22:56:04 by JimLucas
Additions:
First off make your mount points
# mkdir /mnt/hd2
1. mount CDROM at start up with /etc/fstab
# mount /mnt/cdrom
3. un-mount iso
# umount /mnt/cdrom
# vnconfig -u svnd0
4. mount usb
4. un-mount usb
# umount /mnt/usb
Deletions:
1. mount CDROM
#mount /mnt/cdrom
3. mount usb
Edited on 2010-04-13 16:54:18 by JimLucas
Additions:
Here is my example tunnel script:
#! /bin/sh
# Starts a listening daemon that captures SMDR information
# Author: Jim Lucas <jlucas@cmsws.com>
# Version: 0.0.1
set -e
DESC="PBX Tunnel"
PIDFILE=/var/run/tunnel.pid
L_IP=192.168.1.10
L_PORT=8888
R_IP=192.168.0.10
R_PORT=80
#
# Function that starts the daemon/service.
#
d_start() {
if [ -f $PIDFILE ]; then
echo "$DESC already running: PID# `cat $PIDFILE`"
exit 1
else
echo "Starting $DESC"
nohup /usr/bin/ssh -2 -N -f -L $L_IP:$L_PORT:$R_IP:$R_PORT root@localhost 1>/dev/null
sleep 0.5
ps auxww | grep "$L_IP:$L_PORT:$R_IP:$R_PORT" | grep -v grep | awk -F' ' '{print $2}' > $PIDFILE
echo "$DESC Started #`cat $PIDFILE`"
fi
}
#
# Function that stops the daemon/service.
#
d_stop() {
if [ -f $PIDFILE ]; then
echo -n "Stopping $DESC"
kill `cat $PIDFILE`
rm $PIDFILE
echo "."
else
echo "$DESC is not running"
exit 1
fi
}
case "$1" in
start)
d_start
;;
stop)
d_stop
;;
status)
if [ -f $PIDFILE ]; then
echo "$DESC is running: PID# `cat $PIDFILE`"
else
echo "$DESC is not running"
fi
;;
cleanup)
PID="`ps auxww | grep "$L_IP:$L_PORT:$R_IP:$R_PORT" | grep -v grep | awk -F' ' '{print $2}'`"
kill $PID
rm $PIDFILE
;;
restart|force-reload)
d_stop
sleep 0.5
d_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
Edited on 2010-01-11 16:12:54 by JimLucas
Additions:
~-OpenBSD / Asterisk / FreePBX installation & setup
Edited on 2009-08-26 12:46:23 by JimLucas
Additions:
~-How to install and setup a single board computer
Edited on 2009-08-26 08:55:05 by JimLucas
Additions:
Setting up package management
# uname -a
OpenBSD serv0.cmsws.com 4.3 GENERIC#698 i386
# PKG_PATH=ftp://ftp.usa.openbsd.org/pub/OpenBSD/4.3/packages/i386/∞
# export PKG_PATH
# pkg_add rsync
Edited on 2009-08-24 13:10:59 by JimLucas
Additions:
ssh -2 -N -f -L 192.168.0.10:8888:172.16.0.10:80 root@localhost
Deletions:
ssh -2 -N -f -L 192.168.0.10:8888:172.16.0.10:80 root@localhost
Edited on 2009-08-24 13:10:45 by JimLucas
Additions:
root@localhost is the user that you create the connection with
Edited on 2009-08-24 13:10:08 by JimLucas
Additions:
Setting up an SSH tunnel
ssh -2 -N -f -L 192.168.0.10:8888:172.16.0.10:80 root@localhost
-2 forces ssh version 2
-N Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only).
-f forces ssh to run in the background
-L [bind_address:]port:remote_host:hostport
Edited on 2009-02-04 11:08:56 by JimLucas
Additions:
~-GNUMP3d related stuff
Edited on 2009-01-29 15:11:25 by JimLucas
Additions:
| | | | | | commands
| | | | | | |
Deletions:
| | | | | | commands
| | | | | | |
Edited on 2009-01-29 15:11:14 by JimLucas
Additions:
| | | | | user account to run command as
| | | | | | commands
| | | | | | |
0 * * * * root /bin/sh somecommandhere%%
Deletions:
#minute (0-59)
#| hour (0-23)
#| | day of the month (1-31)
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | user to be ran as
#| | | | | | commands
#| | | | | | |
0 * * * * root /bin/sh somecommandhere
Edited on 2009-01-29 15:09:34 by JimLucas
Additions:
minute (0-59)
| hour (0-23)
| | day of the month (1-31)
| | | month of the year (1-12 or Jan-Dec)
| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
| | | | | commands
| | | | | |
0 * * * * /bin/sh somecommandhere%%
Deletions:
#| hour (0-23)
#| | day of the month (1-31)
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | commands
#| | | | | |
0 * * * * /bin/sh somecommandhere%%
Edited on 2009-01-29 15:08:58 by JimLucas
Additions:
#| | day of the month (1-31)
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | commands
#| | | | | |
0 * * * * /bin/sh somecommandhere%%
Deletions:
#| | day of the month (1-31)
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | commands
#| | | | | |
00 * * * * /bin/sh somecommandhere%%
Edited on 2009-01-29 15:08:44 by JimLucas
Additions:
#| hour (0-23)
#| | day of the month (1-31)
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | commands
#| | | | | |
Deletions:
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | commands
#| | | | | |
Edited on 2009-01-29 15:08:19 by JimLucas
Additions:
Crontab layout
When issued as "crontab -e" this is the correct format
#minute (0-59)
#| hour (0-23)
#| | day of the month (1-31)
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | commands
#| | | | | |
#### Sunday at midnight
00 * * * * /bin/sh somecommandhere
When issued as "crontab -e" this is the correct format
#minute (0-59)
#| hour (0-23)
#| | day of the month (1-31)
#| | | month of the year (1-12 or Jan-Dec)
#| | | | day of the week (0-6 with 0=Sun or Sun-Sat)
#| | | | | user to be ran as
#| | | | | | commands
#| | | | | | |
#### Sunday at midnight
0 * * * * root /bin/sh somecommandhere
Edited on 2008-12-30 21:22:28 by JimLucas
Additions:
~-Install Postfix and Dovecot with MySQL & SASL support
Edited on 2008-10-26 21:31:13 by JimLucas
Additions:
Different CLI options
find ./ -type f -name "*.jpg" | sed -e "s/\(.*\)/\"\\1\"/" | xargs rm
Oldest known version of this page was edited on 2008-05-02 09:19:00 by JimLucas []
Page view:
How to mount different things
1. mount CDROM
# mkdir /mnt/cdrom
# echo "/dev/cd0a /mnt/cdrom cd9660 ro,nodev,nosuid,noauto 0 0" >> /etc/fstab
#mount /mnt/cdrom
2. mount iso
# vnconfig svnd0 /usr/local/share/4.1.iso
# mount -t cd9660 /dev/svnd0c /mnt/cdrom
3. mount usb
# mkdir /mnt/usb
# mount_msdos /dev/sd0i /mnt/usb