Results 1 to 2 of 2

Thread: Using /etc/profile for small programs

  1. #1
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    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.

  2. #2
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    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
  •  


Lenovo IdeaPad 5i Laptop, 15.6

Lenovo IdeaPad 5i Laptop, 15.6" FHD Touch, Intel i5-1235U, 16GB, 512GB SSD

$599.99



Lenovo Thinkpad Yoga Touchscreen Laptop Computer Windows 10 4GB 128GB SSD HDMI picture

Lenovo Thinkpad Yoga Touchscreen Laptop Computer Windows 10 4GB 128GB SSD HDMI

$149.99



Lenovo ThinkPad 11e Chromebook 11.6

Lenovo ThinkPad 11e Chromebook 11.6" Laptop | 16GB SSD | Chrome OS

$33.96



Lenovo Yoga Touchscreen Quad Core Laptop Windows 10 4GB 128GB SSD HDMI Warranty picture

Lenovo Yoga Touchscreen Quad Core Laptop Windows 10 4GB 128GB SSD HDMI Warranty

$149.99



Lenovo Legion 5 15.6

Lenovo Legion 5 15.6" 120Hz Laptop AMD R5-4600H 8GB RAM 512GB SSD GTX 1650Ti

$539.00



Lenovo 300e G2 11.6

Lenovo 300e G2 11.6" 2-in-1 Touch Laptop Intel N4100 4GB 64GB Flash Win10 Pro B

$99.99



Lenovo Legion 5 Pro 16 165Hz QHD IPS G-Sync Ryzen 7 16GB RAM 1TB SSD RTX 3070 picture

Lenovo Legion 5 Pro 16 165Hz QHD IPS G-Sync Ryzen 7 16GB RAM 1TB SSD RTX 3070

$1391.00



Lenovo - IdeaPad 3 15

Lenovo - IdeaPad 3 15" HD Touch Screen Laptop - Intel Core i3-1115G4 - Intel ...

$349.99



Lenovo ThinkPad T460 14

Lenovo ThinkPad T460 14" Laptop Core i7-6600U 6th 2.60GHz WebCam Backlit HDMI

$175.00



Lenovo ThinkBook 15 Gen 4 Intel Laptop, 15.6

Lenovo ThinkBook 15 Gen 4 Intel Laptop, 15.6" FHD IPS Touch Narrow Bezel

$821.08