DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
SET @path = 'C:\Backup\'
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb')
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + @name + '_' + @fileDate + '.BAK'
BACKUP DATABASE @name TO DISK = @fileName
FETCH NEXT FROM db_cursor INTO @name
END
CLOSE db_cursor
DEALLOCATE db_cursor
adapted from
Blog Archive
-
▼
2010
(79)
-
►
June
(11)
- Protect Web Directories using .htacess
- eth0_rename in ethernet card
- Reset windows password using linux live CD
- IPP printer configuration in windows
- Reinstall WIndows Fax and Picture viewer
- Stream audio in Bluetooth Headset using Dongle
- Convert image files to text
- Configuring exim4 in Ubuntu to use GMail for SMTP
- Change apache2 web directory
- Checking webserver vulnerabilities
-
►
June
(11)
Thursday, December 30, 2010
backup all databases MSSQL
Tuesday, December 21, 2010
Multiple Instances Users in google talk
If you have several google talk accounts, you may want to run multiple instances of google talk at once. Here's how to do it.
Many users, including myself, like to have several different personalities on IM–Work, play, etc. By default google talk with only allow you to run instance of the program at a time. Here's how to get around that…
Run google talk with the following switch: /nomutex
If you installed google talk to the default location, you can easily create a shortcut to this setting.
- 1. Right-click on the desktop
2. Select New
3. Select Shortcut
4. Paste this into the text box:
"c:\program files\google\google talk\googletalk.exe" /nomutex5. Click Next6. Name it whatever: Google Talk Multiple, etc.
7. Click OK until you are done.
For Geeks : you can change the googletalk.exe using suitable tools like hexeditor and do this
Change this:
004536FD . 3BC6 CMP EAX,ESI
004536FF . 75 05 JNZ SHORT googleta.00453706
to this:
004536FD . 8BC1 MOV EAX,ECX
004536FF . EB 05 JMP SHORT googleta.00453706
Please inform me if it isn't legal
Sunday, December 19, 2010
resize clone vdi image using Virtual box
Resize An Existing .vdi Virtualbox Image
Start off by creating a fresh new drive of the size you're after using the VirtualBox user interface. Then, locate both the your old, smaller HD and the new, larger one and run the following command:
VBoxManage clonehd --existing oldhd.vdi newhd.vdi
After some progress indicators ahve come and gone your HD should have been cloned to the larger one. You now need to use some software to expand your drive partition into the new space. Vista and W7 have this feature built in to Disk Management, or you could use something like GParted. I have never had luck with the integrated windows disk management tools, so I opted to use a free product called EASEUS PARTITION MASTER – home edition:

This tool was easy to install directly into the new vdi image. Walked through the wizard after clicking on "Resize" – it rebooted itself and resized the partition without a fuss.
Thursday, December 9, 2010
force SVN comit log
Forcing SVN Comments with TortoiseSVN
But as a developer you can force yourself to always comment before committing, as well. This one is particulary to do with TortoiseSVN as thats what I currently use at work.
The way it works is, once you have checked out a folder from the repository onto your local machine, you need to go to TortoiseSVN properties and add an inbuilt property to one or all your files. You can setup a property on one or more files so that it wont let you commit unless you write a minimum number of characters as my commit comments. The property is called tsvn:logminsize and it comes along with a set of other inbuilt properties. Simply right click anywhere in the checked out folder and go to TortoiseSVN Properties and add the property called tsvn:logminsize and give it a value of whatever you want. I gave it 10 (screenshot below).

I added the property recursively so it applies to all my files. Once thats done, it wont even enable the "OK" button on the commit dialog box until you enter atleast 10 characters. Just a little reminder to myself that commenting is absolutely necessary.
I didnt realize this was possible until today and I am really liking it.

