Resume

FAQ

Vision

Links

Home

: faq :


How do I find files modified 15 minutes ago on linux?

-> find / -type f -mmin 15

How do I clear my bash history?

-> history -c
-> rm ~/.bash_history

How do I view recent logins to my linux system?

-> utmpdump /var/log/wtmp

How do I mount a NTFS? How do I read / write to a NTFS filesystem?

Make sure you have the fuse packages installed, e.g.: fuse-2.7.0-2.el5.rf, dkms-fuse-2.7.0-1.nodist.rf, fuse-ntfs-3g-1.1120-1.el5.rf, if on RHEL5
Then mount the filesystem by specifying the target as: ntfs-3g , e.g.: mount -t ntfs-3g /dev/sdb2 /mnt

How do I ping an entire network subnet in Linux?

-> ping -b 192.168.1.0

How do I add apache to default run level non-chroot'd in openbsd?

Edit /etc/rc.conf.local and add a line:
httpd_flags="-u" # start apache non-chroot

How do I restart apache in openbsd?

-> apachectl restart

How do I write a local file to a remote system's tape device over ssh?

-> tar -cv --rsh-command=/usr/bin/ssh --rmt-command=/sbin/rmt -f user@remotesys:/dev/st0 ./localfile

How do I create and write a tar file to a remote computer on the fly using ssh?

-> tar cvfz - /localdir | ssh user@remotesys "cat > /remotedir/newtarball.tar.gz"
The 'z' option is optionally used for compression

How do I setup my network card assigning an ip, netmask and gateway utilizing command-line tools?

At the command prompt:

-> ifconfig eth0 192.168.1.30 netmask 255.255.255.0 up

Then we must setup the gateway ...

-> route add default gw 192.168.1.1 eth0

How do I recursively report the number of files in a directory tree?

At the command prompt:

-> find DIR -type f | wc -l
We tell find to look in directory specified for objects of type file all at the same time piping stdout to wc to count the number of lines, or files found!

How do I configure X with SaX2 while having two video cards, possibly one is an onboard?

At the command prompt:

-> sax2 -p -- to find the chip id's of your video cards
-> sax2 -c 1 -m 1=nvidia -- we tell sax2 to not bother configuring the first card in the system ( chip 0 ), rather use chip 1 ( specified with -c option), also go ahead and specify the driver to use (-m and 1 for the chip id)

How do I remove a file with special characters in linux?
Utilizing ls, find, and rm we can take care of this by specifying the file we want to delete with it's inode #

At the command prompt:

-> ls -li -- to find the inodes of files in current directory
-> find . -inum xxxx -exec rm -f {} \; -- where xxxx is the inode # of the file you want to delete.

How do I move all directories non-recursively in an absolute directory at the same time excluding directories meeting an expression?
Utilizing find, xargs and grep we can accomplish this task easily ...

At the command prompt:

-> find $SRCDIR/* -maxdepth 0 -type d -print | grep -v "Expression" | xargs -i mv {} $DSTDIR
Where $SRCDIR is a variable for source directory and $DSTDIR is the destination

How do I create a cab archive file?
The process is easy once you get a hold of the right tool. Get a hold of cabarc.exe which is included in the IEAK6 package here

At the command prompt:

-> cabarc N yourcab.cab files

Your set now!

How do I send email using a telnet session?
Here is how:

-> telnet smtp.domain.tld 25 --- 220 server message
-> helo local.domain.name --- 250 OK
-> mail from: sender@domain.tld --- 250 OK
-> rcpt to: recipient@domain.tld --- 250 OK
-> data --- please start mail input
-> . --- finishes off your email

After the server receives the '.' character it will queue the message for delivery. Thats it!

How do I host more than one domain on one IP with apache?
Well you gots to bust some shiz like this in yo vhosts.conf file:

NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domainone.tld
ServerAlias domainone.tld *.domainone.tld
DocumentRoot /www/domainone
</VirtualHost>
<VirtualHost *:80>
ServerName www.domaintwo.tld
DocumentRoot /www/domaintwo
</VirtualHost>

Or something of that nature.

How do I make my subfolders in htdocs visible with apache 2?
Shi dog, just bust a .htaccess file in that folder that has this: Options +Indexes ;)

My glftpd install is hozed, gettin messages like "421 service not available"
Try checkin those glftpd logs. Make sure your TLS server key has been created and that inetd or xinetd is pointing to it correctly. Also make sure you don't have some stuff like this in ure xinetd.conf file: only_from = localhost . Also check and make sure you don't have syntax errors in your glftpd.conf file.

Im runnin NAT and I can't get passive to work with glftpd :'(
Try something like this:
ifip 192.168.*.* 127.0.0.1
elseip
pasv_addr your_ext_ip 1
pasv_ports 9000-9500
endifip

How do I setup a speed limit on my glftpd site?
Try something like this: speed_limit path dlspeed ulspeed .. i.e. to limit download speed to 30KB/sec: speed_limit /* 30000 0 , where /* is the entire site directory.

Why am I getting this message while trying to run gl_spy: cannot open config file: No such file or directory?
For some reason gl_spy can't find the main glftpd.conf file, just run gl_spy like this instead: /jail/glftpd/bin/gl_spy -r /jail/glftpd.conf

Why do I get this message when I run dbinformer.php while testing my mysql setup for phpBB:
ERROR: You do not have the needed functions available for MySQL 4.x.
You didn't build mysql functionality into php when you built it :'(


... will add more .. later ...