MAC – monitor traffic on specific port

August 12, 2010

sudo tcpdump -n tcp -i en0 port 443

Enable Screen Sharing or ARD Via SSH

June 18, 2010

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all

http://www.farawaymac.com/mac-server/enable-screen-sharing-or-ard-via-ssh/

cron tips

June 16, 2010

The prolem is the  ”%” is special to cron  and and must be escaped.

change your cron entry to:

16 17 * * * /usr/bin/ksh -c “. /usr/home/user/.profile ; /disk1/servers/rel/scripts/HouseKeep  > /disk1/servers/rel/log/Backup/housekeep.log.`date +\%Y\%m\%d.\%H:\%M:\%S`”

should work.

slapd version check command

March 16, 2010

/usr/libexec/slapd -V

Not use Server Admin GUI for mail server black-list

February 14, 2010

In the /etc/postfix/main.cf

Change:
smtpd_client_restrictions = permit_mynetworks zen.spamhaus.org reject_rbl_client zen.spamhaus.org permit
to:
smtpd_client_restrictions = permit_mynetworks reject_rbl_client zen.spamhaus.org permit

and issue:
sudo postfix reload

http://discussions.info.apple.com/thread.jspa?threadID=2050199&tstart=60

tar gzip example

January 27, 2010
tar czvf mydirectory.tgz mydirectory
  1. c – create a new archive.
  2. z – gzip’d the archive.
  3. v – work verbosely, showing me the name of each file you add. This is optional.
  4. f – specifies that you want to use the following filename (mydirectory.tgz) as the name of the archive.

http://www.devdaily.com/blog/post/linux-unix/how-work-files-tar-gzip-tgz

Exclude Certain Files When Creating A Tarball Using Tar Command

January 27, 2010

Sample:

tar -zcvf /tmp/mybackup.tar.gz –exclude=’abc’ –exclude=’xyz’ /home/me

http://www.cyberciti.biz/faq/exclude-certain-files-when-creating-a-tarball-using-tar-command/

Disable The Mail Alert By Crontab Command

December 15, 2009

Cron Job Example

Edit/Open your cron jobs, enter:
$ crontab -e
Append string >/dev/null 2>&1 to stop mail alert:
0 1 5 10 * /path/to/script.sh >/dev/null 2>&1
OR
0 1 5 10 * /path/to/script.sh &> /dev/null

From: http://www.cyberciti.biz/faq/disable-the-mail-alert-by-crontab-command/

AppleScript Error Code

December 14, 2009

Here is a listing of errors from the System 7 era (released 5/13/91 when I was skinny and had a full head of hair).

Error number Error message

