Friday, 12 September 2014

Eclipse forgets my proxy credentials

This usually happens when you are using a different eclipse installation to access your old eclipse workspace. Its something to do with the new installation not being able to access the secure storage created by your old installation. Here's what I did to solve it:

Close eclipse completely. Now fire up terminal or command prompt or whatever and navigate to your home directory. In my case it is '/Users/manthan/' directory.

Now cd into .eclipse/org.eclipse.equinox.security directory.
cd .eclipse/org.eclipse.equinox.security


If you list files, you should see a file called secure_storage in it. Rename that to secure_storage.old or something like that. You can delete it if you want but I prefer to rename things, make sure it works and then delete the renamed file.

mv secure_storage secure_storage.old

Now making sure that the secure_storage file has been renamed successfully, open eclipse and now try saving your credentials. It should ask for your key store master password and other stuff. 

That's it! You're done.

Saturday, 6 September 2014

Moving steam games to another drive

So I came across this recently and thought to share it with you guys.

First of all, exit steam completely. If you've closed it, check if it's in the system tray and if it is, exit from there as well. Now, fire up Windows Explorer and go to where steam is installed on your computer. In my case, it was in the default installation directory (C:\Program Files (x86)\Steam).

Once in the folder, delete everything EXCEPT the SteamApps folder and Steam.exe. Now, go UP a directory level and move the whole Steam folder to wherever you want it to be. In my case, I moved it to E:\Games folder.

When the move is complete, double-click on the steam.exe. It'll re-download steam client for you and will require you to login to your steam account again.

So that's it. You should have all your games available to you in your new drive location!

Original source: https://support.steampowered.com/kb_article.php?ref=7418-YUBN-8129

Friday, 5 September 2014

Rejecting a pairing request from a bluetooth device permanently on your Mac

So I had this problem the other day where I kept on getting pairing requests from my friend's bluetooth keyboard. This was rather annoying as the pairing dialog kept on popping up every few minutes. So I googled around a bit and found the following solution which worked for me.

Turn your bluetooth off. This will disable your bluetooth mouse and keyboard and hence you will have to use the built-in ones.

The problem is that at some point the keyboard that is nagging you to connect would have connected to your laptop. Your laptop remembers this and hence accepts incoming pairing request prompting you to verify it.

Our aim is to make the machine forget that it was ever connected to this device. In order to do this, you will need to edit a file called com.apple.Bluetooth.plist. This file is located in /Library/Preferences and ~/Library/Preferences folder. This file is in binary so in order to be able to edit it, you will have to convert it to xml first. So, open up terminal and type:
sudo plutil -convert xml1 /Library/Preferences/com.apple.Bluetooth.plist

Now you can go on to finder or whatever you have and edit this file. Remove ... followed by ... tags which relate to the keyboard/device that you are trying to ban. Simple way is to find the name of the device in the file. This name will be in ... tags. Once you find the name, remove the whole container ... and preceding ... tags. Once you do this, save the file and convert it back to binary using the following terminal command:
sudo plutil -convert binary1 /Library/Preferences/com.apple.Bluetooth.plist

Do the same for the com.apple.Bluetooth.plist file located in ~/Library/Preferences folder as well. If that folder does not have this file, copy it over from /Library/Preferences folder.

Once you are done, turn the bluetooth on and now it shouldn't prompt you for pairing requests.

Saturday, 7 December 2013

An investigation regarding the effects of NoSQL on the four inherent problems of Software Engineering

So as you all know, I am currently in my final year of BEng (Hons) Software Engineering. In my final year, one of the courses that I am studying is Programming Frameworks. This course introduces to the academic side of Software Engineering and covers topics like quality plans, quality control, advanced methodologies, planning, frameworks etc.

My coursework for this course was to prepare a quality plan for writing an academic paper and then write the academic paper. The main topic of the academic paper was to compare and contrast one of the three concepts with an academic paper "No Silver Bullet - Essence and Accidents of Software Engineering" written by Fred Brooks. I prepared the quality plan, wrote the academic paper and submitted the coursework last month. I received a really good mark for it - 88% and thus I thought that I should share the academic paper that I wrote in LaTeX. You can download the academic paper from here.
Let me know what you think about the paper in the comments below.

Thursday, 17 October 2013

What to do when app downloads in Windows 8/8.1 store get stuck at "Pending" or "Downloading" stage?

So I had this problem today. Well to be honest, I had this problem before as well but I decided to fix it today. Earlier today, I upgraded to Windows 8.1 and I was hoping that the upgrade would resolve this problem. Well, it didn't. After surfing through the web, I found the solution. So, here it goes:

First of all, you need to be in safe mode. Open the charms bar, click on the power button, hold the shift key and while you're holding it, click "Restart". This will restart Windows in troubleshooting/recovery mode.

From the menu that has been presented to you, click "Troubleshoot". Now select "Advanced options" and from the subsequent screen click "Windows Startup settings". Finally, click "Restart" button.

