Share on FacebookI’m running a Macedonian e-date site (www.ergeni.com.mk) as a small project just for fun and it’s running on Ubuntu Machine. I need backup offcourse and found a nice script. I’m not the author of this script and i’m not interested in taking credit for it. It works fine and is fast. Just edit the variables and run the script.
#!/bin/sh
# System + MySQL backup script
# Full backup day - Sun (rest of the day do incremental backup)
# Copyright (c) 2005-2006 nixCraft <http://www.cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# Automatically generated by http://bash.cyberciti.biz/backup/wizard-ftp-script.php
# ---------------------------------------------------------------------
### System Setup ###
DIRS="/home /etc /var/www"
BACKUP=/tmp/backup.$$
NOW=$(date +"%y-%m-%d")
INCFILE="/root/tar-inc-backup.dat"
DAY=$(date +"%a")
FULLBACKUP="Sun"
### MySQL Setup ###
MUSER="mysql-user"
MPASS="mysql-password"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
GZIP="$(which gzip)"
### FTP server Setup ###
FTPD="/ergeni"
FTPU="ftp-username"
FTPP="ftp-password"
FTPS="ftp-hostname"
NCFTP="$(which ncftpput)"
### Other stuff ###
EMAILID="nisse@nissesblog.se"
### Start Backup for file system ###
[ ! -d $BACKUP ] && mkdir -p $BACKUP || :
### See if we want to make a full backup ###
if [ "$DAY" == "$FULLBACKUP" ]; then
FTPD="/home/vivek/full"
FILE="fs-full-$NOW.tar.gz"
tar -zcvf $BACKUP/$FILE $DIRS
else
i=$(date +"%Hh%Mm%Ss")
FILE="fs-i-$NOW-$i.tar.gz"
tar -g $INCFILE -zcvf $BACKUP/$FILE $DIRS
fi
### Start MySQL Backup ###
# Get all databases name
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
FILE=$BACKUP/mysql-$db.$NOW-$(date +"%T").gz
$MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done
### Dump backup using FTP ###
#Start FTP backup using ncftp
ncftp -u"$FTPU" -p"$FTPP" $FTPS<<EOF
mkdir $FTPD
mkdir $FTPD/$NOW
cd $FTPD/$NOW
lcd $BACKUP
mput *
quit
EOF
### Find out if ftp backup failed or not ###
if [ "$?" == "0" ]; then
rm -f $BACKUP/*
else
T=/tmp/backup.fail
echo "Date: $(date)">$T
echo "Hostname: $(hostname)" >>$T
echo "Backup failed" >>$T
mail -s "BACKUP FAILED" "$EMAILID" <$T
rm -f $T
fi
Then you need to add this job to crontab. Run the following command.
crontab –e
Add a new line to run the file at midnight.
@midnight /path/to/script.sh >/dev/null 2>&1
And there you go, a fully working backup system. To restor all you need to do is to extract the files from the ftp server to the same location.
Download the document below and edit.
backup-job.txt (1,97 kb)
3fb40167-ebb9-423d-8029-e167063f87a9|0|.0
Share on FacebookFor troubbleshooting it could come in handy to send an e-mail with telnet. It's easy as pie.
Start with running telnet and connecting to a smtp-server.
telnet smtp.microsoft.com 25
Then you get some text back "220 ESMTP". You need to present yourself to the server. You need to give the server the domain of the email adress you are using as a sender.
HELO nissesblog.se
Start typing your from email
MAIL FROM:nisse@nissesblog.se
then the recipient.
RCPT TO:bill.gates@microsoft.com
Now we need to add som text to the message. you can also add a subject.
DATA
Hey Bill, could I have some of your money?
.
// note the single dot, it's needed to tell the server that this is the end of the message
Then all you need to do is to leave with:
QUIT
659010b4-a010-47d0-947d-057168b673a7|0|.0
Share on FacebookWhen you click the application you wish to uninstall in Add/remove programs under control panel you need to reset the folder views in vista. Follow these steps.
- Open RegEdit
- Browse to HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\
- Remove Bags registry key
- Remove BagMRU registry key
- Close RegEdit
- Log off, restart
- Login and go to folder options, make sure remember each folder's view settings
- Restart computer.
This 8 steps is quite simple. I found the solution on this blog.
1d1ba20e-121c-41ae-9b8c-d218e0e9bc4c|0|.0
Share on FacebookI'm developing an inventory software and I was using a listview component. But I do need to be able to change the sorting. Microsft have whitepaper on how to do this. Started reading and then gave up. Did a google search and found ObjectListView. Love at first sight!
This DLL-package is what I was looking for and it's a really nice application. NOTE: This is an open source and is licensed under GPL
Since the getting started guide on their homepage is awsome i'll just link to that page. Get it on!
b335e325-ee9d-4bf2-97c0-a9518fb5484c|0|.0
Share on FacebookI've upgraded my blog to BlogEngine 1.5.0.7 and then I got a Java Error saing BlogEngine is not defined. The solution is the following.
Download the latest version from codeplex.
Extract blog.js and open it in your favorite editor and look at the code.
// global object
BlogEngine = {
$: function(id) {
return document.getElementById(id);
}
The first row is to be deleted, so the start of the file will look like this.
BlogEngine = {
$: function(id) {
return document.getElementById(id);
}
Upload the file and restart your .NET application. Edit your Web.Config to get the server to recompile the site.
Technorati-taggar:
BlogEngine,
Java
04356a84-f2d8-46f1-a23d-f04d91c086de|0|.0
Share on FacebookI'm installing a new database server and the application is using the 32bit ODBC-connections and the server is a 64-bit SQL. To configure 32-bit ODBC connections hit run and paste the following command.
%windir%\SysWOW64\odbcad32.exe
1fa08dd2-a610-4496-861a-c474c2f431f3|0|.0
Share on FacebookI'm developing a site for a customer who wish to have a map of his stores and a marker as well. Googles new v3 API of google map is what i'm using since it's newer and hade a nice look and feel than v2.
In my application i'm reading the coordinates from a database but for this example we will use static. Paste the following code in your <HEAD> secion.
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var myLatlng = new google.maps.LatLng(<? echo $clsShop->LatLong;?>);
var myOptions = {
zoom: 13,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:"Hello World!"
});
}
</script>
In your <BODY> tag we will load the map with the onLoad command and unload it when we leave. Use the following tag.
<body onload="initialize()" onunload="GUnload()">
Then all you need to do is to create a <div> with id = map_canvas where you wish to place the map. You can use the following example.
<div id="map_canvas" style="width: 220px; height: 220px"></div>
Then you're all set and google maps will load. If not you might need sign up for the google API. For more examples you can check out googles own example gallery
6841a5a7-884b-47dc-8e47-f64b893bc0e0|0|.0
Share on FacebookI've canceled my installation of Visual Studio 2008 and when I now try to install it again I get an error and can't continue. Can't unistall either so I found a tool supplied by Microsoft. It will remove all the components so that I can run the installation again.
Microsoft Visual Studio 2008 RC/RTM uninstall tool
2abd7105-a039-4604-9bfe-2dae1139cd52|0|.0
Share on FacebookIf you need to change your KEY for Windows 2008 server there is a nice way to do this.
1. Open the command prompt and change working directory to System32 directory
2. Type in slmgr.vbs -ckms (this clears and KMS entry you may have)
3. Type slmgr.vbs -upk (this removes any product key installed)
4. Type slmgr.vbs -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx (where the x's is the new product key you want to use )
5. Type slmgr.vbs -ato (this activates the server)
To do the same thing in Windows 2003 server follow these instructions.
Click Start, and then click Run.
In the Open box, type Regedit, and then click OK.
In the left pane, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents
In the right pane, right-click OOBETimer, and then click Modify.
Change at least one digit of this value to deactivate Windows.
Click Start, and then click Run.
In the Open box, type the following command, and then click OK.
%systemroot%\system32\oobe\msoobe.exe /a
- Click Yes, I want to telephone a customer service representative to activate Windows, and then click Next.
- Click Change Product key.
- Type the new product key in the New key boxes, and then click Update. If you are returned to the previous window, click Remind me later, and then restart the computer.
- Repeat steps 6 and 7 to verify that Windows is activated. You receive the following message:Windows is already activated. Click OK to exit.
- Click OK.
- Install SP1 for Windows XP.
If you cannot restart Windows after you install SP1, press F8 when you restart the computer, select Last Known Good Configuration, and then repeat this procedure.
76fa6756-0077-45c6-975f-d3e5f3b7a88e|0|.0
Share on FacebookI've just installed Spotify on my Nokia E75 and I like it. Been waiting a while for the Symbian version but now it's here. I listen to spotify every day on my computer so this is a nice application.
Go get it here http://www.spotify.com/en/mobile/symbian/
EDIT: After about 3hrs of use I feel that i would like to be able to change tracks with the hands free. I'm just able to adjust the volume.
b34ca86c-1e84-4b6f-ba87-a64a4920a5b2|0|.0