-
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
wooting 60 he keyboard
$222.00
Computer Continuum Analog Interface
$49.00
One of a kind Donner 3500 Analog Computer with 2 Multi-Computer contrrol Units
$12500.00
Soviet Union Baltik analog computer ZX Spectrum USSR
$118.00
Vintage 1980 Intel 2920 Analog Signal Processor Design Handbook Retro Computer
$27.95
Honeywell Analog Flight Computer from 1965 lots of Germanium parts USA Made.
$250.00
Analog Computing Magazine - December 1985 no. 37 special holiday issue
$10.00
Soviet Union keyboard for analog computer ZX Spectrum USSR
$50.00
Extron RGB-160XI Analog Computer Video 60-378-01
$187.06
Raritan 4U 42PT Paragon II KVM (P2-UMT442)
$1299.90