★ wanayoo — archive 1999 http://portico.org/Nouvelle recherche | Portail wanayoo

portico.org
the source for linux tips
...

 

Tips

vi Matthias Kopfermann at 29 February, 00:47:57
One thing which i like a lot about vim is: you can just toggle all options. (see inv<TAB>)
nmap ,n :set invnumber ^^
Would bind only the command ,n in normal mode to do the following: If you hit ,n you then will see numbers before your texts. hit it again and the numbering is just gone and so on. the is nice, because you can use Carriage Return without even using control-characters. nmap instead of map is great, because it lets you bind mappings to ":"-commands and extra ones for normal-mode and even extra ones for visual-mode and for operators like c , y and d. vi users have a bad time with vim, because if they don't try to learn the extras, they never get the luxury of vim but have a big editor. But why then use a big vim-editor instead a smaller one like nvi?
 
security MaGiK at 29 February, 00:51:16
Puts time stamp on files and sets it so users cannot create or edit these files:
/bin/touch / .rhosts / .netrc /etc/host.equiv /bin/chmod 0 / .rhosts / .netrc /etc/hosts.equiv
 
programming frodo at 17 February, 16:25:40
A very common addition to a webpage is "Last Modified" -- PHP makes this very easy with the following code as an example:
<?php
   echo "Last modified: " . date( "F d Y.", getlastmod() );
?>
It checks the modification date of the given file and posts it. Check php.net for date variations.
 
apache frodo at 16 February, 18:44:05
To redirect to another url yet keep the same file structure, you can use PHP and create the following file. For example: foo.com/bar/ to redirect to shoe.com/bar/.
<?php
   $redir = getenv( "REDIRECT_URL");
   header( "Location: http://shoe.com$redir");
?>
Works great for domain moves and 404's.
 
job control Syed Khaleelulla at 15 February, 05:22:34
If you want to know the different signals that are supported, just run kill -l command
 
irc HellHound at 13 February, 21:23:07
For those who use BitchX alot, and never looked deeper into the manual/doc files, here's a short example on how to use the multiple window handling in bX:
/win new hide   - This will add a new window (hidden)
Now you can switch to this newly created window, by doing
ALT-[0-9], now you have a clean window for a new
channel, query, etc. When an action happens in another window, 
BitchX puts an ACT: <windownumber> in the status bar 
(at the right).
 
X schvin at 12 February, 23:27:30
If you don't like the facility that your window manager has for setting your desktop background, consider using xv for this task. Running xv -max -root -quit image.jpg will set image.jpg to your desktop in maximum resolution. This can be especially handy when setting your background from a cron job.
 
emacs Adam at 12 February, 10:24:31
If you want to set up emacs to scroll through all the buffers add the following line to your .emacs file:
;rotate buffers
(defun rotate-buffers (arg)
  "Rotates to the next buffer"
  (interactive "p")
  (switch-to-other-buffer 0))
 
file manipulation Ale at 3 February, 12:45:11
less +F file is a great alternative to tail -f, especially when you'll need to browse through the file as well as tail it . . . you can also do this from within less, by typing F.
 
X Ryan Erwin at 3 February, 01:38:37
Ever looked at the ~/.Xdefaults file and wondered how to add your own defaults?

If you you are using Window Maker just right click on a window titlebar and choose attributes. The attributes window will say something like Inspecting rxvt.XTerm. If you don't have Window Maker, you can run xprop and get the info from WM_CLASS(STRING) = "rxvt", "XTerm"

Now, open ~/.Xdefaults in your favorite editor. If you want to change a property for all windows of a class (like all XTerm's), just type:

XTerm*title: My Xterm Title To change the title for only the rxvt's, type: rxvt.XTerm*title: My RXVT Specific Title
Don't Forget to run xrdb -load ~/.Xdefaults every time you change your Xdefaults or they will not be activated! Any line begining with a "!" is considered a comment, not a command. Read man rxvt or man xterm to find what other cool things you can set . . .
 
job control Ale at 1 February, 13:47:39
pstree is a good alternative to ps, listing all the processes in a nice tree form. You can also try pstree -hap for command line, pid and to highlight the current process.
 
freebsd schvin at 20 January, 06:11:48
In FreeBSD the utility systat -vm is a great way to monitor your system, covering most things, especially memory information. In combination with top and/or xosview you will have a great little monitoring setup.
 
rpm Robert at 19 January, 00:59:30
Whenever you download a new rpm, or are feeling paranoid about any you get on a disk/cdrom, check the MD5 sum. If the sum is not OK, then the rpm is corrupted and won't install (at best) or can mess up your system (at worst). Use the following command (wildcards are OK):
rpm -K --nogpg rpmfile-to-check.rpm
where rpmfile-to-check.rpm is whatever rpm you are checking out. Note that the --nopgp directive does not check the signature of the package, if any.
 
samba Robert at 19 January, 01:00:18
If you are using RedHat (possibly many other distributions as well), to start, stop or restart Samba, issue the following command (as root):
/etc/rc.d/init.d/smb start
For other functions, just substitute stop or restart for start.
 
samba Robert at 19 January, 01:02:09
Always use the testparm command to test your new smb.conf file. This will alert you to some possible errors. You must give testparm the path to the smb.conf file. For example:
testparm /etc/smb.conf
 
results 1 through 15 next 15

 

About   |   Add tip   |   Articles   |   Categories   |   Links   |   Random   |   Tips


Friday, 31st of December, 1999, 19:44:00 UTC
Copyright 1998-2000 Scott Parish and George Lewis.
Send feedback to webmaster@portico.org.