Monthly Archives: February 2011

Backup MySQL Windows Server

There is a few different ways you can backup your database on a Windows system. I normally use a script that just takes the database and dump it out to a file.

Here is a really simple example but it does it’s job. Go to a folder and create a new file called backup.bat and open it with a text editor. And enter the following syntax.

The first line here tells the script to login as the user root with the password PASSWORD and it should use the database zoogen if you want all databases to be backed up you can add the –all-databases instead of just zoogen. And the > tells where should the script save the database dump to. Here it will be saved to e:\backup\ and all files will be called zoogen-<todays date>.

The next row uses the function called forfiles. It looks in E:\backup and match every file that has zoogen-<something>.<something> and checks if the file is older then 7 days. If it’s older then 7 days it will remove the old files. This is done to prevent having 1000 different backups that you never will use.

Now we need to schedule the script. Open Task Scheduler and create a basic task. Name the new schedule and add a description. Now select how often the schedule should run. I recommend running the backup once a day.  When you have selected the time the scrip will run select that the scheduled task should run a program. Now select the bat script we just created.

Before you click finish select Open the properties dialog for this task when I click Finish and change the security options from Run only when user is logged on to Run whether user is logged or not.

Now everything should be done and your backup will run at the time you specified.

Google Chrome 9 mouse pointer disappear

I just downloaded the new Chrome 9 for Windows because i decided to give it a try. The browser itself is damn fast and works really well. But i have noticed that the mouse pointer disappears from the browser from time to time.  After some research i noticed that it’s the flash plugin that is the cause of this.

If you hit shift + esc in Chrome you bring up the Chrome tasks and if you end the Flash process your mouse will not disappear. I don’t really know if this fix did solve the problem but my mouse does not disappear anymore.

First download flashplayer-win.xpi from Adobe or just download it from here and use WinRAR to extract the files. Now go into the folder and copy the files flashplayer.xpt and NPSWF32.dll and place them in your Chrome folder. It should be in

C:\users\<user>\AppData\Local\Google\Chrome\Application\Plugins\ (note you might have to create the folder Plugins).

After this is done just restart your browser. Like i mention before i am not quite sure if this really works for everyone but it did work for me. And i am using Windows 7 64Bit with Google Chrome 9.

Note. You might have to remove the old flash plugin. If you type about:plugins in your browser you can see the flash path. Just click on details and then browse to the file and remove it for flash. Restart your browser and now it should work. At the moment i am using an old flash because of this damn bug that annoys the hell out of me.

Ubuntu Linux: NFS Client configuration to Mount NFS-share

This small howto tells you how you can mount a nfs-share to your Ubuntu system. NFS is the *NIX counterpart to common Windows share like samba. It is really easy to setup and works really good. This guide will only be about how you can mount a share and it does not touch anything on how you share a folder.

Step 1 – Install NFS-common

We have to install the package called nfs-common before we can mount a nfs-share. This is done by using apt-get.

Step 2 – List available shares

If you don’t know the name of the share you want to mount you can list all shares by using the following command.

The output should look something like this.

Step 3 – Mount the volume

Now when we know the name of the share we want to mount we can mount it by using following command.

Now the share Download is mounted to /nfs.

QNAP vmware iSCSI SAN

When you are using a vmware product you kinda need to have a SAN-storage to get all the awesome features like HA, vMotion etc. A normal SAN-storage is kinda expensive but you can use QNAP’s products. They are not that expensive and a loaded with cool features.

Step 1 – Setting up iSCSI for QNAP devices

First we need to turn off enable write cache (For EXT4). You can find this settings in System Administration -> Hardware.

Go to the administration page for your QNAP device. Under Disk management you will find iSCSI. First activate iSCSI by check the box “Enable iSCSI Target Service” and use the normal port.

Next step is go to the tab “Target Management” click on “Quick configuration wizard” I have chosen to use the guide that creates the iSCSI target with a mapped LUN to make it as easy as possible.

Just hit next here.

Now we are naming the profile and the alias. I just used zoogen in both fields.

This is an optional field. I have chosen not to use an authentication but i recommend you use it.

Here we are creating the LUN, i am using my raid1 storage and allocation 50GB space and i am calling it zoogen. You might notice that i used Thin-Provisioning. This means that the LUN will expand from 1Mb to 50Gb. It does not create a 50Gb dedicated space.

Go over the settings and see if they look okey, Then hit next and it will be created.

Now it’s finished. Lets go to step 2 – configuring vmware.

Step 2 – Configuring vmware for iSCSI

Open your vSphere and connect to your esxi machin. Go to configuration and storage adapters.

Click on properties that down right like the picture shows.

Go to the tab Dynamic Discovery and click on add. Now enter the IP-number to your QNAP device. If you changed the default port before you need to change it here also. If you enabled CHAP authentication click on that button and enter your credentials.

If everything is correct now you should se your iSCSI/LUN that you created before. My LUN does not show up because i did’nt hit refresh (i had some old LUN’s from before). Remember that if you add a new iSCSI you need to right click on vmhba34 (the iSCSI software adapter) and hit refresh to get them to show up sometimes.

Now go to hardware -> storage and click on add storage.

Now we select the Disk/LUN and hit next.

Your iSCSI should show up here automatic. Just select it and hit next.

Enter the name on your new storage.

I am not really sure what the perfect setup here is. I just used the selected one.

Hit finish and now the new storage is ready for use.

Now you can create a new virtual machine and select the iSCSI storage you just created to save the operatingsystem on that disk. Or if you just want like a d:\ to be SAN that can be done also.