0 No error.
-34 Disk <name> is full.
-35 Disk <name> wasn’t found.
-37 Bad name for file.
-38 File <name> wasn’t open.
-39 End of file error.
-42 Too many files open.
-43 File <name> wasn’t found.
-44 Disk <name> is write protected.
-45 File <name> is locked.
-46 Disk <name> is locked.
-47 File <name> is busy.
-48 Duplicate file name.
-49 File <name> is already open.
-50 Parameter error.
-51 File reference number error.
-61 File not open with write permission.
-108 Out of memory.
-120 Folder <name> wasn’t found.
-124 Disk <name> is disconnected.
-128 User canceled.
-192 A resource wasn’t found.
-600 Application isn’t running.
-601 Not enough room to launch application with special requirements.
-602 Application is not 32-bit clean.
-605 More memory is needed than is specified in the size resource.
-606 Application is background-only.
-607 Buffer is too small.
-608 No outstanding high-level event.
-609 Connection is invalid.
-904 Not enough system memory to connect to remote application.
-905 Remote access is not allowed.
-906 <name> isn’t running or program linking isn’t enabled.
-915 Can’t find remote machine.
-30720 Invalid date and time <date string>.
*******************
-1700 Can’t make some data into the expected type.
-1701 Some parameter is missing for <commandName>.
-1702 Some data could not be read.
-1703 Some data was the wrong type.
-1704 Some parameter was invalid.
-1705 Operation involving a list item failed.
-1706 Need a newer version of the Apple Event Manager.
-1707 Event isn’t an Apple event.
-1708 <reference> doesn’t understand the <commandName> message.
-1709 AEResetTimer was passed an invalid reply.
-1710 Invalid sending mode was passed.
-1711 User canceled out of wait loop for reply or receipt.
-1712 Apple event timed out.
-1713 No user interaction allowed.
-1714 Wrong keyword for a special function.
-1715 Some parameter wasn’t understood.
-1716 Unknown Apple event address type.
-1717 The handler <identifier> is not defined.
-1718 Reply has not yet arrived.
-1719 Can’t get <reference>. Invalid index.
-1720 Invalid range.
-1721 <expression> doesn’t match the parameters <parameterNames> for <commandName>.
-1723 Can’t get <expression>. Access not allowed.
-1725 Illegal logical operator called.
-1726 Illegal comparison or logical.
-1727 Expected a reference.
-1728 Can’t get <reference>.
-1729 Object counting procedure returned a negative count.
-1730 Container specified was an empty list.
-1731 Unknown object type.
-1750 Scripting component error.
-1751 Invalid script id.
-1752 Script doesn’t seem to belong to AppleScript.
-1753 Script error.
-1754 Invalid selector given.
-1755 Invalid access.
-1756 Source not available.
-1757 No such dialect.
-1758 Data couldn’t be read because its format is obsolete.
-1759 Data couldn’t be read because its format is too new.
-1760 Recording is already on.
*******************
-2700 Unknown error.
-2701 Can’t divide <number> by zero.
-2702 The result of a numeric operation was too large.
-2703 <reference> can’t be launched because it is not an application.
-2704 <reference> isn’t scriptable.
-2705 The application has a corrupted dictionary.
-2706 Stack overflow.
-2707 Internal table overflow.
-2708 Attempt to create a value larger than the allowable size.
-2709 Can’t get the event dictionary.
-2720 Can’t both consider and ignore <attribute>.
-2721 Can’t perform operation on text longer than 32K bytes.
-2729 Message size too large for the 7.0 Finder.
-2740 A <language element> can’t go after this <language element>.
-2741 Expected <language element> but found <language element>.
-2750 The <name> parameter is specified more than once.
-2751 The <name> property is specified more than once.
-2752 The <name> handler is specified more than once.
-2753 The variable <name> is not defined.
-2754 Can’t declare <name> as both a local and global variable.
-2755 Exit statement was not in a repeat loop.
-2760 Tell statements are nested too deeply.
-2761 <name> is illegal as a formal parameter.
-2762 <name> is not a parameter name for the event <event>.
-2763 No result was returned for some argument of this expression.
*******************
-10000 Apple event handler failed.
-10001 A descriptor type mismatch occurred.
-10002 Invalid key form.
-10003 Can’t set <object or data> to <object or data>. Access not allowed.
-10004 A privilege violation occurred.
-10005 The read operation wasn’t allowed.
-10006 Can’t set <object or data> to <object or data>.
-10007 The index of the event is too large to be valid.
-10008 The specified object is a property, not an element.
-10009 Can’t supply the requested descriptor type for the data.
-10010 The Apple event handler can’t handle objects of this class.
-10011 Couldn’t handle this command because it wasn’t part of the current transaction.
-10012 The transaction to which this command belonged isn’t a valid transaction.
-10013 There is no user selection.
-10014 Handler only handles single objects.
-10015 Can’t undo the previous Apple event or user action.
*******************
From: http://lists.apple.com/archives/applescript-users/2004/Jan/msg00116.html

Classless Inter-Domain Routing (CIDR) address converter

December 14, 2009

http://www.4dnstools.com/cidrnetmask.html?mainsearch=202.20.76.0%2F24


Follow

Get every new post delivered to your Inbox.