Networking | Linux | Windows | Server 2003
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)
Wednesday, October 19, 2011
Script for IP Change Alert
At first a sendemail needs to be installed using : sudo apt-get install sendmail (in Debian based Distros)
Else you may use another MTAs too like sendmail or postfix that is available.
#!/usr/bin/perl -w
#Anwesh Tiwari Oct 12 2011
use strict;
my $today=`date +%Y-%m-%d" "%r`;
#location of TEMP file
my $ip_last_check_file = "/home/tmp/IP-Address";
my $ip_now = `curl -s http://checkip.dyndns.org`;
$ip_now =~ s/.*?(\d+\.\d+\.\d+\.\d+).*/$1/s;
open(IP, "<$ip_last_check_file") or die "Cannot open $ip_last_check_file: $!";
my $ip_last_check = <IP>;0
close(IP);
if ($ip_now ne $ip_last_check)
{
open(IP, ">$ip_last_check_file") or die "Cannot open $ip_last_check: $!";
print IP $ip_now;
close(IP);
#-s "SMTP address of your SMTP server instead" of "-s localhost" if you dont have ipaddress running.
my $output = `sendemail -f sentname\@yourdomain.com -t alertaddress\@yourdomain.com -s localhost -u IP-CHANGE-ALERT -m Gateway IP-address has changed to $ip_now.\\\\n Event Time :$today`;
}
exit;
Wednesday, September 28, 2011
Pending restart operation SQL server installation
But every time you restart computer and try to execute the setup of SQL Server 2008, you get the same message
Then you have change a registry entry in computer
- Open Regedit
- Find the key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager"
- Rename the "PendingFileRenameOperations" value to "PendingFileRenameOperations2"
- Try again
Friday, September 16, 2011
vsftpd virtual users
Installing vsftpd using text file for virtual users
vsftpd is a secure, fast and stable FTP server. In this tutorial we'll install the server and make it check in a flat text file for virtual users allowed to login.
1. Install required packages
sudo apt-get install vsftpd libpam-pwdfile
2. Configure vsftpd (sudo pico /etc/vsftpd.conf)
Edit these variables in the config file and leave everything else with the default value.
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
chroot_local_user=YES
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=$USER
local_root=/var/www/$USER
hide_ids=YES
Set the local_root to the parent directory where the user's home directories are located
3. Configure PAM to check the passwd file for users (sudo pico /etc/pam.d/vsftpd)
auth required pam_pwdfile.so pwdfile /etc/ftpd.passwd
account required pam_permit.so
Make sure you remove everything else from the file
4. Create the passwd file containing the users
sudo htpasswd -c /etc/ftpd.passwd user1
You can later add additional users to the file like this:
sudo htpasswd /etc/ftpd.passwd user2
5. Restart vsftpd
sudo /etc/init.d/vsftpd restart
6. Create user's home directory since vsftpd doesn't do it automatically
sudo mkdir /var/www/user1
7.Create Appropriate Permissions for that folder for user ftp for uploadschown 775 ftp:ftp /var/www/user1
Tuesday, September 13, 2011
Change Virtualbox UUID of Virtual Disk Vdi

In this case, you have to do the following:
giannis@giannis-laptop:~$ VBoxManage internalcommands setvdiuuid /path/to/virtualdisk.vdi
VirtualBox Command Line Management Interface Version 2.2.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
UUID changed to: 9e89fe14-d010-469e-a737-cd65218c4acbSince the old UUID is replaced with a new one, you can now add and use the virtual disk.
Please note, that you wouldn't have to follow this procedure if you had used the clonevdi function to copy the virtual disk image, in the first place. The clonevdi function makes sure that the new disk image will have its own unique UUID.
The syntax of the clonedvi goes like this:
$ VBoxManage clonevdi Master.vdi Clone.vdi
Source: http://www.giannistsakiris.com/index.php/2009/05/06/virtualbox-how-to-change-the-uuid-of-virtual-disk-vdi/
Rescue locked SQL Server 2008
Reset Forgotten Sa password
To configure startup options
- Fist Login computer using administrator Account
-
In SQL Server Configuration Manager, click SQL Server Services.
In the right pane, right-click SQL Server (<instance_name>), and then click Properties.
On the Advanced tab, in the Startup Parameters box, type the parameters separated by semicolons (;).
For example, to start in single-user mode, insert -m; in front of the existing startup options, and then restart the database. (When you start SQL Server in single-user mode, first stop SQL Server Agent. Otherwise, SQL Server Agent might connect first and prevent you from connecting as a second user.)
ImportantAfter you are finished using single-user mode, you must remove the -m; from the Startup Parameters box before you can restart the server instance in the normal multi-user mode.
Click OK.
Restart the Database Engine.
Change security authentication mode (You may not require this step if you have already enabled sa user)
In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
On the Security page, under Server authentication, select the new server authentication mode, and then click OK.
In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
- You can change password here.
- Enable the sa login by using Management Studio(You may not require this step if you have already enabled dual authentication )
In Object Explorer, expand Security, expand Logins, right-click sa, and then click Properties.
On the General page, you might have to create and confirm a password for the sa login.
On the Status page, in the Login section, click Enabled, and then click OK.
- Now you can logon with sa user and password .You can also set permission of the local user account from that.

