Tag Archives: listen

MacOSX command line tricks

Here's a list of MacOSX commands I had to search for all over the internet because I needed to use them lately and I'm sure I'm going to forget since I'm not a big OSX user. So here they are for when I'll need them again ... 🙂

In linux when you want to know which ports are opened and what applications listen on those ports you use netstat -lnp
In MacOSX you get the listening ports with this:

  1. lsof -i |grep LISTEN

Want to see what system call am application is making use strace, for MacOSX thats:

  1. dtruss

Here's how to install an application that comes packaged in a .dmg:

  1. hdiutil attach App.dmg
  2. installer -package /Volumes/App/App.pkg -target /Volumes/MainDisk
  3.  

uninstall a package

  1.  
  2. lsbom -fls /private/var/db/receipts/package.name.bom|tr '\n' '\0' |xargs -0 rm
  3. rm /private/var/db/receipts/package.name.*
  4.  

pidof required by some mysql scripts

  1.  
  2. #!/bin/sh
  3. ps axc|awk "{if (\$5==\"$1\") print \$1}";
  4.  

remount with noatime

  1. mount -u -o noatime /dev/disk0s2 /Volumes/HD2

More to come ...

Proftpd: listen on single ip

I don't use ftp, I always use sftp/scp/rsync over ssh or even a fuse remote filesystem for transferring files but wordpress 2.5 comes with this nice feature to upgrade plugins automatically from the web admin interface that needs ftp.

the problem is I don't want to enable the ftp service and make it available to the rest of the world just for that.

So what are my options?

  1. I know I could just add a firewall rule and just not allow anyone else except for localhost to connect
  2. set proftpd to listent only on localhost ( 127.0.0.1)

The #1 depends on what firewall you have so I'm not going to discuss it here. You also may not want to do that because of some other reasons you might have.

#2 needs the following two options in proftpd.conf:

DefaultAddress 127.0.0.1
SocketBindTight                 on

Now restart proftpd and you're done.