Suppose you have a database server (db.example.com) which only accepts connections from the web server (www.example.com). The web server accepts SSH connections from anywhere (so ssh user@www.example.com works). And you have 200 tables to update. Start by opening a tunnelled SSH connection in a terminal window like so: [shell]ssh user@www.example.com -L 31123:db.example.com:3306 [/shell] The command starts like a normal ssh connection.
I need to open all external links in a site in a new window/tab. But I can't trust the users to put a class or other data in the link. And I cannot trust them to add or remove the www. part of the domain name (if it's even supposed to be there). Javascript to the rescue!
Suppose your git development process uses lots of branching. Yay branching. You want to keep them all up-to-date with the master branch, but constantly merging master into a dozen or more branches is a bit of a pain. Here's one way:
Problem: You want to host all of your web development sites in ~/Sites, and you don't want to fuck around with DNS and Apache configuration every time you start something new. Solution: DNS wildcards and Apache Virtual Hosting! The easier bit: get dnsmasq going Follow the directions here.
Grab a sudo shell and stay there: [shell]$ sudo -s [/shell]. So much nicer than [shell]$ sudo su[/shell] - it keeps all of your environment variables!