Ever found yourself changing permissions recursively and then realise you used the wrong permissions? Unfortunately, I have. Don’t know if it was due to lack of sleep or caffeine but it just did. Due to my bad handling, I had a few folders where the permissions got screwed up. The folders that I needed to … Continue reading Recursively fix bad file permissions
Tag: bash
Changing permissions can be tricky, because either way, permissions are on of the corner stones of security. It could be that you want to change permissions recursively on all folders, but not on files, and vice versa. Unfortunately, a lot of people don’t take that into account. So here’s a quick tip on how to achieve … Continue reading Set recursive permissions on only files or directories
Creating a command-line app in ruby might be fun, being able to test them is just as important as testing any other web application. But you can do this with Aruba. Aruba is a Cucumber extension for testing command-line applications written in any language. Passing arguments, interacting with the file system, capturing exist codes en mimicking … Continue reading Testing your ruby command-line tools
In some cases you might need a simple command-line tool. But one of the problems writing those scripts is finding a descent way to manage and distribute them. One way is to bundle your command-line tool into a ruby gem. I already described in a previous post how to create a ruby gem, so I … Continue reading A simple Ruby command-line tool
There are different tools out there for creating gems. Back in the time, you could achieve this by using tools like Echoe or Jeweler. But you can do the same by using Bundler. Bundler is mostly use as a way of managing dependencies, but not a lot of people know you can use it to … Continue reading Create a ruby gem
One of the main reasons I switched to Mac was the fact that the user interface is polished and I still maintain the power and freedom I find Linux. But one downside in Mac Terminal is that there is no standard syntax highlighting. So here is some info how I got to enable some basic … Continue reading Enable syntax highlighting in Mac OSX Snow Leopard
I had a small problem on my Mac when I wanted to rebuild a subversion repo. When I worked on windows, I just searched the project folder for .svn folders. But on Mac and Linux, thats another story. Thankfully for the command-line, one quick command, and the problem is fixed: find . | grep .svn$ … Continue reading Remove hidden .svn folders from command-line
Today, I needed to empty a folder through bash on my Linux server that contained a lot of files. The files where maybe 2kb, but all the files together contained over 400Mb. So I used rm * to remove them, but it threw me a nice error: bash: /bin/rm: Argument list too long . Looks … Continue reading bash: /bin/rm: Argument list too long