CartMetrix - Do you know yours?

9/15/2005

Use SSH Tunnel to Circumvent ISP Blocking Port 25

Run the following in a terminal window:

ssh -fNg -L 2525:host.remotehost.com:25 user@remotehost.com

Configure mail client with the following changes:
SMTP server: localhost
SMPT port: 2525

Everything else should remain the same.

Popularity: 15%

9/14/2005

iTerm Tricks

Marc Liyanage posted a script to open a new Terminal window in a specified directory or run a specified command.

What it does is open up a new Terminal window and execute the arguments as command in that new window. When no arguments are given, it opens the new window in the current directory, which means it acts like a “clone” operation for the frontmost window. This is useful if you’re in some deeply nested directory and you need a second window right there. This way you don’t have to copy/paste or type the directory path.

I modified the script slightly to interface with iTerm, opening a new default session instead of a new window.

Download the file, place somewhere in your path, and make sure its executable.

Examples:
Open a second iTerm session in the current directory.

term

Open a second iTerm session in my home directory.

term ~

Open a second iTerm session and start editing my .bashrc file.

term vi ~/.bashrc

Open a second iTerm session in the current directory and start editing filename.

term vi filename

Open a second iTerm session in the current directory (presumably /var/log/httpd) and start following the error_log file using tail.

term tail -f error_log

Popularity: 60%

9/13/2005

Manually Run Urchin Reports

  1. Log into the Urchin admin panel.
  2. Change the Log File Path to '-' for the selected profile. Copy down the current log file path to replace when finished.
  3. Clear out any recent logs with the command (the path to Urchin may vary on your system):

    /usr/local/urchin/util/udb-sanitizer -p profilename -d YYYYMM

    Follow the directions given by udb-sanitizer. One or more days may be cleared, a whole month may be cleared or the data can be rolled back using any available backups.

  4. Run the Urchin report with:

    /usr/local/urchin/bin/urchin -p profilename < /full/path/to/log/file
  5. Start with the oldest logs first and work back to the current log file. On most systems the log files are named access_log access_log.1 access_log.2.gz access_log.3.gz in increasing age order. Gzip'd files need unzipped beforehand
  6. Change the Log File Path back to the original path as copied down in Step #2.

Popularity: 11%

Textmate Lorem ipsum dolor Filler Text

To generate a paragraph of Lorem ipsum dolor filler text in Textmate just type lorem and hit Tab.

lorem <tab>

Will produce:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Popularity: 8%

9/12/2005

Debugging POP/IMAP/SMTP With Telnet

POP3

$ telnet host.domain.com 110
Trying x.x.x.x ...
Connected to host.domain.com (x.x.x.x).
Escape character is '^]'.
+OK POP3 host.domain.com v2003.83rh server ready
USER USERNAME
+OK User name accepted, password please
PASS PASSWORD
+OK Mailbox open, 48 messages
LIST
+OK Mailbox scan listing follows
1 3894
2 11761
3 5499
4 13448
5 10451
RETR 5
...
QUIT

 

IMAP

$ telnet x.x.x.x 143
Trying x.x.x.x...
Connected to host.domain.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS AUTH=LOGIN] host.domain.com IMAP4rev1 2003.338rh at Mon, 12 Sep 2005 14:12:44 -0500 (CDT)
a LOGIN USERNAME PASSWORD
a OK [CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS BINARY UNSELECT SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND] User USERNAME authenticated
a EXAMINE INBOX
* 46 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1093716296] UID validity status
* OK [UIDNEXT 610] Predicted next UID
* FLAGS (NonJunk Junk $MDNSent NotJunk $NotJunk JunkRecorded $Junk $Label4 $Label1 $Label2 $Label3 $Label5 \Answered \Flagged \Deleted \Draft \Seen)
* OK [PERMANENTFLAGS ()] Permanent flags
* OK [UNSEEN 27] first unseen message in /var/spool/mail/xxxxxxx
a OK [READ-ONLY] EXAMINE completed
a FETCH 1 BODY[TEXT]
...
a LOGOUT
* BYE host.domain.com IMAP4rev1 server terminating connection
a OK LOGOUT completed
Connection closed by foreign host.

 

SMTP

$ telnet x.x.x.x 25
Trying x.x.x.x...
Connected to host.domain.com.
Escape character is '^]'.
220 host.domain.com ESMTP Sendmail 8.9.3+Sun/8.9.3; Mon, 12 Sept 2005 12:18:01-0500 (CDT)
HELO me@localhost
250 host.domain.com Hello me [x.x.x.x], pleased to meet you
MAIL FROM:< me@domain >
250 < me@domain >... Sender ok
RCPT TO:< you@domain >
250 < you@domain >... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Hi You!
.

250 QAA00316 Message accepted for delivery
QUIT
221 host.domain.com closing connection
Connection closed by foreign host.

Popularity: 16%

How To Clear Stuck Urchin Tasks

  1. Check the status of the task

    Open the Urchin Configuration GUI and select the following window: Configuration -> Scheduler -> Task History. From this view you will see a Status column. Each item in the “Status” column is a clickable link. The link will open a window that displays the process status when Urchin attempted to process the log file for that profile. Stuck tasks will normally appear as running with a date in the past.

  2. SSH to server.
  3. Stop Urchin daemons with one of the following:
    /etc/init.d/urchin stop
    /usr/local/urchin/bin/urchinctl stop
  4. Change directory to the urchin utils directory:
    cd /usr/local/urchin/utils
  5. Run the following commands, replacing profilename with the selected profile name:
    uconf-driver action=set_parameter table=task name=“profilename” cr_runnow=0
    uconf-driver action=set_parameter table=task name=“profilename” ct_runstatus=2
    uconf-driver action=set_parameter table=task name=“profilename” ct_completed=0
    uconf-driver action=set_parameter table=task name=“profilename” ct_status=1
    uconf-driver action=set_parameter table=task name=“profilename” ct_lockid=0
  6. Restart the Urchin daemons with one of the following:
    /etc/init.d/urchin start
    /usr/local/urchin/bin/urchinctl start

Popularity: 10%

« Previous Page Next Page »


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2009 damonparker.org. all rights reserved.

Close
E-mail It