Skip to main content

Posts

Showing posts from 2009

Convert Mac to Unix - Or ^M to CR

Convert Mac to Unix - Or ^M to CR To use awk to convert a Mac OS file to Unix, at the Unix prompt, enter: awk '{ gsub("\r", "\n"); print $0;}' macfile.txt > unixfile.txt To convert a Unix file to Mac OS using awk , at the command line, enter: awk '{ gsub("\n", "\r"); print $0;}' unixfile.txt > macfile.txt

How to uninstall Mac OS X .pkg packages

How to uninstall Mac OS X .pkg packages By SHARNINDER | Published: OCTOBER 29, 2009 Most applications on OS X are distributed using either a .DMG disk image file or a .pkg installer. Installing using a DMG is the easiest. Just drag the application from the mounted image to the Applications folder and you’re done. The .pkg installer, on the other hand, works like a traditional installer. Double click the program, go through a couple of steps using a Wizard and the application is installed. Unlike other operating systems, though, Apple doesn’t provide a simple method to uninstall applications. In the case of a DMG based install, all you have to do is drag the application from the Applications folder into the Trash and it’s gone. A pkg based installer, on the other hand, doesn’t offer any such luxuries. The user depends on the developer to provide an uninstaller for their application, which is often not the case. So, how do you uninstall applications installed using a .pkg installer ? Wel...

Expect - run rup on a named host

#!/usr/bin/expect log_user 0 send "Which host do you want to rup? " expect { \n {set host [string trim $expect_out(buffer)]} timeout {puts "\nNot fast enough"; exit} } spawn rup $host expect { "\n" { puts -nonewline $expect_out(buffer) flush stdout exp_continue } eof { puts "done" } }
How to install kismet on MacBook, Mac OS X 10.5.6 Leopard How to installed and run kismet. cd /tmp svn co https://www.kismetwireless.net/code/svn/trunk kismet-devel cd kismet-devel ./configure sudo make install Edit kismet config file like: sudo vim /opt/local/etc/kismet.conf and change the following two lines: a.) suiduser=Your_Username_For_Mac b.) source=darwin,en1,airport_extreme Run kismet and enjoy! sudo kismet

Compiling & Installing nmap for OS X

Go To http://nmap.org/download.html Download Latest development Nmap release tarball: nmap-5.10BETA1.tar.bz2 (or gzip compressed ) Latest stable Nmap release tarball: nmap-5.00.tar.bz2 (or gzip compressed ) bzip2 -cd nmap-5.10BETA1.tar.bz2 | tar xvf - cd nmap-5.10BETA1 ./configure make sudo make install

md5 checksum on os x

#!/bin/sh ####################################### # find the md5 checksum of some file by name # syntax: get_md5 # by jrc 7/2002 ####################################### mypgm=$1 if [ "$1" = "" ]; then echo "No defaults" echo "--------------------------------------" echo "syntax: get_md5 " echo "--------------------------------------" else openssl md5 $1 fi

Handle Too-Long Command Lines with xargs

Handle Too-Long Command Lines with xargs xargs is one of those UNIX utilities that seems pretty useless when you first hear about it -- but turns into one of the handiest tools you can have. xargs reads a group of arguments from its standard input, then runs a UNIX command with that group of arguments. It keeps reading arguments and running the command until it runs out of arguments. The shell's backquotes do the same kind of thing, but they give all the arguments to the command at once. This can give you a Too many arguments error. Here are a couple of examples: If you want to print most of the files in a large directory, put the output of ls into a file. Edit the file to leave just the filenames you want printed. Give the file to xargs ' standard input: % ls > allfiles.tmp % vi allfiles.tmp % xargs lpr What did that do? With lines like these in allfiles.tmp : % cat allfiles.tmp afile application ... yoyotest zapme xargs ran one or more lpr commands, each wit...

Ten OS X Command Line Utilities you might not know

Ten OS X Command Line Utilities you might not know about The Mac OS X command line interface is home to thousands of programs that the average user doesn’t know exists. Leveraging years of hard work by the GNU foundation and others in the open source community, Apple designed a wonderful OS that doesn’t “need” any use of the command line. While using the command line in Mac OS X is not necessary for the every day operation of a Macintosh, if harnessed correctly, it can save you a lot of time, and occasionally give you a laugh. I hope you enjoy these ten OS X command line utilities! Update: There is also a Chinese version of this article available here , translated by Klaith . Thanks Klaith! 1. ssh This little gem is included in every version of Mac OS X. Originally developed as drop-in replace to the rsh/rlogin programs, ssh has become a staple of the Linux/Unix(and now Mac OS X) community. Openssh’s primary use is secure remote administration. If you wish you enable Mac OS X’s b...

Setting Up a Firewall: Mac OS X 10.6.x (Snow Leopard)

Setting Up a Firewall: Mac OS X 10.6.x (Snow Leopard) Learn how to set up the Mac OS 10.6.x firewall to protect your computer against malicious activity. Note: This basic firewall closes off unused network service ports, but lets you create exceptions for specific programs running on your computer. To check your version of OS X, open the Apple menu (the blue apple icon in the upper left corner of the screen), and select About This Mac . Expand all 1. Open System Preferences. Open the Apple menu, and select System Preferences… Click the Security icon in the Personal area of the window, or open the View menu at the top of the screen, and select Security. 2. Activate the firewall. Click the Firewall tab. Note: If the Start button is gray and you can’t click it, click the lock icon at the bottom of the window, and enter your adminstrator password when prompted. Click the Start button. Click the Advanced button. Select the desired firewall configuration. Click OK. Close the Securit...