Blog Archives

Triggers in iTerm – Watching For Specific Strings

I was recently performing a git-add in patch mode (  git add -p ) as I normally do, and realized there were a few lines I needed to make sure I didn’t commit. These lines were sandwiched between other lines that I did want

Tagged with: , , , , ,
Posted in Development, Tech Tips

Delete Last Command from Bash History

If you’re like me, on occasion you accidentally (or sometimes purposefully) include a password in a command. Until recently I would execute history , find the offending command’s number, then do a history -d NUMBER . It is kind of a pain. The following

Tagged with: , , ,
Posted in Tech Tips

Autocomplete in iTerm2

This is a really quick tip that could save you tons of time in iTerm2. If you use any auto-completion you know how important it is to your workflow. Personally, I rely heavily on omni and generic completion in Vim.

Tagged with: , ,
Posted in Tech Tips

Determining Your Most Used Commands in Terminal

I’m always looking to automate things using Alfred, Keyboard Maestro, Text Expander, and Python. I was curious which terminal commands I use most often, so I did some experimenting. Basically I wanted to know how many times I’ve executed each

Tagged with: , , ,
Posted in Tech Tips

Applescript to Interact with iTerm2

iTerm2 has decent support for Applescript. You can work with sessions, profiles, tabs, and more through Applescript. I only have one example, but it’s something I use in the real-world, so maybe it’ll help someone else. The following script will

Tagged with: , , ,
Posted in Development

“755”-style permissions with ‘ls’

After a quick Google search for “ls permissions octal” I found a very handy alias to put in my .bashrc. Not only is it handy to see the OCTAL value of the permissions for each file/dir, it will undoubtedly help

Tagged with: , , , ,
Posted in Tech Tips

Automatically Stage All Deleted Files (Git)

Tab-completion is a really nice thing that we often take for granted. While working with Git I’ve found that it becomes inconvenient to stage (add for inclusion in the next commit) removed files using git rm path/to/my/file.php. Tab completion doesn’t

Tagged with: , , ,
Posted in Development

Automatically Change Links from Absolute to Relative

In this example I’m showing one way to quickly convert all a href and img src paths from absolute to relative. It’s quite a time saver, but I suggest committing your latest changes before trying anything here! If you aren’t

Tagged with: , , , , ,
Posted in Development