-
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
Cisco Nexus 48-Port 10G SFP+ Switch N9K-9396PX w/ 9K-M12PQ 12-Port 40G QSFP
$249.99
Cisco Catalyst WS-C3750X-48PF-L
$59.99
Cisco C3KX-NM-10G 4-Port SFP 10G Expansion Module 3750-X / 3560-X Switch
$50.00
Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03
$8.00
NEW Sealed Cisco SFP-10G-LR 10GBASE-LR SFP+ 1310nm 10km *US Shipping*
$18.00
Cisco QSFP-40G-SR-BD BiDi Short-reach Transceiver, 1 Year Warranty
$17.25
Cisco SFP-10G-LR-S SFP+ 1310nm 10km DOM Transceiver Module 10-3107-01 - 1 Year
$41.59
LOT OF 20 Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module
$89.00
Cisco Meraki MA-SFP-10GB-SR 10G SFP+ SR 850nm 300m LC MMF
$29.99