Anti tracking / add site list.

Hi all.

Found this thread by dmt on PCLinuxOS.com forum:

Hi all

Just thought I would share this.

There is a site that keeps an extensive list of dodgy sites that track and place adds and whatever.

The url is http://someonewhocares.org/hosts/

The list is updated on a regular basis and you can download it as a text file to easily place within the /etc/hosts file.

cheers

Looks interesting so I have decided to share it here just in case…

Andy

Blocking Bots…

Hi all.

I have noticed some interesting entries in my logs. There were few bots that were visiting me once in a while. I want to block them off ;).

How would one do it? I googled it and found the .htaccess file the easiest way.

Basically You create a file in the main directory of Your website. Lets say for example /var/www/html/ called .htaccess with 644 root permissions.

Then You create a rule.

Deny from env=bad_bot

From now on – everything called bad_bot gets denied. How to mark bot as bad_bot?

BrowserMatchNoCase Morfeus bad_bot

This means: Read the Browser’s user agent and don’t try matching the case. If You find word Morfeus – its a bad_bot.

Voila. This should block them bots and make my server even more secured :).

[root@icsserver ~]# cat ./.htaccess
# http://www.thesitewizard.com/apache/block-bots-with-htaccess.shtml
# hope this will get rid of them b****** ;)!
BrowserMatchNoCase Morfeus bad_bot
BrowserMatchNoCase Strikes bad_bot
BrowserMatchNoCase Again bad_bot
#BrowserMatchNoCase compatible; MSIE 6.0; Windows 98 bad_bot
#BrowserMatchNoCase compatible; MSIE 4.01; Windows 95 bad_bot
BrowserMatchNoCase pozdrawia bad_bot
BrowserMatchNoCase dewelopera bad_bot
BrowserMatchNoCase http://help.goo.ne.jp/door/crawler.html bad_bot
BrowserMatchNoCase ichiro bad_bot
BrowserMatchNoCase Googlebot bad_bot
BrowserMatchNoCase N905i(c100;TB;W24H16) bad_bot
BrowserMatchNoCase Googlebot-Mobile/2.1 bad_bot
BrowserMatchNoCase DoCoMo/2.0 bad_bot
BrowserMatchNoCase http://www.google.com/bot.html bad_bot
BrowserMatchNoCase Yandex bad_bot
BrowserMatchNoCase YandexBot bad_bot
BrowserMatchNoCase http://yandex.com/bots bad_bot
#BrowserMatchNoCase SecurityHoleRobot bad_bot
#BrowserMatchNoCase SecurityHoleRobot bad_bot
#BrowserMatchNoCase SecurityHoleRobot bad_bot
#BrowserMatchNoCase SecurityHoleRobot bad_bot
#Order Deny,Allow
Deny from env=bad_bot
#Deny from 127.0.0.1
[root@icsserver ~]#

# in front of a line means it’s going to be ignored.

And few more details:

[root@icsserver ~]# ls -full ./.htaccess
-rw-r–r– 1 root root 1205 Apr 4 16:02 ./.htaccess
[root@icsserver ~]#

You can block / allow certain countries. You can also block certain IP addy’s / genuine browser agents.

Hope You will find it interesting / helpful.

Andy

Creating ISO image out of CD / DVD.

Hi all.

Sometime ago I have created a slideshow video from a wedding photos for a Friendly couple. I made DVD video with a nice background music out of it and gave it to Them as a anniversary gift. (I used xsane / Imagination / mencoder / avidemux-qt / devede / K3B to accomplish this – all are available in PCLinuxOS repositories – just in case You ask). I wanted to keep a backup of this DVD on my HDD in a ISO file format just in case They ask for a copy. How would I create ISO file from a CD / DVD media? Its VERY simple. Use dd command. This is how it’s done:

Assuming that:

A) Your system identifies CD / DVD drive as /dev/sr0
B) Your destination folder is based in Your home folder
C) File name You want to user is file.iso.

Open terminal and issue this command followed by [ENTER] key punch:

dd if=/dev/sr0 of=~/file.iso

Where:

