Bash/Cygwin Terminal in PHPStorm

I’ve been meaning to post about this for a while, but it seems hard lately to make time to post here.

I personally hate windows shell, in my mind it is utterly useless. If I’m ever using it I’m probably not in a good mood. Powershell makes me laugh, like I’m sure it has some uses for people who for some insane reason run Windows servers, but for a sane developer; I think not.

Bash is where it’s at, probably the tool/language that saves me the most time on a day to day basis. Regex is a close second and guess what, Regex & Bash play very nicely together. Luckily I work with a company that exclusively uses Linux servers, because they make good decisions like that. 😉 So any server admin is painless, however for development, I still seem to be stuck in Windows land. I could make the leap over to just using Linux, however there are unfortunately a handful of programs keeping me on Windows and WINE still sucks.

So Bash on Windows, only one way to do that really. Cygwin. I’m not going to go into how to install that here, because it’s very simple, just download, run and press next.

Jetbrains make amazing products, PHPStorm is the editor I spend most of my time in, so I’ve shown how to do this here. However it should work for any Jetbrains IDE since they are all pretty consistent.

I liked the idea of a terminal window inside the IDE, mainly as just a quick way to grep or find things within projects. So I decided to figure out how to replace the windows terminal embedded in it with the cygwin terminal.

So it turns out it’s pretty simple, just go File -> Settings and hit Tools -> Terminal. You’ll want to change it’s default from cmd.exe to "C:\path_you_installed_cywin_to\bin\bash.exe" --login -i

Here is an image of what I have:

After this, when you relaunch your terminal inside PHPStorm it will be the Cygwin terminal rather than the Windows terminal. However there is just one issue left to deal with, it will default to your Cygwin home directory rather than the project directory. Fixing this is also pretty easy just navigate to C:\path_you_installed_cywin_to\etc\bash.bashrc at the bottom of that file just add

cd "$OLDPWD"

Here is another image for those still confused:

Well that’s it, enjoy Bash’ing away inside PHPStorm. 😉

Saving Your Windows PC From Virus Infections with Linux

Often you get a friend or other times a client who has gotten themselves locked out of their system by a virus. I’m talking about the seriously nasty virus’s out there that will just corrupt every .dll file they can get their hands on so the minute you try to open any program, your reopening the virus.

When this is the case there isn’t much you can do in terms of anti-virus scans etc. your only option is to wipe the machine and go for a clean re-install of Windows.

But what about all my files?

Well we backup all of those files onto an external hard drive before wiping by loading up a “Live CD” of Ubuntu, simply navigating to the computers hard drive,  selecting what we need and loading it onto the external hard drive.

The beauty of a “Live CD” is that the entire operating system runs of the CD [believe me you’ll here it spinning around the place] so the virus has no chance to load since Windows never gets booted.

Ontop of that Linux systems aren’t vulnerable to Windows virus’s so you can be sure your not infecting your external hard drive aswell.

Earcandy in Ubuntu Jaunty

What is Earcandy?
EarCandy is a volume manager for PulseAudio that fades applications in and out based on your current activity. Meaning it can do handy things like muting your music playing when you decide to turn on a youtube video. EarCandy can sniff out applications to tell what kind of application they are

Some Screenshots:
.Ear CandyEar Candy

Video of it in action:

How to install Earcandy on Ubuntu Jaunty
You can do this by using the following command:
sudo kate /etc/apt/sources.list
Then add the following to the end of the file:
deb http://ppa.launchpad.net/earcandy-devel/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/earcandy-devel/ppa/ubuntu jaunty main

Then you can install earcandy by using the following command!
sudo apt-get install earcandy

Got kUbuntu 9.04 on disc!


My address has finally been sorted, there was some confusion with the post man and where I lived since moving into the newly built apartment, but today kubuntu 9.04 “Jaunty Jackalope” came through the door!

With its world-renowned Ubuntu core and the KDE 4.2 desktop, Kubuntu 9.04 gives users a well-rounded, feature-filled and elegant desktop.

Best of all these cd’s are free thanks to Shipit and ubuntu! Check it out here! I recommend anyone that has to fix computers to get themselves one, live cd’s really can be a lifesaver!

Google Chrome on Ubuntu

Google Chrome

If your using Ubuntu you can now start using Chrome, or Chromium as its known amongst the linux community. Daily builds of Chromium can be got from here.

You’ll need to add the following repositories to get Chromium:

Note: Substitute interpid with jaunty or hardy as needed!


deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main

Then you can then install it by opening a terminal and do the following command:
sudo apt-get install chromium-browser
Of course this is still in Pre-Alpha so make sure to keep another browser installed! 😉

Autoinstalling .Debs on Firefox

Auto install linux
I was trying to use a get .debs website the other day and with alot of fustration of firefox saying “Firefox does not have the correct protocol to open this file [.apt]” I finally figured out that I did not have “apt-url” installed by default on kUbuntu. This can be fixed by simply opening a terminal window and typing:
sudo apt-get install apturl
Then restart firefox [doesn’t matter what version you have]. Go to download another .deb / .apt file and when it asks you what you would like to use to open the file browse to /usr/bin and pick whatever installs your programs! Presto your done! 😉

You can now use sites like, Playdeb.net more on Playdeb.net tommorrow!