by Ron on October 24, 2008
This tip is for my friend Scarb. For years I’ve used the Linux command “tail -f” for watching logs… but only recently did I discover its versatility for extracting parts of files.
Need to grab only the last 25 lines of a file?
tail -n 25 somefile.txt
How about the last 200000 bytes redirected to another file?
tail -c [...]
by Ron on October 20, 2008
nano /etc/rc.local
and add
/etc/init.d/zabbix-agent start
by Ron on September 15, 2008
Dropbox is a service that allows you to keep files synchronized across multiple machines (and multiple platforms).
Click through and checkout the video. It’s pretty slick!
Here is some additional info from ars technica.
by Ron on August 29, 2008
I contributed to a Handbrake forum a while back. Thought you might find it useful too.
This is my evolving script for transcoding DVDs from MacTheRipper.
1) Save the file in a logical place (I keep it in the Movies Folder… same place I rip movies to). It will loop through all titles longer than X.
#!/bin/sh
# usage [...]
by Ron on August 13, 2008
To find what flavor of Linux you’re using:
cat /etc/*-release
To find the version, use:
uname -a
This doesn’t work perfectly, but I often use it to start tracking down disk hogs:
To return the 10 largest items in a given directory:
du -cksh * |sort -rn |head -11
Some times it’s helpful to view all
du -cksh * |sort -rn
If someone has a better approach, please comment.
Looking for a log to show you failed login attempts to your Linux machine? Look in:
/var/log/btmp
You can access it by running:
/usr/bin/lastb
It’s similiar to the wtmp log of user login/logouts and the utmp log showing who is currently logged in.
I install RHEL on all my production machines and CentOS on all my test/development boxes. Installing the GUI is helpful for configuration, but you sure don’t want to run them that way all the time. So after everything is installed, configured and tested, I make the following change:
nano /etc/inittab
Change
id:5:initdefault:
To
id:3:initdefault:
Save the file and reboot the machine. [...]
nano /etc/sysconfig/network-scripts/ifcfg-eth0
Should look something like this
DEVICE=eth0
BOOTPROTO=static
BROADCAST=172.16.0.255
HWADDR=00:00:00:00:00:00
IPADDR=172.16.0.2
NETMASK=255.255.255.0
NETWORK=172.16.0.0
ONBOOT=yes
Duplicate that and open the new file
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
nano /etc/sysconfig/network-scripts/ifcfg-eth0:0
Change device name, set new IP, remove reference to hardware
DEVICE=eth0:0
BOOTPROTO=static
BROADCAST=172.16.0.255
IPADDR=172.16.0.3
NETMASK=255.255.255.0
NETWORK=172.16.0.0
ONBOOT=yes
I use wget all the time on my Linux machines, but was surprised to find it missing on my MacBook Pro. Since Mac OS is based on BSD, it uses cURL instead. Here’s a good way to scrape files from a remote server.
curl -O http://www.gutenberg.org/files/21171/mp3/21171-[01-24].mp3
Man page is available at: http://curl.haxx.se/docs/manpage.html