-
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
![A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture](/store/img/RCAAAOSweqdeWaui/s-l225//A-Tech-8GB-DDR3-1600-PC3-12800-Laptop-SODIMM-204-P.jpg)
A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G
$13.99
![Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory picture](/store/img/~u4AAOSwK-liKn7t/s-l225//Team-T-FORCE-VULCAN-Z-32GB-2-x-16GB-PC-RAM-DDR4-32.jpg)
Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory
$50.99
![Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3 picture](/store/img/mecAAOSw2Vlkv6Ot/s-l225//Crucial-DDR3L-16GB-1600-2x-8GB-PC3-12800-Laptop-SO.jpg)
Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3
$13.50
![HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin picture](/store/img/XNYAAOSwg81kv6CG/s-l225//HyperX-FURY-DDR3-8GB-16GB-32GB-1600-MHz-PC3-12800-.jpg)
HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin
$16.50
![HyperX FURY DDR4 4GB 8GB 16GB 32GB 3200 2400 2666 Desktop RAM Memory DIMM 288pin picture](/store/img/8XUAAOSwupJkv6B5/s-l225//HyperX-FURY-DDR4-4GB-8GB-16GB-32GB-3200-2400-2666-.jpg)
HyperX FURY DDR4 4GB 8GB 16GB 32GB 3200 2400 2666 Desktop RAM Memory DIMM 288pin
$8.99
![Kingston HyperX FURY DDR3 8GB 16GB 32G 1600 1866 1333 Desktop Memory RAM DIMM picture](/store/img/DWUAAOSw5e1kv6CT/s-l225//Kingston-HyperX-FURY-DDR3-8GB-16GB-32G-1600-1866-1.jpg)
Kingston HyperX FURY DDR3 8GB 16GB 32G 1600 1866 1333 Desktop Memory RAM DIMM
$13.25
![HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM picture](/store/img/AhQAAOSwWi1kv6Pb/s-l225//HyperX-FURY-RAM-DDR4-16GB-8GB-32GB-4GB-3200-2666-2.jpg)
HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM
$9.64
![A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G picture](/store/img/HVQAAOSwZR1fWlxU/s-l225//A-Tech-8GB-PC3-12800-Desktop-DDR3-1600-MHz-Non-ECC.jpg)
A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G
$13.99
![USB Flash Drive Memory Stick Pendrive Thumb Drive 4GB, 8GB, 32GB, 64GB 128GB LOT picture](/store/img/EI0AAOSwsBpju-XZ/s-l225//USB-Flash-Drive-Memory-Stick-Pendrive-Thumb-Drive-.jpg)
USB Flash Drive Memory Stick Pendrive Thumb Drive 4GB, 8GB, 32GB, 64GB 128GB LOT
$249.37
![Lot Of 10 Mixed Samsung 16GB 2Rx4 PC4-2133P RDIMM DDR4-17000 ECC Server Memory picture](/store/img/kesAAOSwBG1mRt49/s-l225//Lot-Of-10-Mixed-Samsung-16GB-2Rx4-PC4-2133P-RDIMM-.jpg)
Lot Of 10 Mixed Samsung 16GB 2Rx4 PC4-2133P RDIMM DDR4-17000 ECC Server Memory
$134.99