if=/dev/sr0 – Read from /dev/sr0 (raw format)
of=~/file.iso – copy the media to a file-container file.iso located in my /home/user/ folder i.e. backup media to ISO image

Now You can for example:

A) Burn the iso to a CD / DVD to make extra copies (with K3B / Brasero / SimpleBurn etc…)
B) If it’s lets say Linux LiveCD You can use ISO to boot it in VirtualBox (also available in PCLinuxOS repositories…).
C) Do many other things with it.

Hope this helps.

Andy

SMPlayer seems crash happy? Causing problems? Reset the settings – it may help.

Hi Folks.

I had a problem with my fav media player – SMPlayer. All of the sudden it started crashing. Some videos were unplayable.

Here is how I fixed it. VIDEO.

If You change any other settings change them one at the time and try playing video / restarting SMPlayer. Takes a bit longer but its easier to find the option that’s causing the trouble on Your machine.

Hope this helps.

Andy

Using Midnight Commander and SSH to transfer files securely between hosts.

Hi Folks.

After the previous 3 SSH related posts:

Passwordless SSH authentication. Using authentication keys,

Copying files securely between local machine and shell account and

Tightening security for SSH Server

I have decided to explain how to use Midnight Commander to transfer files between two machines using SSH server.

Machines are configured to use authenticating keys (great method of fooling the keylogger btw).

Using SSH and MC to copy files securely between hosts VIDEO

You can add extra information when logging in. Example:

username@host.domain.xxx:port/home/username/

username – Your login to the SSH server

host.domain.xxx – IP or host of the SSH server

port – number of the port that ssh works on – 22 by default

/home/username/ – Directory that You want to open on SSH server

and so on and so forth. Its simple and very useful as mc can copy multiple files / folders, it can also skip certain files if they exist on target computer (depending on multiple conditions), it can be used to overwrite files or to edit files on the SSH server. It can be used to move / delete / rename / create / chown / chmod / search files on SSH server.

Midnight Commander is one of my favorite tools. Hope You will find it useful too.

Regards.

Andy

Backup Your folders… Re-doing Your settings can be a long and tidious process…

I have heard a good joke today…

– Hey Daddy… What does “Formatting HDD successfully completed” means?…
– It means You’re freakin DEAD

It does not have to be this way…

First of all – in PCLinuxOS You need to know the root password before You can format a drive…

Second thing is – if You set the permissions to Your files properly nobody can touch them if they don’t have Your password.

Last but not least? Backup Your data!

I always run a very nifty command before applying any important change to my system:

cp -Rf ~/.mozilla ~/.mozilla.bkp

It makes my settings save… Copies them into the .mozilla.bkp folder – if something nasty happens to my .mozilla folder I can recover it in a few seconds.

I have a .bkp copy of most of my ~ folders. If I loose my .mozilla settings or they are messed up I use:

rm -Rf ~/.mozilla&&cp -Rf ~/.mozilla.bkp ~/.mozilla

It removes the .mozilla folder from my ~ folder and replaces it with new .mozilla folder copied from my .mozilla.bkp folder.

Of coz You need to replace .mozilla with the name of the folder You want to backup.

Mind Your fingers coz rm -Rf command IS dangerous if misused. It will delete everything in path given without asking and it will delete it recursively…

You could use it to backup and recover any folder to and from any place just mind the syntax of the command.

Andy

KDE4 All Permissions Greyed Out.

Hi.

This is something I do when all my permissions are greyed out in KDE.

A) Open Dolphin file manager.
B) Right click on the ~/.firefox folder.
C) Choose Properties.
D) Go to the Permissions tab.
E) Click Advanced Permissions.
F) Make sure that all Special ticks (UID, GID, Sticky) are unticked.
G) Click Ok.
H) Are Your permissions still not available? They should be now.
I) Set them up

a) Owner: Can view and modify content
b) Group: Forbidden
c) Others: Forbidden.

J) Mark the box "Only owner can rename and delete folder content"..
K) Make sure that Your login. is present in Owner and Group dropdown menu.
L) Mark the box "Apply changes to all subfolders and their content".
M) Click OK.

This should finish with no errors.

You should be good to go.

Andy