Free computing ebooks related to Linux, BSD and science

The Free Technology Academy is an organisation made up of several educational institutions from various countries that aims to contribute to a society that permits all users to study, participate and build upon existing knowledge without restrictions, software used in the Free Technology Academy virtual campus is free software built upon an open standards framework.

  • Linux from Scratch: A free open source ebook that will teach you how to build your own custom Linux distribution entirely from source code
  • WikiBooks: Wikibooks contains all kind of science and computing books available for free online, they can be edited but unlike the others, Wikibooks does not seem to have a PDF download option.
  • FreeTechBooks:  A website full of free downloadable tech ebooks related to computer science, engineering and programming, text books and lecture notes, all of the ebooks have been legally released to the Internet community, check out the open source books in their FreeBSD section.

The Free Technology Academy is financially supported by the Life Long Learning programme (LLP) of the European Commission, you can download free Linux and open source related eBooks from their materials webpage, these books are released under the Creative Commons license, it is likely that new ebooks will be added to their course materials.


Linux computer hacker
Linux computer hacker

Some of the books available for download from the Free Technology Academy include “Introduction to free software“, “Gnu/Linux advanced administration“, “Gnu/Linux Basic“, “Introduction to software development” and many others.

Open source Linux firmware router: DD-WRT, Tomato and OpenWRT

DD-WRT firmware: One of the biggest advantages of DD-WRT firmware router is the huge community behind it which makes it easier to get help. Open source DD-WRT firmware is free for individuals but if you want to use it for commercial purposes need to pay a license. DD-WRT has a multilingual interface, bandwidth management, it supports over 200 devices, all WLAN standards  and it has VPN integration.

DD-WRT Linux router firmware
DD-WRT Linux router firmware

OpenWRT firmware: OpenWRT is a Linux distribution normally used at embedded device, OpenWRT offers many features not previously found in consumer level routers. There is support for DHCP, and wireless encryption in between many others. Open WRT allows for package management allowing users to install new software according to their needs.

OpenWRT Linux router interface
OpenWRT Linux router interface

Tomato firmware: This open source Linux core firmware distribution is used mostly for Broadcom chipset based wireless routers, it features an easy to use Ajax based GUI interface, bandwidth usage monitor, advanced access restrictions, wireless features, P2P connections bandwidth control, running of custom scripts, scheduling of reboots and much more.

Tomato firmware Linux router
Tomato firmware Linux router

WARNING: Flashing hardware firmware is dangerous and installing third-party firmware is normally unsupported by router manufacturers. Use it at your own risk!

How to encrypt your data using OpenSSL

For those of you comfortable with the command line, there is an alternative way to password a file using the free utility OpenSSL, for example if you wanted to password protect a .tar archive with documents documents called unencrypted-data.tar

From the command line, type:

$ openssl des3 -salt -in unencrypted-data.tar -out encrypted-data.tar.des3
enter des-ede3-cbc encryption password:
Verifying – enter des-ede3-cbc encryption password:

That command will encrypt the unencrypted-data.tar file with the password of your choice and output the result to encrypted-data.tar.des3, to unlock the encrypted file, use the following command:

$ openssl des3 -d -salt -in encrypted-data.tar.des3 -out unencrypted-data.tar
enter des-ede3-cbc encryption password:

You can also use OpenSSL commands to verify a digital certificate, encrypt a S/MIME message, connect to a secure SMTP server, and much more!  The page below contains lots of command line examples on how to do that.

OpenSSL Command-Line HOWTO

How to stop WordPress hotlinking using .htaccess

There are some spammers, mainly in the adult business, who take some of the highest ranked Google images and then hotlink to them in order to get your website traffic,if you have limited hosting account bandwidth or you do not want anyone to hotlink to any of your WordPress images, here is what to do to stop it.

Go to your webhosting account and edit your .htaccess file (create it if it does’nt exist),  add these lines (RewriteEngine will typically be already set to on if you have a WordPress blog, you will then omit this line, do not write it twice):

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ [NC,R,L]

That is it! The most important part is to get right, if you do not do this you will see the nasty image (stop hotlinking) served by anything you specified.

To whitelist search engines, or a site you own, and let them hotlink to your images, you should add these lines to your .htaccess file:

RewriteCond %{HTTP_REFERER} !^$

Stop hotlinking warning message
Stop hotlinking warning message

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ [NC,R,L]

Stop hotlinking .htaccess code explained

RewriteCond %{HTTP_REFERER} !^$ > Allow blank referrers (recommended). Some users surf under firewall and they do not provide any referrers, disallowing blank referrers will block them from accessing these images, but if you still want to do that simply delete this line.

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC] > Site allowed to link your images, if you do not add your domain here you will be blocking your own blog from displaying the images, you can add Google and Bing here so that they can still link to the images.

