login
Header Space

 
 

mchirico's blog

Postfix 2nd Instance for Sender-based Routing: Multiple Gmail and Comcast Accounts

November 6, 2005 - 9:08am
Submitted by mchirico on November 6, 2005 - 9:08am.

Sender-based routing allows delivery actions on email to be made based on the sending address. This makes it possible for each Gmail and or Comcast account to have separate authentication rules. In summary, your home Postfix system can support Gmail and Comcast accounts for all of your family and friends. This tutorial walks you through an example using Gmail and Comcast, but the setup is similar for any ISP specific emails.

200+ Linux Tips

October 12, 2005 - 7:41pm
Submitted by mchirico on October 12, 2005 - 7:41pm.

Linux System Admin Tips There are over 200 Linux tips and tricks in this article. That is over 150 pages covering topics from setting and keeping the correct time on your computer, permanently deleting documents with shred, making files "immutable" so that root cannot change or delete, setting up more than one IP address on a single NIC, monitering users and processes, setting log rotate to monthly with 12 months of backups in compressed format, creating passwords for Apache using the htpasswd command, common Perl commands, using cfengine, adding users to groups, finding out which commands are aliased, query program text segment size and data segment size, trusted X11 forwarding, getting information on the hard drive including the current temperature, using Gnuplot, POVRAY and making animated GIFs, monitoring selective traffic with tcpdump and netstat, multiple examples using the find command, getting the most from Bash, plus a lot more.

Breaking Firewalls with OpenSSH and Putty

March 27, 2005 - 11:38am
Submitted by mchirico on March 27, 2005 - 11:38am.
Linux

If the system administrator deliberately filters out all traffic except port 22 (ssh), to a single server, it is very likely that you can still gain access other computers behind the firewall. This article shows how remote Linux and Windows users can gain access to firewalled samba, mail, and http servers. In essence, it shows how open

Create your own custom Live Linux CD

March 16, 2005 - 8:35am
Submitted by mchirico on March 16, 2005 - 8:35am.
Linux

These steps will show you how to create a functioning Linux system, with the latest 2.6 kernel compiled from source, and how to integrate the BusyBox, utilities including the installation of DHCP. These steps include compiling in the OpenSSH package.

The CD will be completely loaded into RAM -- which means it loads as a rw filesystem. In fact, the CD can be removed for boot-up on a second computer. You can take over any PC using this method.

100+ Linux Tips

December 1, 2004 - 6:01am
Submitted by mchirico on December 1, 2004 - 6:01am.
Linux


100+ Linux Tips

There are over 100 Linux tips and tricks from using encryption, tar, cpio, setting up multiple IP addresses on one NIC, tips for using man, putting jobs into the background, using shred, watch who is doing what on your system, listing system settings, IPC status, how to make a file immutable so that even root cannot delete, ssh key pair generation, keeping 12 months of backups in the system logs, low level tap commands (mt), mount an ISO image as a filesystem, getting information on the hard drive, setting up cron jobs, look command, getting a bigger word dictionary, find out if a command is aliased, ASCII codes, using elinks, screen commands, FTP auto-login, Bash brace expansion, Bash string operators, for loops in Bash, diff and patch, script, change library path (ldconfig), monitor file usage, --parents option in commands, advance usage of the find command, cat tricks, guard against SYN flood attacks and ping, special shell variables, RPM usage, finding IP and MAC address, DOS to UNIX conversion, PHP as command line scripting language, Gnuplot, POVRAY and making anamated GIFs, plus a lot more.

SQLite Tutorial

November 22, 2004 - 9:24pm
Submitted by mchirico on November 22, 2004 - 9:24pm.

SQLite Tutorial:

This article explores the power and simplicity of sqlite3, first by starting with common commands and triggers, then the attach statement with the union operation is introduced in a way that allows multiple tables, in separate databases, to be combined as one virtual table, without the overhead of copying or moving data. Next, the simple sign function and the amazingly powerful trick of using this function in SQL select statements to solve complex queries with a single pass through the data is demonstrated, after making a brief mathematical case for how the sign function defines the absolute value and IF conditions.

100 Linux tips and counting

November 21, 2004 - 10:09am
Submitted by mchirico on November 21, 2004 - 10:09am.

