Home English Blog MacOS X MacOS X - Tips & Tricks
MacOS X - Tips & Tricks PDF Tisk Email
Napsal uživatel Pavel Beníšek   
Středa, 17 Červen 2009 11:22

I intend to use this article to collect my own tips & tricks with using mac OS X (or osx86 if you like). I rather warn you in advance; I am NOT an average user. I like to play with an OS and I do quite a lot of web development so range of tools installed on my system as well as range of things I use it for might seems to be unusual.

I don't take a responsibility for any damage you may/will do to your computer. All the tips are ONLY a collection of what I have discovered or found somwhere online.

mac ports

syncing behind firewall

I have been having troubles to make any connection work in office. I new there was a problem with our firewall so I assumed the easiest way should be to tunnel it through my server. I have tried several methods and the following one works like charm and I like it the most.

Firstly in order to make it all work you have to have an account on a server which is open to world (not behind the same firewall you are).

Then you can use the ssh command to create tunnel to the server and forward your connection to correct location. I simply create the tunnel using same ports locally and remotely. It has to be done under local root use, because normal users are not allowed create connection using ports lower then 1024.

sudo ssh -fN -l USERNAME -L 873:rsync.macports.org:873 YOURSERVER

After running this command it will asks you first for your root password and then for your remote password and send the ssh into background. So you will be back in you LOCAL shell. All connections to local port 873 are being tunnelled to YOURSERVER and then forwarded further to the rsync.macports.org

Now we have to modify mac ports setting so lets make backup of it first.

sudo cp /opt/local/etc/macports /opt/local/etc/macports.original

Now we are ready to do the final modifications.

Edit as root file /opt/local/etc/macports/macports.conf and comment the line rsync_server. then copy it and change value to localhost. It should look like this:

#rsync_server           rsync.macports.org
rsync_server            localhost

The last thing we have to change is the repository location. Open file /opt/local/etc/macports/sources.conf and at the end comment the address of the rsync server and in copy of it change the server name to localhost.

#rsync://rsync.macports.org/release/ports/ [default]
rsync://localhost/release/ports/ [default]

Now you can use the port command as usually.

Enjoy

 

 

 

Aktualizováno Pátek, 13 Listopad 2009 16:55