Linux

Quick and Easy FTP Proxy using SSH

I’ve been having trouble connection to a few of my clients FTP servers while I’ve been freelancing in China. So I looked around for a simple way to proxy my FTP connections. If you have a linux/mac server you can proxy through it. I used my Free Amazon EC2 Server.

All you need to do is run this on your local box.

 ssh -D 9999 ##HOSTNAME##

Then in ftp client instruct it to use a SOCK5 server

It’s that easy!

Btw, you can do this on windows almost as easy, you just need to use Putty for the ssh command part. Checkout this nice blog post from Chris Swan for information about using Putty.

http://blog.thestateofme.com/2010/10/27/using-amazon-ec2-as-a-web-proxy/

The Perfect Dev Environment?

Hey all,

I have decided to undertake the task of packaging a custom eclipse distrobution. Also included I’m going to package a VMWare appliance server for debugging and all that good stuff.

So far here is the list for the eclipse side:

  • Zend Studio 7
  • Flex Builder 3 Beta
  • MyLyn
  • JS Eclipse
  • Sub Eclipse

And here is the list on the linux vmware side:

  • Fedora 11
  • PHP 5.3
    • apc
    • curl
    • gd2
  • Subversion
  • MySQL 5.1
  • Postgres 8.4
  • SQLite 3.6
  • Zend Studio Community Edition (Free Edition)
  • SQL
  • Samba + Swat
  • NFSv4

I’m also planning to create a simple web interface for the vmware image, we’ll see thou.

So Stay tuned for more details, and of course for the actual distro…  Also if you can think of any good ideas, please leave a comment and I’ll see what I can do…

Mounting a network share with net use

A easy way to mount network drives from either a windows box or a linux samba share is to use the net use command in your cmd.exe prompt.

  1. Open your run prompt by holding down your windows key + R
  2. type in cmd

net use g: \\hostname\shareName

You can substitue the drive letter g with any open drive letter on your system. the hostname can either be a hostname or an ip address like this.


net use g: \\192.168.1.100\shareName

You then should be prompt to enter a username and password if the share is password protected. If everything works correctly then you should get the “The command completed successfully.” message and you should now see your drive show up under “My Computer”

Using Tar

Tar is format of choice for archiving and compressing files on linux. It’s pretty simple.

Creating a Tarball

tar -czvf test.tar.gz test

tar -cjvf test.tar.bz2 test

Unpacking a Tarball

tar -xzvf test.tar.gz

tar -xjvf test.tar.bz2

  • c = create
  • z = gzip
  • j = bzip2
  • v = verbose
  • f = file
  • x = extract

You notice I give two different options, the difference is czvf vs cjvf, which is just the compression method. I usually use gzip, but both are pretty close to each other. From what I’ve heard bzip2 will give you better compression (about 15%) but is a little slower at compressing and decompressing.

Finding Files in Linux

There are two ways I now how to find files, I like to use updatedb/locate the best, but the find command is more commonly installed.

updatedb / locate

updatedb

locate testfilename.txt

find

find -name testfilename.txt

updatedb /locate is much faster because it uses a database to cache all the files on your system, but it needs to constantly be updated either manually or by cron. Where as find is much slower but also is up to date.

How To Create a Subversion Repository and Trac Project

Subversion is the shit!

It allows you to seemless cover your own ass… It is also very useful for transfering, and updating code. Trac is also very cool, it has one of the best bug tracking sytems, a cool wiki, and a subversion browser. Here is a tutorial about how to setup these up on a fedora/redhat server… It’s pretty easy…

(more…)