There are over 100 Linux tips and tricks from using encryption, tar, cpio, setting up multiple IP addresses on one NIC, tips for using man, putting jobs into the background, using shred, watch who is doing what on your system, listing system settings, IPC status, how to make a file immutable so that even root cannot delete, ssh key pair generation, keeping 12 months of backups in the system logs, low level tap commands (mt), mount an ISO image as a filesystem, getting information on the hard drive, setting up cron jobs, look command, getting a bigger word dictionary, find out if a command is aliased, ASCII codes, using elinks, screen commands, FTP auto-login, Bash brace expansion, Bash string operators, for loops in Bash, diff and patch, script, change library path (ldconfig), monitor file usage, --parents option in commands, advance usage of the find command, cat tricks, guard against SYN flood attacks and ping, special shell variables, RPM usage, finding IP and MAC address, DOS to UNIX conversion, PHP as command line scripting language, Gnuplot, POVRAY and making anamated GIFs, plus a lot more.

Link to full article (TIP1 to TIP5):
http://prdownloads.sourceforge.net/...ce.txt?download

TIP 5:

Setting up 2 IP address on "One" NIC. This example is on ethernet.

STEP 1 (The settings for the initial IP address)

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.99.255

IPADDR=192.168.1.155
NETMASK=255.255.252.0
NETWORK=192.168.1.0
onBOOT=yes

STEP 2 (2nd IP address: )

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1

DEVICE=eth0:1
BOOTPROTO=static
BROADCAST=192.168.99.255
IPADDR=192.168.1.182

NETMASK=255.255.252.0
NETWORK=192.168.1.0
onBOOT=yes

SUMMARY Note, in STEP 1 the filename is "ifcfg-eth0", whereas in
STEP 2 it's "ifcfg-eth0:1" and also not the matching

entries for "DEVICE=...". Also, obviously, the
"IPADDR" is different as well.

TIP 6:

Sharing Directories Amoung Several Users.

Several people are working on a project in "/home/share"
and they need to create documents and programs so that
others in the group can edit and execute these documents
as needed.

$ /usr/sbin/groupadd share
$ chown -R root.share /home/share

$ /usr/bin/gpasswd -a <username> share
$ chmod 775 /home/share
$ chmod 2775 /home/share

$ ls -ld /home/share
drwxrwsr-x 2 root share 4096 Nov 8 16:19 /home/share

^---------- Note the s bit, which was set with the chmod 2775

$ cat /etc/group
...
share:x:502:chirico,donkey,zoe
... ^------- users are added to this group.

The user will need to issue a reset before they can get access. As root you
can test their account.

$ su - <username> "You need to '-' to pickup thier environment '$ su - chirico' "

TIP 7:

Getting Infomation on Commands

The "info" is a great utility for getting information about the system.
Here's a quick key on using "info" from the terminal prompt.

'q' exits.
'u' moves up to the table of contents of the current section.

'n' moves to the next chapter.
'p' moves to the previous chapter.
'space' goes into the selected section.

The following is a good starting point:

$ info coreutils

Need to find out what a certain program does?

$ whatis open
open (2) - open and possibly create a file or device
open (3) - perl pragma to set default PerlIO layers for input and output
open (3pm) - perl pragma to set default PerlIO layers for input and output

open (n) - Open a file-based or command pipeline channel

To get specific information about the open commmand

$ man 2 open

also try

$ man -k <some string>

TIP 8:

How to Put a "Running Job" in the Background.

You're running a job at the terminal prompt, and it's taking

a very long time. You want to put the job in the backgroud.

"CTL - z" Temporarily suspends the job
$ jobs This will list all the jobs
$ bg %jobnumber (bg %1) To run in the background
$ fg %jobnumber To bring back in the foreground

Need to kill all jobs -- say you're using several suspended
emacs sessions and you just want everything to exit.

$ kill -9 `jobs -p`

The "jobs -p" gives the process number of each job, and the
kill -9 kills everything. Yes, sometimes "kill -9" is excessive

and you should issue a "kill -15" that allows jobs to clean-up.
However, for exacs session, I prefer "kill -9" and haven't had
a problem.

Sometimes you need to list the process id along with job
information. For instance, here's process id with the listing.

$ jobs -pl

Note you can also renice a job, or give it lower priority.

$ nice -n +15 find . -ctime 2 -type f -exec ls {} \; > last48hours
^z

$ bg

So above that was a ctl-z to suppend. Then, bg to run it in
the background. Now, if you want to change the priority lower
you just renice it, once you know the process id.

$ jobs -pl

[1]+ 29388 Running nice -n +15 find . -ctime 2 -exec ls -l {} \; >mout &

$ renice +30 -p 29388
29388: old priority 15, new priority 19

19 was the lowest priority for this job. You cannot increase
the priority unless you are root.

TIP 9:

Need to Delete a File for Good -- not even GOD can recover.

You have a file "secret". The following makes it so no one
can read it. If the file was 12 bytes, it's now 4096 after it

