Starting FTP Server in OS X Lion

In Lion, Apple dropped the FTP Server support, however they only removed the GUI.

You can enable it via the command line still, pretty easy actually. Apple have also dropped SystemStarter so you’re forced to use launchctl (which works better)

To start it

sudo -s
launchctl load -w /System/Library/LaunchDaemons/ftp.plist

To stop it

sudo -s
launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

Hope that helps!

P.S, close the Terminal window open after you’ve finished, you don’t want to leave a root shell open.

Posted in Uncategorized | 34 Comments

Converting Shell Scripts Into Binary (Debian & CentOS)

A lot of people want to encrypt their shell script so that they can publish it online without people being able to peak at the code.

This is a very simple way of turning that script into C code so you can compile it into a binary, although I don’t recommend you entirely rely on this method. Because it is still a shell script at heart, it won’t execute any quicker when converted.

Please note, the text after the // means a comment, and you shouldn’t enter this into the terminal session.

Step 1. Install gcc, make and some other things.

apt-get install gcc make // Debian
yum install make gcc // CentOS

Step 2. Download SHC and extract it.

tar -xzvf shc* 
cd shc*

Step 3. Compile and Install It.

make // this will error, but ignore it
make test
make strings
make expiration
mkdir -v /usr/local/man/man1/ // it doesn't exist.
make install

Now, SHC should be installed, so now we have to make the binary.

Step 4. Make a script in your favourite editor, such as nano or vim. It is VERY important you keep the shebang at the beginning of the script (whatever shell you’re using, probably bash as listed below)

echo "Hello"

Save that, and for the tutorial were going to refer to this saved as

Step 5. Compile that script into a binary and C code

shc -v -r -f

Step 6. Its now compiled, your end up with two files created similar to what i’ve listed below. // This is the binary // This is the code generated

Now, your all done and it should be safe to distribute the binary. If you have any issues just post in the comments or contact me.

SHC Info:

Posted in Uncategorized | 2 Comments

Installing PHP-SSH2 (CentOS)

One of the most annoying PHP extensions to install has to be SSH2, not only does it have a few errors when you try to compile it, all these tutorials on the web teach you a really hard way.

This is by far the easiest way to install it, and doesn’t require any editing!

Step 1. Install some requirements (oh and make sure php is installed first)

yum install php-devel php-pear gcc make openssl openssl-devel

Step 2. Download libssh2, compile and install it

mkdir libssh2
cd libssh2
tar xvzf lib*
cd lib*
make install

Step 3. Install the SSH2 module

pecl install ssh2-beta

It will ask for libssh etc locations but just press enter for default, it will try to put the extension in your php.ini automatically but usually fails. So just find your php.ini (usually /etc/php.ini) and place in there

And restart apache, php-cgi, nginx whatever you have running and there you go. php-ssh2 installed. That wasn’t hard, was it?

Ill have a Debian version soon, Debian calls everything wacky names in the repo, so these steps won’t work.

Posted in Uncategorized | 5 Comments

My Blog

Ill put some stuff on here.

Posted in Uncategorized | 2 Comments