Latest Event Updates

Configure MTS Mblaze in Ubuntu

Posted on

To Configure MTS Mblaze in ubuntu :

Install the following packages :
usb-modeswitch
usb-modeswitch-data
wvdial

Edit /etc/wvdial.conf

[Dialer mts]
Stupid Mode = 1
Inherits = Modem0
Password = mts
Username = internet@internet.mtsindia.in
Phone = #777
[Modem0]
Init1 = ATZ
SetVolume = 0
Modem = /dev/ttyUSB0
Baud = 115200
FlowControl = Hardware (CRTSCTS)
Dial Command = ATDT

To connect :

sudo wvdial mts

To Disconnect :

ctrl+c

 

Enjoy :)

Check the Downloading and Uploading speed of your Linux machine

Posted on

1. Download the script :

wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py

2. Make it executable :

chmod u+x speedtest-cli

3. Run the script:

./speedtest-cli

Output will give you the uploading and downloading speed.

 

Enjoy :)

Extra Password protection for wordpress

Posted on

In cPanel, there is an option to lock the folders with a password. In normal case, it wont work with WordPress. In my case, below steps worked fine.

1. Add password authentication for the folder with wordpress files from cPanel
2. Create the user and password

3. Add following lines to the .htaccess file in the wordpress root directory

ErrorDocument 401 ./error.html
ErrorDocument 403 ./error.html

 

4. Final .htaccess will look as below:

#next two lines allow password protected directories with 404 errors
ErrorDocument 401 ./error.html
ErrorDocument 403 ./error.html
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dev/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dev/index.php [L]
</IfModule>

# END WordPress
#– Following lines are added for password authentication in the site
AuthUserFile “/home/user_name/.htpasswds/public_html/sub_domain/passwd”
AuthName “dev”
AuthType Basic
require valid-user

 

 

Enjoy :)

Rename a host in BackupPC

Posted on

Follow the below steps to rename a host in BackupPC.
1. Stop BackupPC service :

service backuppc stop

2. Login to the configuration folder

cd /etc/BackupPC

2. Change the host file to the corresponding one :

vi hosts

*change old_host to new_host*

3. Rename the pl file in pc folder :

cd pc

mv old_host.pl new_host.pl

4. Make the changes in the backup location (I assume your backup is storing in the location /backup):

cd /backup/filesystem/pc/

mv old_host new_host

5.Start Backuppc service:

service backuppc start

6. Login to the backuppc console and make sure that the changes are replicated there.

 

Enjoy :)

Bash script to take Mysqldump hourly and daily

Posted on Updated on

Create a script as below and make it executable:

#!/bin/bash
Now_hourly=$(date +%d-%b-%H_%M)
Now_daily=$(date +%d-%b-daily)
if [ "$1" == "hourly" ]; then
/usr/bin/mysqldump –all-databases | gzip -c | cat > /Backup_location/mysql_dump_all$Now_hourly.sql.gz
elif [ "$1" == "daily" ]; then
/usr/bin/mysqldump –all-databases | gzip -c | cat > /Backup_location/mysql_dump_all$Now_daily.sql.gz
else
echo “Error. Enter hourly or daily”;
fi

Now add the script in crontab for the hours it should run.

15,30 1,3 * * * script_name hourly
10,20 2,4 * * * script_name daily

Hourly backup will run at 01:15,01:30,03:15 and 03:30

Daily backup will run at 02:10,02:20,04:10 and 04:20 (since name would be same, it will replace each daily backup before)

Install and configure Chkrootkit and Rkhunter

Posted on Updated on

Install Chkrootkit

cd /usr/local/src
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
tar xvzf chkrootkit.tar.gz
cd chkrootkit*
make sense
./chkrootkit

touch /etc/cron.daily/chkrootkit.sh
chmod 700 /etc/cron.daily/chkrootkit.sh
Add the below to /etc/cron.daily/chkrootkit.sh

#!/bin/sh
(
/usr/local/src/chkrootkit-0.49/chkrootkit
) | /bin/mail -s “CHROOTKIT Daily Run (server_name)” email_address

Installing Rkhunter
cd /usr/local/src

Download :
wget http://ncu.dl.sourceforge.net/project/rkhunter/rkhunter/1.4.0/rkhunter-1.4.0.tar.gz

Install :
tar -xvf rkhunter-1.4.0.tar.gz
cd rkhunter-1.4.0
./installer.sh –layout default –install

Updating :

/usr/local/bin/rkhunter –update
/usr/local/bin/rkhunter –propupd

Create a script to send the scan result :

touch /etc/cron.daily/rkhunter.sh

chmod 500 /etc/cron.daily/rkhunter.sh

Add the below contents:

#!/bin/sh
(
/usr/local/bin/rkhunter –versioncheck
/usr/local/bin/rkhunter –update
/usr/local/bin/rkhunter –cronjob –report-warnings-only
) | /bin/mail -s ‘rkhunter Daily Run (server_name)’ email_address

To scan :

rkhunter –check

Enjoy :)

rkhunter --check

Check the type of VPS

Posted on

ls  /proc/user_beancounters
If it exists, it’s an OpenVZ VPS.

ls /proc/xen
If it exists, it’s xen VPS.

Enjoy :)