Thursday, 20 December 2012

How to find or list ruby gems available from remote source

Wondering what gems are available for you to get, or need to find one, or think you have the name incorrect?

Lets say you are not sure what the correct name for the sqlite gem is.. all you need to do is type the following in your terminal:

gem search --remote sqli

press enter

and the terminal will list all gems containing the letters "sqli" in them.. (it will act as if it had a wildcard at each end of the string *sqli*)


Sunday, 2 December 2012

show tree view explorer in sublime text

it is an easy one, but almost impossible to find if you dont know..

to get a tree explorer in sublime, all you need to do, is drag whatever dir you want to appear in the explorer straight in to the sublime editor window.. that is it!

Tuesday, 4 September 2012

django syncdb mysql access denied for user

you are new to django, you thought you had setup everything, but when you run syncdb for the first time you get access denied for the user you created..

running the following command should fix the problem:

grant all on databasename.* to 'username'@'domain';

flush privileges;

Monday, 3 September 2012

django mysql no module named mysqldb (ubuntu)

if you receive this error, it is likely that you need to run this command:

apt-get install python-mysqldb

Wednesday, 1 August 2012

How to create a MySQL Database from the Command Line

If you ever need to create a database from the command line.. here is how to do it:

(as an aside, a nice quick list of commands is available here)

First login to mysql as root:

mysql -u root -p

MySql will promt you for a password.. Enter it now.

Now simply type:

CREATE DATABASE databasename;

Now create a user for this newly created database:

GRANT ALL ON databasename.* TO 'username'@'localhost';

set the password for this user

UPDATE mysql.user SET password=PASSWORD('password') WHERE user='username';

now to activate the permissions..


all done..

Friday, 6 July 2012

Restore a psw iTunes windows

Really, all you need to know here is, on the main iPhone screen in iTunes, hold ctrl+alt then click restore.

This gives you the chance to select the psw that you want to restore from.

Key things to remember to do before you restore:

All these are under the context menu you receive from right clicking your phone name in the devices tree in iTunes.

Transfer your purchases

Sync your phone

Backup your phone

Tuesday, 6 March 2012

Extract DMG Windows

Theres few programs that do this, some install spyware, other you have to pay for.. Here is how to do it for free, and without having to install anything.

Download the latest version of DMG2IMG from here:

Extract the downloaded zip file.

To make it easier for people that do not know how to use the command line, drop the download DMG file in to the directory that you just extracted.

Now, open the console (start->run_cmd)

if the path where you extracted the DMG2IMG download was c:\users\yourname\downloads\dmg2img

then in the console, type cd c:\users\yourname\downloads\dmg2img

now type dmg2img yourdmgname.dmg anynameforoutput.img

preess enter, and you are done. now extract the img using 7zip, and you have your psw.