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. 😉

Free SSL Certificates with LetsEncrypt and Ajenti-v

So this is going to be a very quick post on how to use LetsEncrypt SSL certificates on your Ajenti-v setup. Ajenti-v will probably be supporting this natively at some point, there is an open issue on their Github here. But in the meantime you can just follow these steps to start using LetsEncrypt now.

Step 1. Install LetsEncrypt.

Being a PHP Developer in 2015

This is just some thoughts on being a PHP developer in 2015;

A standard web project before used to just require you to setup a local web server, and then you’d upload to a standard web host with some worries about PHP versions perhaps but little to no thought required for the server side of things.Frameworks were a new thing, CodeIgniter was (to me at the time) the best thing to happen to PHP,  introducing me to PHP MVC patterns, easily integrated vendor libraries (I never got into Zend Framework) and Twig.

Esprimo Mobile v5535 and Ubuntu 10.10

So I ended up picking up a cheap Esprimo Mobile v5535 a few days ago, long story short; laptop broke, Argos have sent it off for repairs that will take 2-3 weeks, don’t buy a laptop from Argos! 😛

Anyway the Esprimo Mobile isn’t exactly a cutting edge laptop, if you said it was outdated you wouldn’t be wrong! 😉 When I got it the OS installed was Windows Vista, “ambitious” I thought, of course I can’t have any kind of computer without tinkering with it endlessly to find out the best way performance wise for it to be running, Ubuntu was in my head from the start but an apparently broken CD-drive was putting an end to that.. I’ve never tried to install Ubuntu from a network and I wasn’t going to start now, [USB wasn’t an option in boot] instructions on Ubuntu’s Support don’t make a network install look simple!

A few Registry edits later, (one too many infact) I had the CD-drive working but Windows locked in that state of “somethings missing, would you like to use Startup Repair?” and then when using Startup repair just rebooting the computer into the same cycle. No worries though at this stage I just began installation of Ubuntu. I was surprised to see that the Wi-Fi worked from the get-go, is nDiswrapper ever needed any more? 😛 The only issue was the resolution seemed to go no higher than 800×600.. Of course a few google searches later and I found this article which explains how to install the drivers for SiS Graphics. Using their default Xorg.conf and driver I rebooted only to find the machine now screwed graphic wise, lines all down the screen changing.. I originally thought it was the refresh rate but hell this is Linux, you could set every setting to the absolute worst one possible and still be able to change back, where is that option Windows? So I switched to a terminal window [Ctrl + Shift + F5 (any F key) for those interested] opened up Xorg.conf using "sudo nano" changed what seemed to be affecting the graphics;  Option  "UseTiming1366" "yes" to Option "UseTiming1366" "no" [didn’t know yet if it was the problem] rebooted and presto a 1280×800 resolution!

So the point of this story is; It’s great how in Linux you’ll mess something up and still be able to repair it via a terminal window, and if you need better resoloution on your Esprimo Mobile click this link.

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.

Jelly SMS – Use your web texts from your desktop

jellysms
One program I’ve been using a while now and is a serious lifesaver for when I’m out of credit is “Jelly SMS” [previously just jSMS]. You need to have the latest Java installed for it to work but it is cross-platform. It basically lets you send web texts from your desktop without having to login to your network’s website.

The latest version of the software, available here [just click Free Version –> Desktop] even supports delivery reports, and support is very good, I’ve noticed it not working maybe twice in the last year[due to o2 redesigning their website], both times the issues where fixed and an automatic update was out within two days. They also now have an android and iPhone app, for anyone in possession of those luxuries!

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! 😉