-
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.
-
Senior Member
registered user
Countering .gvfs due to PCManFM
.
A hidden user mount point directory .gvfs occurs in Knoppix's /home/knoppix when some programs
such as PCManFM are first activated. This hidden file must be taken into account for some operations
one might choose to perform.
One of the more clever approaches to handling this nuisance may be found at post #10 of
http://forums.opensuse.org/english/g...nied-gvfs.html
This approach takes care of removing .gvfs after its appearance on first using PCManFM
for one boot-up session. I've added this as a 'one-liner' to my /etc/profile. Rm.gvfs works only
when called by root; I use a root lxterminal for this command.
Code:
Rm.gvfs () { # Remove user mount directory .gvfs
umount /home/knoppix/.gvfs; find . -inum 554009 -exec rm{} \;; rm -rf .gvfs
}
Be careful making small changes on this command; even the punctuation is critical.
I am not aware what other programs may also cause the appearance of .gvfs.
If there are others, some revision of this approach may be necessary.
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
![Samsung - S Pen Creator Edition - White picture](/store/img/g/nicAAOSwg8Nl-6GK/s-l225/Samsung-S-Pen-Creator-Edition-White.jpg)
Samsung - S Pen Creator Edition - White
$38.00
![Genuine OEM Samsung Galaxy Tab S6 Lite Book Cover -NEW EF-BP610PJEGUJ- #E4 picture](/store/img/g/eO0AAOSwbkllzTa3/s-l225/Genuine-OEM-Samsung-Galaxy-Tab-S6-Lite-Book-Cover-.jpg)
Genuine OEM Samsung Galaxy Tab S6 Lite Book Cover -NEW EF-BP610PJEGUJ- #E4
$10.00
![Samsung - Galaxy Book4 15.6](/store/img/g/rkUAAOSwAW1mDtCs/s-l225/Samsung-Galaxy-Book4-15-6-FHD-Laptop-Intel-Core-7-.jpg)
Samsung - Galaxy Book4 15.6" FHD Laptop - Intel Core 7- 16GB Memory - 512GB S...
$599.99
![NEW Samsung Galaxy Tab S6 Lite SM-P610 128GB, Wi-Fi, 10.4](/store/img/g/ID4AAOSw4nBmdYxE/s-l225/NEW-Samsung-Galaxy-Tab-S6-Lite-SM-P610-128GB-Wi-Fi.jpg)
NEW Samsung Galaxy Tab S6 Lite SM-P610 128GB, Wi-Fi, 10.4" - Oxford Gray
$169.98
![Samsung Galaxy Tab A9+ 11.0](/store/img/g/qbUAAOSw1o1l1Rtt/s-l225/Samsung-Galaxy-Tab-A9-11-0-64GB-Gray-Wi-Fi-Tablet-.jpg)
Samsung Galaxy Tab A9+ 11.0" 64GB Gray Wi-Fi Tablet Bundle SM-X210NZAYXAR 2023
$149.99
![Samsung Galaxy Tab A9+ SM-X210N WIFI 128GB Graphite Very Good picture](/store/img/g/OP4AAOSwLxVmb2ml/s-l225/Samsung-Galaxy-Tab-A9-SM-X210N-WIFI-128GB-Graphite.jpg)
Samsung Galaxy Tab A9+ SM-X210N WIFI 128GB Graphite Very Good
$159.99
![Samsung Galaxy Tab A Tablet SM-T580 16GB WiFi Only Black - EXCELLENT picture](/store/img/g/Lo0AAOSw931mZ0ra/s-l225/Samsung-Galaxy-Tab-A-Tablet-SM-T580-16GB-WiFi-Only.jpg)
Samsung Galaxy Tab A Tablet SM-T580 16GB WiFi Only Black - EXCELLENT
$35.00
![Samsung Galaxy Tab A 8](/store/img/g/AvcAAOSwBwZlcywM/s-l225/Samsung-Galaxy-Tab-A-8-SM-T387V-32GB-Verizon-Table.jpg)
Samsung Galaxy Tab A 8" SM-T387V 32GB Verizon Tablet (No SIM Tray) Grade B
$31.99
![OEM Samsung Galaxy Tab S9 Ultra 14.6](/store/img/g/yzcAAOSwVO1mGCVK/s-l225/OEM-Samsung-Galaxy-Tab-S9-Ultra-14-6-Book-Cover-Ke.jpg)
OEM Samsung Galaxy Tab S9 Ultra 14.6" Book Cover Keyboard, Black, EF-DX915UBEGUJ
$249.99
![Samsung 1.6TB SSD SAS 2.5](/store/img/g/OC8AAOSwJd5mVldl/s-l225/Samsung-1-6TB-SSD-SAS-2-5-12G-PM1635-MZILS1T6HCHP-.jpg)
Samsung 1.6TB SSD SAS 2.5" 12G PM1635 MZILS1T6HCHP NetApp 520 Block
$74.99