Guest anon Posted September 13, 2003 Report Share Posted September 13, 2003 : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Tracking your reboots [#2] LOST #351 To know the history of your last few re-boot sequences, do: # last reboot ####[sacha (at) sacha.mine.nu]################################ : % : ####[ Linux One Stanza Tip (LOST) ]########################### Sub : Restrictive shell (bash -r) LOST #352 Want to restrict some user to his own directory ? Keep the default shell to "bash -r" or "rbash", It behaves identical to bash except that cd to / or other dirs, changing environment and few other features are disabled. View "man bash" for rest. ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ Linux One Stanza Tip (LOST) ]########################### Sub : Keeping mails as unread under mutt LOST #353 Mutt flags all old mails to "O", once read. To avoid this "O" flag, in .muttrc add 'set nomark_old'. For keeping them with unread mails flag ("N") add 'set mark_old=no". ####[Discussions on LIH: 29 Aug 2002]######################## : % : ####[ Linux One Stanza Tip (LOST) ]########################### Sub : Bothered by spam ? LOST #354 Spamassassin tries to figure out heuristically if a message is spam. It does this by applying many rules to the message, and assigning each rule a score (positive OR negative) ... If the score goes above a predefined number, it's flagged as spam and you can do the rest. [Visit: ]http://www.spamassassin.org]. ####[ajitabhpandey (at) users.sourceforge.net]################ : % : ####[ Linux One Stanza Tip (LOST) ]########################### Sub : Bothered by spam ? LOST #355 Tackle the spam problem with Exim and Spamassassin, How ? http://marc.merlins.org/linux/exim/sa.html http://dman.ddts.net/~dman/config_docs/index_.html http://bogmog.sourceforge.net/document_sho....php3?doc_id=28 ####[ragu (at) vsnl.com]###################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Mounting USB storage devices LOST #356 USB mass storage devices are mounted as virtual scsi devices. When you insert the drive into the USB port, it is normally auto-detected at boot. Check with "dmesg" which may show some- thing like "USB Mass Storage device as /dev/sda1". As root do: # mount /dev/sda1 /mnt/{mountpoint} ####[vipul (at) linux-delhi.org]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : RAID and grub boot loader LOST #357 The first problem with GRUB is that it does not work well with software raid. The second problem is that if you have mirrored disks and the first disk fails, you end up with a non-bootable system because the second disk does not contain a valid MBR !! LILO, on the other hand, handles this correctly. ####[rajesh (at) symonds.net]################################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Knowing contents of .tbz files LOST #358 Knowing the contents of a .tbz file is a one step process: $tar -tyvf filename.tbz | less A .tbz file is essentially a bzipped-tarball (.tar.bz) file. ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Re-initialising X resources LOST #359 You can reload your X-resources explicitly without restarting X. Changes to your .Xdefaults file will not take effect until the next time you restart X ... To reload X-resources without restarting X, do: $xrdb -load ~/.Xdefaults ####[akj (at) cyberspace.org]################################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Resources for postgres LOST #360 http://www.greatbridge.com ( commercial support ) http://www.greatbridge.org ( latest open source projects ) http://www.postgreSQL.org ( official documentation ) ####[deval (at) giaspn01.vsnl.net.in]######################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Listing all files with SUID bit set LOST #361 To list all files with SUID bit set, as root do: #find / -type f -perm +6000 -ls Then to remove the suid bit of some (if needed) do: #chmod -s </path/filename> ####[vivekachary (at) yahoo.com]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Finding all files world-writeable LOST #362 To track all files that are world writable (and therefore may be a security issue), as root do: #find / -perm -2 ! -type l -ls ####[vivekachary (at) yahoo.com]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Tracking files without owner/ group LOST #363 To list all files without an owner/ group (a security related issue), as root do: #find / -nouser -o -nogroup -ls ####[vivekachary (at) yahoo.com]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Tracking files changed in last 24 hrs LOST #364 To track all files that have been modified in last 24 hours, (a security related issue), as root do: #find / -mtime 1 -o -ctime 1 ####[vivekachary (at) yahoo.com]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Worried regarding system intrusions ? LOST #365 There are various methods described in: www.tldp.org/HOWTO/Security-Quickstart-HOWTO/intrusion.html You may even consider installing an IDS like: tripwire <http://www.tripwire.org> (or its replacement, AIDE). Still further, you can get proactive and nail the cracker http://www.sans.org/newlook/resources/IDFA...AQ/honeypot.htm ####[vivekachary (at) yahoo.com]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Fingerprinted with nmap ? LOST #366 - Avoid getting fingerprinted by nmap: http://www.linuxjournal.com/article.php?sid=4750> http://packetstormsecurity.nl/linux/securi...indexdate.shtml ####[shyamk (at) eth.net]##################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : A date prompt while on mutt LOST #367 #!/bin/bash l=${LINES:-25}; c=${COLUMNS:-80}; c=$[$c-22] ( while :; do m="`date +%a %d %b [%T]`" echo -ne "e7e[${l};${c}He[0me[1;33m $m e[0me8"; done) & pid=$!; mutt $*; kill -9 "$pid"; echo -ne "e[0m" ####[ssiyer (at) cs.rice.edu]################################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Date prompt with console programs LOST #368 #!/bin/bash l=${LINES:-25}; c=${COLUMNS:-80}; c=$[$c-22]; R="joe" #change ( while :; do m="`date +%a %d %b [%T]`" echo -ne "e7e[${l};${c}He[0me[1;32m $m e[0me8"; done) & pid=$!; $R; kill -9 "$pid"; echo -ne "e[0m" ####[ssiyer (at) cs.rice.edu]################################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Finding all executables in a dir LOST #369 #!/bin/sh ls -l | grep "-x" | grep -v "dr" | less ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Making audio and mixed mode CDs LOST #370 To burn a mixed mode CD (e.g. a VCD), try cdrdao. Steps are: a) cdrdao scanbus. [This outputs 3 numbers, N,N,N note them] B) cdrdao copy --keep-image --device N,N,N c) cdrdao write --device N,N,N <toc filename> ####[rajesh-shriram (at) gmx.net]############################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Restoring a mysql dump file LOST #371 Taken a mysql dump file, and wondering how to restore the dump ? Try: 'mysql -u root -p < yourdumpfile' ####[rarvind (at) users.sourceforge.net]###################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Executable in an rpm package LOST #372 Wondering how to run an application after rpm installation ? rpm -qa | grep <package> ..... will get you the package name rpm -ql <package-name> | less ... lists contents of package Executables are usually installed under /bin, /sbin, /usr/bin, /usr/sbin or /usr/local/bin. ####[vinu (at) cmcvellore.ac.in]############################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Novell services under GNU/Linux (ncpfs) LOST #373 The ncpfs package contains utilities to interface NetWare to Linux, such as to mount netware volumes, nprint (to print over a NetWare print queue),pserver (which provides a NetWare print queue) etc. See http://www.tldp.org/HOWTO/IPX-HOWTO-12.html. ####[kumarayil (at) eth.net]################################## : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Adding users (without home-dir/ password) LOST #374 To create an user account without a home dir or password, do: #groupadd -g <GID> <groupname> #useradd -u <UID> -g <GID> -d / -s /bin/sh <username> [Where GID/ UID are unique, not in /etc/passwd or /etc/group] ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Let your GNU/Linux loyalty show LOST #375 Are you running (or are a part of) a Linux User Group? If it be so, make it easy for others to link up with you. Register your LUG at: http://lugww.counter.li.org and http://www.linux.org/groups/bin/submit_group ####[fred (at) bytesforall.org]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Switching consoles LOST #376 You can switch consoles by pressing the Alt-Left cursor and Alt-Right cursor keys. Merry go-round on the Alt-Left/ Right cursor keypad. An alternative to pressing Alt-Function key to switch from one console to another. ####[ragu (at) vsnl.com]###################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Aliases for DOS commands [#1] LOST #377 alias md="mkdir -p" # make directory alias rd="rmdir -p" # remove directory alias del='rm -i' # delete file alias copy='cp -i' # copy alias ren='mv' # move / rename ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Aliases for DOS commands [#2] LOST #378 alias deltree="rm -rf" # delete directory alias dir='ls -alF --color=auto' # list directory contents alias win="startx" # start errr... windozz ;) alias cls="echo -en "33c" # clear the screen ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Aliases (safe practices) LOST #379 alias cp="cp -i" alias mv="mv -i" alias rm="rm -i" # Caution, the next one deletes all backup files in $PWD... alias clean='rm -fv *~ .???~ .*~ *.bak; sync' ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Aliases (safe practices) [#2] LOST #380 You can put CDs into your CD tray and take them out without fiddling with your hardware: alias cd-out='eject' alias cd-in='eject -t' # Note: not all CD devices support -t ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Aliases (tolerating common errors) LOST #381 alias cd..="cd .." # Forgive the user, a typos alias cd-p="cd -" # return last working directory alias unmount='echo "Error: Try the command: umount"' ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Auto-starting apps under X LOST #382 xload -g 50x50-100+0 -bw 0 & # You can start your Eterm -g 80x24+500+500 & # favourite apps through xv -root -max -quit lighthouse.jpg & # .xinitrc as shown here blackbox # before calling the WM ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Knoppix: A CD based distro LOST #383 Knoppix (http://www.knopper.net/knoppix/index-en.html) is a full featured linux distro which runs off a bootable CD and does not need to be installed on a hard disk because of its on-the-fly decompression.Possible applications include rescue rescue system, educational CDs, package/ linux demo etc. ####[ajitabhpandey (at) users.sourceforge.net]################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : tomsrtbt: A floppy based rescue system LOST #384 tomsrtbt [http://www.toms.net/rb/] is "The most GNU/ Linux on one floppy disk" for rescue recovery panic/ emergencies tools. It has as much stuff as possible on 1 floppy disk to keep it self contained, and behave like a mini-normal system. ####[mallet (at) efn.org]##################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Linux Networking Commands LOST #385 A handy reference guide to all Linux commands related with networking. Each command includes a precise description. Visit: [http://rak.isternet.sk/linux-netman/commands.html] ####[ajitabhpandey (at) users.sourceforge.net]################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Dwindling /var under debian LOST #386 If you use apt-get to download a lot of software, your /var will soon be fully utilised, unless you keep on clearing the downloads. Do apt-get clean on a periodic basis to clear the download cache. ####[dileep (at) symonds.net]################################# : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : A personal http daemon (monkey) LOST #387 There is a tiny feature-loaded web server ( inclusive of php & cgi-bin support), which can be installed and run from your own home directory. No need bothering the sysadmin for testing cgi scripts again :-) Visit: http://monkeyd.sourceforge.net ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Simple console calculator (#2) LOST #388 #!/usr/bin/perl # A command line calc- # Usage is : $ calc "(2 + 3) * 4" # ulator in perl. Save print eval(join('', (at) ARGV)) . "n"; # as "calc" & chmo ####[ajitabhpandey (at) users.sourceforge.net]################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Starting favourite apps when starting X LOST #389 To start your favourite apps the moment you start X, add it to your .xinitrc, before firing the window manager as shown: Eterm -x -O -g 80x24+500+50 --scrollbar off --menubar off & xv -root -max -quit /usr/share/Eterm/pix/lighthouse.jpg fvwm2 ####[banduji (at) symonds.net]################################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Sys-admining resource (debian-centric) LOST #390 http://www.aboutdebian.com has a lot of helpful documentation covering numerous sys-admining topics ranging from basics to admining networking, various servers and firewalls ... Please note that much of the information is generic. ####[ajitabhpandey (at) yahoo.com]############################ : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Displaying your tty, date & time at login LOST #391 To have a display of the tty you are about to log into, with optional display of date/time, add following to '/etc/issue' (after removing the quotation marks): "Welcome to your_computer_name on l [d t]" ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : How to find a bad parent process? LOST #392 Thread parent-child processes in a hierarchy, so that you can easily identify a bad/zombie parent to kill: 'ps -efH | less' ####[ragu (at) vsnl.com]###################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Executables-only ls LOST #393 To have an ls of only executable files within a directory, add this line to your /etc/profile or .bash_profile/: alias lsx='ls -F | grep * | less' Type "lsx" at the shell prompt ... and viola ... ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Preventing user logins (during maintenance) LOST #394 To prevent user logins during system maintenance, just create the file /etc/nologin with an appropriate message e.g. "Under maintenance, try after 21:30". Turn off ftpd and sshd. Do NOT forget to do 'rm -f /etc/nologin' after maintenance is over. ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : re-naming file extensions (ren) LOST #395 #!/bin/bash if ! [ $2 ]; then echo "Usage: ren [extn1] [extn2]"; exit; fi for FNAME in *$1; do echo -en "renaming:t $FNAME t -> t ${FNAME%$1}$2n" #mv $FNAME ${FNAME%$1}$2" # Remove leading comment done ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Lesser used commands (write) LOST #396 To send messages to folk logged in on your intranet, use write command.First find out who all are logged in with 'who'. Then: $write username Type your message and press Ctrl-D. Message will appear on the recepient user's terminal/ xterm. ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Single word spelling check using ispell LOST #397 #!/bin/sh if ! [ $1 ]; then echo "Usage: chk-spl [word]"; exit; fi echo $1 > /tmp/chk-spl.$$; ispell /tmp/chk-spl.$$ rm -f /tmp/chk-spl.$$; exit ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : How to make apt-getable deb packages ? LOST #398 Install the `apt-utils' package, `apt-ftparchive' helps create Package and other index files. man apt-ftparchive, man apt-sortpkgs, man apt-extracttemplates ####[ragu (at) vsnl.com]###################################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Editing a file while viewing with more LOST #399 To edit a file while viewing with more (viz. $more textfile), typing in "v" in between puts you in edit mode with vi at the current line. Viewing with more resumes after exiting vi. See "man more" ####[bish (at) nde.vsnl.net.in]############################### : % : ####[ GNU/Linux One Stanza Tip (LOST) ]####################### Sub : Chat clients under emacs LOST #400 Some chat clients integrate seamlessly with Emacs environment. erc (http://sourceforge.net/projects/erc/) and ZenIRC (http:// www.zenirc.org) are both suitable ... You need to do an 'M-x zenirc' or 'M-x erc-select' once inside emacs after you pop up the relevant elisp script in the load path (viz. zenirc.el or erc.el). ####[ragu (at) vsnl.com]###################################### : Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.