How to speedtest your connection on Linux

If you are used to the popular  “”  Web site to test your bandwidth connection, then here is how to use the same tool but using your Linux terminal.

1. Download the python script :

root@justgeek~]# wget

2. Make it executable :

chmod +x

3. Run the test using the script :

root@justgeek~]# ./

4. The output should look like this :

root@justgeek~]# ./
Retrieving configuration...
Retrieving server list...
Testing from Netelligent Hosting Services (
Selecting best server based on ping...
Hosted by Fibrenoire Internet (Montreal, QC) [19.40 km]: 15.656 ms
Testing download speed........................................
Download: 889.74 Mbit/s
Testing upload speed..................................................
Upload: 689.70 Mbit/s

Sed Examples

Below are the some simple, SED example which are very useful and handy to do the BIG tasks.

1. To add an line to the end of the file.

sed -ie "\$aAdmin added this line" file.txt

2. To add a word to end of a line when pattern matches

Example :

Name = John Matt Julie

to the above line you want to add Karin, then you can use the command below.

sed -i '/^Name/s/$/Karin/' names.txt

In above command, it will search for the line which starts with Name and add Karin to the line . After above command line will change to

Name = John Matt Julie Karin

XMLRPC attack on wordpress

Hackers can manage to keep your server offline for hours, by hammering XMLRPC.PHP file. It’s not possible to block the IP address as it comes from different IP addresses each time.

You can stop this attack by blocking XMLRPC.PHP file through .htaccess

Just create a .htaccess file where XMLRPC.PHP file is located and add the following code.

<Files "xmlrpc.php">
Order Allow,Deny
deny from all

If all the requests are from particular agent like  “Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)”

Then use the following .htaccess code to block attackers by agents

<IfModule mod_rewrite.c>
RewriteCond %{HTTP_USER_AGENT} ^.*WinHttp\.WinHttpRequest\.5.*$
RewriteRule .* http://%{REMOTE_ADDR}/ [R,L]

You can also add following code to mod_security to block such attacks.

SecRule REQUEST_LINE "POST .*wp-login.*"pass,initcol:ip=%{REMOTE_ADDR},setvar:ip.maxlimit=+1,deprecatevar:ip.maxlimit=1/600,nolog,id:35011"
IP:MAXLIMIT "@gt 10" "log,deny,id:350111,msg:'wp-bruteforce: denying
%{REMOTE_ADDR} (%{ip.maxlimit} connection attempts)'"
REQUEST_LINE "POST .*xmlrpc.*"
"pass,initcol:ip=%{REMOTE_ADDR},setvar:ip.maxlimit=+1,deprecatevar:ip.maxlimit=1/600,nolog,id:35012"<br />
IP:MAXLIMIT "@gt 2" "log,deny,id:350112,msg:'wp-bruteforce-xmlrpc: denying %{REMOTE_ADDR} (%{ip.maxlimit} connection attempts)'"

Hope you win and Hackers fall on face :)