If you want to disable wget to download your site pages you need to declare wget as bad_bot. For that you need to add the following code in the .htaccess file located under website’s public_html directory.
after you inserted this code, if anybody tries to download your site pages using wget will receive a 403 error.

#Declare Wget a bad_bot
SetEnvIfNoCase User-Agent "^Wget" bad_bot
Order Allow,Deny
Allow from all
Deny from env=bad_bot

root@debian:~# wget http://www.debian-tutorials.com/
--2013-02-14 xx:xx:xx--  http://www.debian-tutorials.com/
Resolving dev.slayergame.com... xxx.yyy.zzz.aaa
Connecting to www.debian-tutorials.com|xxx.yyy.zzz.aaa|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2013-02-14 xx:xx:xx ERROR 403: Forbidden.

VirtualBox Commands List

Valic —  February 14, 2013 — 1 Comment

If you installed VirtualBox following this guide Run Virtual Machines and you are new to VirtualBox, then the following commands will help you to gather information and control your Virtual machines:

1. How to show the VirtualBox VM info:

root@debian:~# VBoxManage showvminfo

Where <vmname> is the name of your Virtual Machine

2. How to show the VM Harddrive info:

root@debian:~# VBoxManage showhdinfo

<filename> is the name of your .vdi file

3. How to list running VM:

root@debian:~# VBoxManage list runningvms

4. How to list available VM:

root@debian:~# VBoxManage list vms

5. How to list available VM Harddrives:

root@debian:~# VBoxManage list hdds

6. How to list all available ISO images:

root@debian:~# VBoxManage list dvds

7. How to Start a Virtual Machine:

Here you need to use the nohup command and add & to the end of command to run process in background so Virtual Machine will continue to run if you are closing the console. Continue Reading…

If you want to use windows 8 with Linux here is the solution.

If the Grub loader is not loading after windows 8 install, first you need to boot with a Live CD.

Then run these commands as root:

To find the drive where Linux is installed run the following command:

fdisk -l

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        9330    74936320   83  Linux

In my case sda1 is the drive where Linux is installed.
Then you need to run the following commands:

mount /dev/sda1 /mnt/
mount -o bind /dev /mnt/dev
mount -o bind /proc /mnt/proc
cp /proc/mounts /mnt/etc/mtab/
chroot /mnt /bin/bash
grub-install /dev/sda Continue Reading...

Few days ago I typed crontab -r instead of crontab -e. Well, my crontab was immediately deleted, without any warning. The first thing that I’ve done was to check if there was some backups on the server. As usual, there was no backups on my server.

So..If you accidentally type crontab -r instead of crontab -e , I have the solution for you:

In the system logs /var/logs/ are stored all crontab-calls of your system and you can easily extract them. Depending on your system you need to  cat and grep all crontab lines from the /var/log/syslog* files like this:

cat /var/log/syslog | grep -i "`which cron`" > cron_recovery_file

`which cron` will automatically be replaced by /usr/sbin/cron on Debian.

You need also extract all data from older messages logs stored as .gz archives:

gzip -d /var/log/syslog*.gz -c | grep -i "`which cron`" >> cron_recovery_file

In this moment you have a file called cron_recovery_file  that contains all your crontab-calls.

Your file will look like this now:

Feb 12 19:00:01 debian-tutorials /USR/SBIN/CRON[53198]: (root) CMD (crontab_command > /dev/null 2>&1)
Feb 12 19:00:01 debian-tutorials /USR/SBIN/CRON[53199]: (root) CMD (/scripts/backups > /dev/null 2>&1)
Feb 12 19:00:01 debian-tutorials /USR/SBIN/CRON[53200]: (root) CMD (mysql -u root --password=************ -e "flush query cache"; > /dev/null 2>&1)
Feb 12 19:09:01 debian-tutorials /USR/SBIN/CRON[53277]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -n 200 -r -0 rm)
Feb 12 19:17:01 debian-tutorials /USR/SBIN/CRON[53288]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Feb 12 19:30:01 debian-tutorials /USR/SBIN/CRON[53293]: (root) CMD (another_crontab_command > /dev/null 2>&1)

Now, you need to start with the first line and copy/paste the call ( denotes the stuff in the brackets after ‘CMD’) to a new textfile which will be your new crontab. Continue Reading…

This script will send you an email that contains all cron jobs for all your users.

#!/bin/bash
# Show all users cron jobs and send a report via email
# Created by contact@debian-tutorials.com, no rights reserved.
# Please submit feedback and questions at contact@debian-tutorials.com
# Homepage: http://www.debian-tutorials.com

EMAIL=$1
if [ -n "$EMAIL" ] ; then
	TMPFILE=/tmp/cronjobs.tmp.$$

        #get all users list
	for i in `cat /etc/passwd | cut -f1 -d :`; do
		echo "##################################################"
		echo "Username: ${i}"
		echo "##################################################"
		crontab -u ${i} -l 2>&1
		echo "##################################################"
	done > $TMPFILE
	cat $TMPFILE | mail -s "Cronjobs report for `hostname`" ${EMAIL}
	rm -f $TMPFILE
else
	echo "Usage: ./cronlist your_email_address"
	exit
fi

You can download this script directly from here: How to show cron jobs for all users

Page 5 of 4412345678910...203040...Last »