Posts tagged with "Windows"

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: phpstorm.png

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:

script.png

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


Posted on March 14, 2017

An honest review of the Surface Pro 3

surface-pro.jpg

I bought a Surface Pro 3 in November 2014, I haven’t wrote anything at all about my thoughts on it since purchasing it, I figured it was better to wait until I had actually been using it for a significant amount of time and give it an honest review. A year and a half I figure to be more than enough time.

So this post is going to be structured in the following way, condensed Pro/Cons. for you speed readers and then just my personal thoughts on things I’ve come across while using the device.

Pros

  • Amazingly portable, very light and much easier to use on your lap than a traditional laptop.
  • Can run pretty much all software, Photoshop, Jetbrains products, Office etc all work well.
  • Can run certain games, Hearthstone works great, older games like Warcraft aren’t an issue. Processor heavy games like Starcraft II will work but become extremely laggy when lots of units are out.
  • Touchscreen is very satisfying to use for browsing the web etc.

Cons

  • WiFi is a complete joke. Sometimes after resuming from sleep you won’t have WiFi anymore. I’ve had the WiFi just completely disappear on me and ended up having to wipe & restore the entire device.
  • Overheating is a serious issue, even when running just a browser the surface can become incredibly hot, some people are combating this by having an external fan pointed at the device.
  • The chargers connection to the Surface is pretty much the worst design ever. Unless you constantly make sure it’s not bending in any way whatsoever prepare to replace your charger every 6 months. The chargers are not cheap either!
  • You constantly need to change the scaling of the resolution depending on what you’re running. Coding in an IDE scale up, games scale down. Changing scaling requires logging out and back into Windows, kind of awkward but could be worse.

Well that’s the basic pro and cons down, now lets get into why I actually bought the Surface and my personal feelings on it.

I bought the Surface because I needed a semi-powerful laptop that I could bring back and forth to work, having never owned a tablet the idea of the Surface appealed to me, being both a laptop and a tablet. I was not looking for a gaming laptop, but a laptop that could at least play some games. Mainly I needed a laptop that would allow me to do programming, wherever and whenever.

Success wise, portability worked out as expected. But I will say you really have to consider when buying the Surface for that reason how often are you going to be using it in that fashion. When I actually use the device on a table, I always get the feeling that I would be better of using an actual laptop. I do however find the tablet aspects of it nice, just being able to disconnect the keyboard and have a powerful tablet for browsing the internet or playing touchscreen games is very nice.

Failure wise, I have no idea what the WiFi’s problem is half the time, it’s extremely frustrating to have to deal with it disappearing completely. I’ve tried a bunch of solutions on Google and there really isn’t any set answer to it, sometimes simple fixes will work, other times you have to wipe and restore the Surface completely. It’s without a doubt the biggest downfall of this device. The power cable is also a real nuisance to deal with as mentioned above. Another point is like every other device the battery gets worse over time and since there is no way of replacing the battery in the Surface your only solution is to buy another one.

So overall I would rate the Surface 30/42. I’m not entirely satisfied with it and I certainly will not be buying another one. I think it would be more suited to journalists or perhaps artists who would make more use of the pen.

If I could time travel and talk to myself before I bought it I would be telling myself to either buy a Lenovo or a MacBook instead.


Posted on June 11, 2016

Control Your Windows PC with an Xbox Controller

Xbox 360 Controller

Today I’m going to walk you through setting up an xbox controller to work on your computer and control the mouse / keyboard.

First your going to need an Xbox Controller that works on Windows . If you already have an Xbox controller you can just pick up one of these receivers . (Both links to Amazon, you can find on eBay cheaper).

Next you’ll need to install the drivers for the controller. You can find them on Microsoft’s website here .

Now you should be able to connect your controller to the computer and play any games using it. However you can’t use it to control the mouse yet. What we will need to do next is download JoyToKey from here . I went with the latest Beta version however you can also download the stable (v 4.6 at time of writing).

Now you can edit the configuration of what you’d like each button to do using the JoyToKey GUI.


Posted on January 25, 2012

Installing PEAR in WAMP

pear.png

So this evening I went about attempting to install PEAR on my WAMP installation, this should be as simple as opening up a command window navigating to C:/wamp/bin/php/*phpversion* and running go-pear.bat, however upon doing this I ran into the following errors:

phar “C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar” does not have a signature
PHP Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error:
invalid url or non-existent phar “phar://go-pear.phar/index.php” in C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar on line 1236
Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error:
invalid url or non-existent phar “phar://go-pear.phar/index.php” in C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar on line 1236
Press any key to continue . . .

A couple of Google searches later I got the answer needed to fix my problem, simply running this command instead:

php -d phar.require_hash=0 PEAR/go-pear.phar

A couple of questions later PEAR was successfully installed and running, so if your running into the above error you now know what to do!


Posted on December 27, 2010

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 hear it spinning around the place) so the virus has no chance to load since Windows never gets booted.

On top of that Linux systems are not vulnerable to Windows virus’s so you can be sure your not infecting your external hard drive as well.


Posted on October 30, 2010