Don’t forget your commands


In today’s dont forget your commands section or DFYC for short,

To login on mysql server,
>mysql -u username -p (hit enter) and then the password prompt is shown.
To create a database obviously,
> create database xxxxx;
To create a user,
> create user username identified by “password”;
To grant this user privs on a db
> grant all privileges on db.* to [email protected];
Dont forget to flush privileges
> flush privileges;

How big is a snapshot by default?


So, I have been in the dark. (I attached a random pic not really of a snapshot :D)

I was under the impression that the snapshot in vmware – when a snapshot a snapshot is created will only be a few megabytes. Well I was wrong!
When a snapshot is created – the .vmsn which is the snapshot state file and stores the running state of the virtual machine – aka its RAM. So this will be = to the size of the RAM that is set for the virtual machine.
So if a virtual machine is with 16GB of RAM – then the .vmsn file which is created in a snapshot will be of that size 16GB!
Needless to say , the snapshot file which is the <vname>-Snapshot<###>.vmsn grows with the snapshot.

Python and Me – How to create a simple function?

I have always been into programming but never had been full time in it. Now I will admit I did get super close to getting hired as a jr. java programmer but that never happened!

While I have no regrets I am learning python now – not because I have to – but because I want to! Being able to write some code has always sounded cool to me and so here goes.

I am learning py (short for python here after) from a bunch of resources ranging from a pdf to codeacademy online. This is my first blog so I will kick this off with how to define a basic function in py(atleast what I have learnt so far).

So in py, you will declare a function with the DEF key word. Below is an example.
def myfirstfunction():
              print “this is my first function”
Well as you can see fairly simple, but wait – not so fast champ. So in py unlike in other languages, you don’t close a function. It sort of closes itself with the space thats left below the print. Py is a very space conscious language so watch out for those careless tabs and spaces that you may have in your program. Any weird spacing will throw a “IndentationError: expected an indented block”. So remember the statements start with atleast a space in py function and the function closes with a empty line after the last statement.
How do you call it? Well thats easy, just run myfirstfunction() and it will print – this is my first function.
Also remember you cannot start the function name with a number or special character.
Hit back if you have any questions.

Welcome to rjapproves!

Hello there!

 

Thanks for stopping by, I will get started on posting stuff soon!

 

RJ