Friday, February 19, 2010

MySQL backup script on windows cmd

Just needed to create a windows backup script so thought I would share my findings:

You can download the (1816k) if you're ready to use it or just view the script, otherwise proceed to the explanation.

Dependencies: don't forget you will need mysql.exe and mysqldump.exe which can be obtained from the mysql website and are also provided in the zipped file download link above.

First we use @echo off to hide the commands executed and only display the text after the "echo" command.
Next, I display a message to deter the user from closing the window (since this stops the script) because I need it in my case - it pops up from the scheduled tasks and might be used at the time so it must be clear to the user to not get closed - but you can change this how ever needed, even no output text is possible by avoiding all the echo commands in the script provided.

Now to the meat of the script, the mysql commands;
mysqldump syntax is
mysqldump -uusername -ppassword databasename > backupfile

mysql syntax is
mysql -uusername2 -ppassword2 databasename2 < backupfile Using the %date:~7,2%-%date:~4,2%-%date:~10,4% command will produce a day-month-year to help distinguish the backups (i.e. backup19-02-2010.sql as formatted in the script). Finally, schedule a task on the machine that will be doing this by going to control panel > scheduled tasks > right click > new > name it and go to properties, find the script location and set the schedule.

This will effectively place a backup on the system the script is in, and upload to the server of (example shown above), you may of course add as many servers to upload the backups to, simply repeat the line with mysql and change the settings as needed, you can also add the "pause" command if you wish to wait until user interaction to continue the script.

Let me know what you think!
Comment below or email

UPDATE: decided to put my project publicly here: feel free to contribute or download and use!

Sunday, February 14, 2010

If it ain't broke, take [Netgear RP614v2 wired router] apart and fix it.

This old but very stable router is wired, and full of cool features for it's price (I got it as a gift for fixing a friend's computer :)

• Processor: 166 MHz, ARM9
• Memory: 1 MB Flash, 8 MB DRAM
• Network Interface: - LAN: IEEE 802.3i (10BASE-T) Ethernet or IEEE 802.3u (100BASE-TX) Fast Ethernet (auto-sensing), RJ-45 -WAN: IEEE 802.3i (10BASE-T) Ethernet or IEEE 802.3u (100BASE-TX) Fast Ethernet (auto-sensing), RJ-45
• Functions: - Smart Wizard automatically detects ISP type
(static, dynamic, PPPoE), Port Range Forwarding, Exposed Host (DMZ), DNS Proxy, MAC Address Cloning, URL Content Filtering, E-mail Alerts
• Security Features: - Firewall: Stateful Packet Inspection, DoS Attacks
Detection Logging, Dropped Packet Log, Security Event Log, E-mail Log - VPN Functionality: NAT traversal (VPN passthrough) for IPSec, PPTP, and L2TP VPNs - Mode of Operation: Network Address Translation, static routing [source] (alternate)

It was very simple to take apart, and after putting it back together it still works!

inside a netgear router from smokin robocop on Vimeo.
So as the title says; it wasn't broke but I took it apart and fixed it!

Next post I will be taking you through the upgrade to the new firmware found here and then to a custom firmware - amazingly the source for this router is provided here

anyone interested in improving the router firmware is more then welcome to!

Also recently have upgraded the WRT54G ver.6 which is very low on memory.

Tuesday, February 9, 2010

fastest speed test

Found an old pic of a very fast download/upload speed!

(original image)

Monday, February 8, 2010

how to move torrent files

I've always wondered how to move a torrent file, the actually final downloaded file that is, not the torrent file (Or magnet link) which helped download.

The main reason to do is, well, to avoid clutter. If I have music, videos, ebooks, software and the list goes on - all of this in the same folder called Downloads... well you can see how this could be a problem.

And most operating systems provide a video, music and document folders already so to make full use of these (My videos, My music in Windows XP) or others how do we move the torrent-downloaded files without removing it from the torrent application or causing a file missing type error?

simple in utorrent:
1. Stop the download/seed. Press the red square or right click stop.

2. Move the file/folders as needed in the directory.
I like to use the "drag and drop" feature of windows.

3. Right click the torrent in uTorrent > Advanced > Set Download Location...

4. Browse to the new location... and Save

5. Click No to the question of overwriting (otherwise it will start new download again)

6. Rick click and choose "Force Re-check" in order to verify the files and hashes.

You can now resume the download or just continue seeding if it's done :)

Happy sharing everyone!