RewriteRule \.(jpg|jpeg|png|gif)$ [NC,R,L]  > In between the () are type of files you want to block from hotlinking, you can also add .css and other extensions like .bmp. To add more seperate them with”|”.

Change ‘ [NC,R,L] ‘ to your own message, whenever image hotlinking is detected this image will show up. It will be better if you host the image somewhere else outside from your own webhost. 

Warning: Make sure the image you are serving is not hotlink protected or your server can go into an endless loop.

Other ways to protect image hotlinking

You can turn on hotlink protection at your CPanel webhosting account, to use cPanel to stop image hotlinking go to the “Security” section and choose > Hotlink protection, you will have to enable it first and then enter the redirect URL you want hotlinkers to go to.

There is a WordPress plugin to display the image of your choice in hotlinked photos: WP-PICShield

To test if  hotlink protection is working on your site visit this online hotlink checker 

Stop your Unix/Linux shell from saving typed in commands

When working using bash, zsh, ksh (korn shell) or any other Unix shell the default is to save the history of the command lines typed in, this can become a security and privacy risk if someone else has access to your computer.

How to erase Unix shell history file

You can do this as long as you have administrator rights, I am using the bash shell as example, depending on what shell you are using the path and instructions might differ a little.

# kill -9 $$

$$ gives the pid of the current shell instance, and the kill ends the process.

You could also use the history command, see man history:

# history -c (clear the history)
# history -w (write to the file – overwrite!)

Delete the bash history file, find out where your shell saves the history of typed in commands and delete it the same way. You may also use the shred command to overwrite it safely.

# rm -rf ~/.bash_history

But even if you delete the ~/.bash_history file, your current bash session will still be written to history once you log out, this is because it is being stored in RAM, you will need to use the previous history -c command to avoid this.

Stop the shell saving typed commands

Examples based on the bash shell configuration files:

Turn off bash history for all users, append unset HISTFILE to /etc/profile

# echo “unset HISTFILE” >> /etc/profile

Set size of the history to zero:

HISTSIZE: The number of commands to remember in the command history. The default value in bash is 500, You can set this to 0 and disable the usage of the history file.

Introduce the following command in your personal bash configuration file ~/.bashrc (~/.zshrc for the zsh shell users) or in the global bash configuration file /etc/bash.bashrc

export HISTSIZE=0

You will need to restart your bash session in order to activate the settings, you can check if your configuration were entered correctly by going at the command prompt and typing:


If you don’t see your configuration in the environment variables than you have done something wrong.

The name of the configuration files can depend from your Linux distribution and bash version, you can always see your particular options using man bash.

Configuration files path Unix shell
Configuration files path Unix shell

Unix shell configuration table files explained:

  • Blank means a file is not read by a shell at all
  • yes” means a file is always read by a shell upon startup
  • login” means a file is read if the shell is a login shell
  • n/login” means a file is read if the shell is not a login shell
  • int.” means a file is read if the shell is interactive
  • i.login” means a file is read if the shell is an interactive login shell

To find out what shell you are using type: echo $SHELL

To change your shell see chsh –help

How to block a whole country from visiting your website

There are times when you may want to ban visitors from a certain country from viewing your website, the reasons for these can go from geolocation restricted content, to stopping malicious hackers.

You can block people from viewing your website using rules in your firewall IP tables but if you don’t have access to that, you can edit the .htaccess file and add a list of IPs to be blocked, you can get the whole IP range from a country from IPInfoDB.

However this solution may cause server overload if many requests are made from that country, resulting in a denial of service side effect, an easier way to do this, is by banning people from accessing your website according to their browser language settings, for example to ban people who is using a Chinese internet browser you will add to your .htaccess file:


RewriteRule .* – [F]

This will generate a 403 error message with Chinese browser configured visitors getting a “Forbidden” message when visiting your page, the language settings can be changed to any language you like,  zh-CN is the browser language settings for Chinese.

Video: How to use Mixmaster to send anonymous emails

Mixmaster is is an anonymous remailer software, tt encrypts your email messages before sending them and routes the messages through a series of anonymous proxies, you can choose how many nodes and what proxies you want on the chain, blacklisting a particular remailer server if you don’t trust it, mixmaster also provides protection against traffic analysis by delaying the sending of the messages.

This Linux Journal video introduces Mixmaster and explains how you can download it to your own Unix machine and help the Internet anonymity cause running an anonymous email server.

Mixmaster runs on *BSD, Linux and Microsoft Windows. If you have questions about remailers and Mixmaster one of the best points of calls is the newsgroup: alt.privacy.anon.server

You can read the mailing list for remailer operators, and subscribe, at:

Mixmaster remailer software homepage: