SUBSCRIBE VIA RSS


Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.

Topics

Stack Overflow


The old fashioned way

RECENT TUNES

  OS X Articles

October 1, 2007 – 1:38pm Prevent DNS Servers from redirecting local requests

When I start work on a new web project I usually create a new virtualhost on my development machine so that I can access a local version of the site at something like http://myproj/ instead of http://localhost/~myusername/myproj. I use a nice little shell script written by Patrick Gibson called virtualhost.sh that handles this task on OS X. One little snafu I run into depending on my ISP is that their DNS servers will sometimes capture my local request to the domain name and try to redirect before my request even hits my local server. To fix this, you have to edit your local hosts database. Open up /private/etc/hosts and add a line like:

127.0.0.1       myproject

Now, any requests to http://myproject/ should be recognized as a local host and your DNS servers will no longer redirect you.

Posted by in  OS X Web Development   |  Comments Off on Prevent DNS Servers from redirecting local requests

August 3, 2007 – 9:56am TextMate Tip of the Day: Drag a file from the project drawer

Just discovered this by accident: If you want a list of files in your project or any sub directory, drag the item from the file drawer into a document. A nicely formatted list of all of the files will automatically be placed into your doc. Now… if only I needed it. Maybe someday.

TextMate: Click to View Screencast

Posted by in  OS X Web Development   |  Comments Off on TextMate Tip of the Day: Drag a file from the project drawer

August 2, 2007 – 1:15pm SSH Login without entering your password

Using an SSH key to connect to the server allows you to log in without entering your password.

To generate an SSH key on Mac OS X or Linux machines:

  • Open a Terminal window and enter:
ssh-keygen -d

Unless you set an alternative local storage location when prompted, your public key will be stored in ~/.ssh/id_dsa.pub. For increased security enter a passphrase when prompted, however this is probably not necessary unless many people use your computer.

  • At the command line enter the following and copy the output to the clipboard.
cat ~/.ssh/id_dsa.pub
  • Log in to the server.
  • Switch into the ssh directory:
cd .ssh
  • Type:
vi authorized_keys
  • Paste your public key from the clipboard, then save and exit vi.

June 22, 2007 – 2:18pm OS X Tip of the Day: Drag applications to the finder toolbar

If you want easy access to your commonly used applications, here is a tip that will save you some time. Drag an application icon up to your finder tool bar to create little shortcut icons in every window. You can click these icons to open the application, or better yet, drag files onto them to open those files with that application.

I use this feature with TextMate to open up new projects on the fly, and with Preview to get a quick look at documents that otherwise would open up in Photoshop of Fireworks.

finder toolbar shortcut

Posted by in  OS X   |  1 Comment »

June 11, 2007 – 5:26pm Safari 3 Beta out for OS X / Windows – Crashes Unexpectedly

With claims that it is up to 1.6 times faster than Firefox 2 I thought I would give the new Safari 3 beta a run-around. Turns out it gave me the run-around as first it required a restart after installation and then would unexpectedly quit every time I tried to open it. Our advice: wait until it becomes more stable–at least enough to open it–before you download it.

This was on a Powerbook G4 1.5 GHz running 10.4.9 and 2 GB of RAM

Posted by in  OS X   |  Comments Off on Safari 3 Beta out for OS X / Windows – Crashes Unexpectedly

May 22, 2007 – 1:23pm TextMate Tip of the Day: Piping SVN diff

  • pipe svn output with | mate

You can get a great view of the changes you’ve made in a file under version control (with svn) if you pipe the command through to TextMate:

svn diff web/myfile.php | mate

You can also do this with svn cat:

svn cat -r## filename | mate

This will open up the resulting diff output in a new document in TextMate, all color coded and ready to go.

SVN Diff

Posted by in  OS X Web Development   |  Comments Off on TextMate Tip of the Day: Piping SVN diff

May 22, 2007 – 11:20am How to set up an SSH tunnel to a remote MySQL server

If you have SSH access to your hosting account and want to use a GUI to view your MySQL databases on that remote server, you can set up an SSH tunnel and use a program like CocoaMySQL to manage your remote database. When it works, it can be really userful and is a nice break from a web-based solution like phpMyAdmin.

First, make sure you can login to your host through SSH. After you are certain it works, you can open up a tunnel like this:

ssh -L 3307:[ip address of host]:3306 [username]@[ip address of host] [-p ssh portnumber]

This opens up a tunnel from your local port 3307 to port 3306 on the remote host. Here is the example again with dummy data, using a non-standard ssh port 8022:

ssh -L 3307:192.168.2.1:3306 user@192.168.2.1 -p8022

Once that connection is set up, fire up your MySQL GUI and connect to your local IP address (127.0.0.1) and specify the new port you set up in your tunnel (3307). Here is how it looks in CocoaMySQL.

CocoaMySQL Connection

Posted by in  OS X Web Development   |     |  Comments Off on How to set up an SSH tunnel to a remote MySQL server

May 15, 2007 – 3:17pm OS X Shortcuts, Terminal, Emacs

There are a lot of key commands that exist in OS X that are based on the standard Emacs keys (which admittedly I know nothing about). In bash, tcsh, and other unix environments you will find a lot of these work, and sometimes they will even work in Cocoa text editing tools as well.

These are supported by Mail, TextEdit, and other a lot of other Cocoa apps:

  • ctrl-a Move to the beginning of the line
  • ctrl-e Move to the end of the line
  • ctrl-f Move forward one character
  • ctrl-b Move back one character
  • ctrl-n Move to next line
  • ctrl-p Move to previous line
  • ctrl-d Delete character to right of cursor
  • ctrl-h Delete character to left of cursor
  • ctrl-k Kill from cursor to end of line (kill remembers what was deleted)
  • ctrl-y Yank back what was killed, at the cursor
  • (these two use their own clipboard, not the cmd-x/c/v one)
  • ctrl-o Insert line after cursor
  • ctrl-t Transpose characters on either side of cursor
  • ctrl-l Center the display on cursor
  • ctrl-v Scroll the display one screen forward

Here’s a pretty complete list of existing Mac key bindings for editing:

<http://www.hcs.harvard.edu/~jrus/Site/system-bindings.html>

Here’s how to add even more bindings to Cocoa (by adding them to

~/Library/KeyBindings/DefaultKeyBinding.dict):

<http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html>

And more on Emacs productivity and the Mac:

<http://bc.tech.coop/blog/060620.html>

Posted by in  OS X   |  Comments Off on OS X Shortcuts, Terminal, Emacs