Now, if you have Windows 8 installed, you will have an old command prompt styled menu from which you can select "Safe Mode with Networking" by pressing navigational arrow keys. However, if you have Windows 8.1, then you will have to press number 5 key on your keyboard to go into "Safe Mode with Networking". Once you're there, fire up command prompt. Type in:
cd %systemroot%

Then type:
ren SoftwareDistribution SoftwareDistribution.old

That's it. Restart the computer by using the charms menu. This time, don't hold down the shift key.

When Windows normally boots up, open the store, wait a few seconds and try updating/downloading apps and it should work just fine.

Friday, 27 September 2013

Changing keyboard layout in Ubuntu Server (Linux, How to)

So I recently installed Ubuntu Server in a virtual machine and I had problems with my keyboard layout. I use UK layout while the default that comes with Ubuntu Server is US layout. As you can imagine, this caused problems and I had to go hunt for a solution. Finally, I found one and here it is:

You need to reconfigure keyboard configuration. Type the following:
sudo dpkg-reconfigure keyboard-configuration

If that doesn't work, you might need to install console-data package. Install it by typing:
sudo apt-get install console-data

and then try first step again.

If everything was fine, you should see this:
Using this you can select brand of your keyboard. I am running this virtual machine on my Acer laptop and as you can see it is listed there. You can use up/down/page up/page down keys to navigate through the list. When you have picked one, press enter to go to next screen.

You should now see this:
This is the language selection screen. Navigate through the list, select your language and as you did in previous one, press enter to move on to next screen.

This is the screen where you select your keyboard type:
Assuming you're using a qwerty keyboard for PC, you should just leave the first one selected and press enter. However, if you are running this on a mac or your keyboard is of different kind, you are free to choose whatever applies to you from the list and continue by pressing enter.

The next screen allows you to map a key on your keyboard to alternate grammar key (Alt Gr).
I have never used this key in my life for alternate grammar, however, hoping that I may use it at some point, I would map it to right-alt key (which actually is Alt Gr key). As usual, select one from the list and press enter.

Next one is compose key. Same drill. Pick one and press enter:
Compose key, if I remember correctly, allows you to type ASCII for certain characters when you press and hold it. This key on windows is left alt key however, here you can choose whatever you want for ubuntu server.

When you press enter, the wizard will quit. So that was the keyboard configuration screen which allows you to configure your keyboard pretty neatly. Have fun!

Saturday, 14 September 2013

Assigning static IP address to your Raspberry Pi (WiFi)

When I first bought my Raspberry Pi, I had this problem. My router and TV are in different rooms and I don't have a ethernet cable. This restricts networking ability of my Pi which is quite annoying. I searched for articles on assigning static IP addresses to Raspberry Pi but most of them were talking about assigning it for eth0. I, on the other hand wanted wlan0 static IP.

Now, I could have just got a long ethernet cable and solve this whole problem but I was just annoyed and was constantly asking myself "Why isn't this working over wifi". So finally, after significant digging around, I found the solution. Here it goes:

First of all, take a backup of /etc/network/interfaces file:
pi@raspberrypi ~ $ sudo su -
root@raspberrypi:~# cp /etc/network/interfaces .


Now, in order to make this work, we need some information first. We need to find out the new static ip address that you want, gateway, mask, network and broadcast address. Assuming that you have a working wifi connection on your Raspberry Pi, type:
root@raspberrypi:~# ifconfig

From the output, the bit that we are interested in is:
wlan0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          inet addr:192.168.1.99  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19153 errors:0 dropped:24512 overruns:0 frame:0
          TX packets:25553 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3724822 (3.5 MiB)  TX bytes:31437802 (29.9 MiB)


The highlighted line will give you information about your current IP, broadcast and mask address. Take a note of the last two. So, in my case:
address: (this is the IP address you wish to reserve as static eg. 192.168.1.69)
mask: 255.255.255.0
broadcast: 192.168.1.255

To find out information about the last two bits, type:
root@raspberrypi:~# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0


In my case:
gateway: 192.168.1.1
network (a.k.a destination): 192.168.1.0

Now that we have all the information that we need, edit the /etc/network/interfaces file using nano. Putting all the bits and pieces together, it should look like:

Press Ctrl + O to save.
Now, since I was doing this whole process over SSH, I had to write a script to restart wifi because if I didn't, as soon as I turn it off, it would also take away my SSH access rendering me powerless. You can do the following in either case. Create a new file called restartwifi.sh using nano in root home directory:
root@raspberrypi:~# nano restartwifi.sh

Now, I am aware that this script can be improved but this is what I had before and it has worked without any problems. Press Ctrl + O to save the script. Then press Ctrl + X to exit.

Make sure you edit permissions to make the script executable. Run:
root@raspberrypi:~# chmod +x restartwifi.sh

If you're not root, you'll have to prefix above command with "sudo". 

Now comes the moment of truth. Run the script to reset your wifi by typing following command:
root@raspberrypi:~# nohup ./restartwifi.sh &

If you're in putty session, you'll immediately go offline. If you've done everything correctly, you should be able to ssh into your Pi, after couple of minutes, on your chosen IP address.