has been over written 100 times. There's no way to recover this.

$ shred -n 100 -z secret

Want to remove the file? Use the "u" option.

$ shred -n 100 -z -u test2

It can be applied to a device

$ shred -n 100 -z -u /dev/fd0

Also see (TIP 52).

For TIP 10 to 100 reference the following:
http://prdownloads.sourceforge.net/...ce.txt?download

Virtual Filesystem: Building A Linux Filesystem From An Ordinary File

September 14, 2004 - 3:39pm
Submitted by mchirico on September 14, 2004 - 3:39pm.
Linux

Virtual Filesystem: Building A Linux Filesystem From An Ordinary File

Mike Chirico (mchirico@users.sourceforge.net or mchirico@comcast.net)

Copyright (c) 2004 (GPU Free Documentation License)

Latest Update:
http://prdownloads.sourceforge.net/souptonuts/README_Virtual_FS.html?download


Date: Thu Sep 9 11:40:26 EDT 2004

Looking for Something to Read?

September 12, 2004 - 4:09pm
Submitted by mchirico on September 12, 2004 - 4:09pm.


HIGHLY RECOMMENDED BOOKS:

"UNIX Network Programming, The Sockets Networking API", Volume 1, Third Edition.

     W. Richard Stevens, Bill Fenner, Andrew M. Rudoff.

"UNIX Network Programming, Interprocess Communications", Volume 2, Second Edition.

     W. Richard Stevens.

lemon parser

August 6, 2004 - 8:59pm
Submitted by mchirico on August 6, 2004 - 8:59pm.

lemon parser

The lemon parser is very powerful: thread safe, and includes a non-terminal destructor. The complete source code can be found in 2 files *here*

Unfortunately, there isn't a quick example. So, I'm working on creating a few samples *here*

kernel 2.6.6+ current->tty has been replaced with current->signal->tty

June 29, 2004 - 6:47pm
Submitted by mchirico on June 29, 2004 - 6:47pm.

I think there is an advantage to tty output, when developing kernel modules. There is that immediate feedback, and one doesn't have to access the logs. Especially, for investigating certain new features of the kernel...nothing you'd want to publish; but, just poking around.

Anyway, in 2.6.6+ versions "current->tty" was replaced with "current->signal->tty". For an example of a very simple module that runs on Fedora core 2, or the latest kernel download the following:

Getting Comcast Email on Home Linux Box

June 28, 2004 - 1:03pm
Submitted by mchirico on June 28, 2004 - 1:03pm.

Getting Comcast Email on Home Linux Box
Mike Chirico
Copyright (c) 2004 (GPU Free Documentation License)
Last Updated: Mon Jun 28 11:38:40 EDT 2004

Link To Latest Version:
http://prdownloads.sourceforge.net/souptonuts/README_COMCAST_EMAIL.txt?d...

The following instructions explain how to send and receive Comcast
email from a home Linux box, which is connected to the Internet via

MySQL Tip

June 11, 2004 - 12:25pm
Submitted by mchirico on June 11, 2004 - 12:25pm.
For more tips and a better formatted version
Reference the following:
http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download


TIP 23:

   Computing running and sliding aggregates. Assume the following table 
   and data:

          CREATE TABLE dice (                                           
            d_id int(11) NOT NULL auto_increment,

cpio works like tar, only better

June 10, 2004 - 11:28am
Submitted by mchirico on June 10, 2004 - 11:28am.
Create two directories with data ../dir1 an ../dir2

   mkdir -p ../dir1
   mkdir -p ../dir2
   cp /etc/*.conf ../dir1/.
   cp /etc/*.cnf ../dir2/.

Which will backup all your cnf and conf files.

cpio is just another way to create a tar
file, with the "find" command.

find ../dir1/ | cpio -o --format=tar > test.tar
          or
find ../dir1/ | cpio -o -H tar > test2.tar

Same command without the ">"

Using the Fedora project for updates (via Yum) on a 2.6.x kernel

May 11, 2004 - 8:12pm
Submitted by mchirico on May 11, 2004 - 8:12pm.

(See STEP 18 for Yum configuration)

How to Compile 2.6 kernel for RedHat 9/8
Mike Chirico
Last Updated: Tue May 11 18:59:04 EDT 2004

The latest version of this document can be found at:
http://prdownloads.sourceforge.net/souptonuts/README_26.txt?download

For configs ref:
http://sourceforge.net/project/showfiles.php?group_id=79320&package_id=1...

STEP 1:

Download the latest version of the kernel and any patches.

speck-geostationary