-
Senior Member
registered user
Using /etc/profile for small programs
.
It may be noted that you can park some useful small programs in /etc/profile,
as opposed to having many small programs just hanging around. Sometimes the
syntax seems a bit more challenging than the usual bash, but workable. These
are composed as root, but execute as knoppix. For example look at the
Count, Channel and Keep snippets in my /etc/profile.
Code:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
# set PATH so it includes user's private bin if it exists
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++ a few lines deleted here for clarity +++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
alias su="sudo su"
umask 022
Count() { # Aid to counting wifi disconnects over time
date '+%h %e %H:%M:%S' ; less /var/log/syslog |
grep restart; less /var/log/syslog | grep -c disconnecting
}
Channel() { # Aid to assessing who's on wifi channels 1 to 11
sudo iwlist wlan0 scan | grep -e Freq -A 3 |
grep "(Channel $1)" -A 3 | grep -v key
}
Keep() { # Aid to backing-up unique user files to /mnt-system
cd /; KEEP=/mnt-system/keep$(date +"%m%d%H").tar.gz
echo -e 'Compressing data; patience, this may take a little time..\c'
tar -cz --exclude */.gvfs/* -f $KEEP \
home/knoppix/ etc/profile etc/rc.local \
etc/X11/Xsession.d/45* etc/syslog-knoppix.conf \
mnt-system/boot/syslinux/syslinux.cfg
echo ".Done."; echo "Restore using the command, tar -xzf '$KEEP' -C /"
}
These snippets are to be executed in an lxterminal as knoppix, of course.
Last edited by utu; 02-25-2013 at 12:06 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
vintage apple macintosh Se
$230.00
Vintage Apple Newton Message pad 1993
$161.00
Vintage APPLE MONITOR III A3M0039 Tested, Working
$179.99
Vintage Apple iBook Laptop 14" G4 1.42GHZ 512MB 60GB SuperDrive Tiger NICE
$149.00
Drakware ADB2USB - vintage Apple ADB to USB keyboard adapter
$29.95
Vintage Classic Apple Macintosh System Boot Install Disk Floppy/CD *Pick Version
$10.39
Vintage Apple iBook G4 Laptop 1.33 GHz 12" LCD screen Mac OS 10.4.11 Model A1133
$39.99
VINTAGE APPLE - Apple 3 License Plate Tag Early 1980s Employee Owned SUPER NICE
$375.00
RARE - Vintage Apple Think Different 11x17 Albert Einstein Poster
$49.99
Vintage Apple 1995 External SCSI CD-ROM Disk Drive AppleCD 600e M3958
$69.99