WordPress Permalink Migration Warning (SEO semi-disaster)

If you follow those guides about migrating your blog to another webhost using import/export functionally…
You must rebuild your permalinks in the exact same format as the original webhost!

Go to Settings > Permalinks, and click save changes.
Make sure you choose the correct permalink structure.

If you do not, all your indexed pages on search engines (google, etc) will disappear and your site will be re-indexed losing you your traffic.

Accessing MYSQL server behind firewall using SSH

So, you want to access a MYSQL server but you only have an SSH terminal…
Not to worry, you can use SSH tunnelling to do this!

Basic Example

Example: ssh -L 3306:localhost:3306 user@IP -p SSHPORT

Now how do you control this dark ssh sorcery? Let’s break it down.

1) 3306:localhost:3306

  •  Open a port 3306 on my local machine to redirect
  • localhost:3306 means we are tunnelling to 3306 on SSH machine

2) user@IP

This is your username and the IP address of the server


This is the ssh port if it is not on 22.

Another Example

ssh -L 9000: user@ -p 1234

You would use this if you wanted to:

  • use your computer port 9000
  • to access the port 5000 on IP
  • through the SSH server
  • with SSH server port on 1234

Happy SSHing!


Allowing/troubleshooting AirServer through windows 7 firewall

AirServer allows apple mobile devices (Ipads, Iphones) to stream the screen using the airplay protocol.

Unfortunately, AirServer did not work immediately right off the bat on my own machine and required modifying the Advanced firewall settings.

If you see anything appearing even you you have selected Airplay on the device, it may be an issue of the firewall.

In order to test this, disable the firewall for the local network using the instructions here.

On my own computer, I entered the advanced settings of windows firewall and added two inbound rules in order to expose freely the UDP and TCP ports required by AirServer.

Advanced Firewall Settings

Inbound Rule




So, if your having issues using AirServer but do not want to disable the firewall add manual rules for the following ports as described on their site.

AirServer Ports

Using DD for windows to resume a failed file transfer from specific point

If you were transferring a large file and the network cut out you can either restart the copy, or use a tool such as DD for windows to resume from a specific point.
For very large files it is recommended to use better copiers such as robust copy.

I had a file that was 1 421 304 KB in size and I had copied around 60 percent.
Therefore, I needed to start after 852782 KB .

The following command was used:

dd bs=2k if=z:SURCE_FILE of=D:DESTINATION_FILE seek=5767168 skip=426391 --progress

Since skip takes number of blocks defined with size bs= , we skip to 426391.

426391  * 2KB = 852782 KB

Tunneling to VNC over SSH

You may want to connect to a headless/monitorless linux pc with a vnc server running that only exposes an SSH port.

I have used the following steps from windows.

  1. Server:
    Run VNCServer

    If not running already start your server.  You can set the resolution using -geometry tag. This will open a new port/session.

    vncserver -geometry 1920x1200


  2. Workstation:
    Create the tunnel to VNC port
    This maps the local pc port 5905 to localhost:5905 on the remote machine. VNC uses ports 5901 to 5909.

    ssh -L 5905:localhost:5905 menelaos@menelaos.server.net -p 22


  3. WorkStation:
    Create tunnel if needed of X-Server

    ssh -L 6005:localhost:6005 menelaos@menelaos.server.net -p 22


Bash script to monitor server HTTP output length and e-mail an alert

Below is an example of a script that uses CURL to monitor the length of various HTTP server outputs and output a response if this is different than 103 characters.
This is my first bash script, so I had some reading/experimenting to do and it is quite rough.

Anecdote – forcing wifi bridge to connect to other AP

This is personal anecdote about how to  re-connect to a disconnected wifi bridge if your main AP is off/broken.

Usually our network is layered as follows:

DLINK Powerline Enabled AP
<-----[Copper Power Wire]----->
TP LINK Powerline
ADSL Modem & AP
Asus WL-330N3G 
WD Media Player

So 2 weeks ago the ADSL Modem (AP including LAN DHCP server) died but in the network I continued seeing the SSID. After scanning the network we saw that the ASUS wireless bridge transmits with the same SSID as the ADSL modem / AP. The actual modem is a Belkin but the wireless bridge uses the same SSID as seen below from an iphone app called “Net Analyzer”.

photo 1


Connecting to JMX from visualVM using SSH tunnel

I used the following source:


I did this in windows using git bash that has ssh command. You can also do using cygwin or pure minggw.

1) Run ssh tunnel command in command prompt (I do this in git bash/MINGGW32).

ssh -D 9010 -p 22 root@IP -v

2) Run your application on server with JMX options

java -Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.ssl=false -jar 

3) Run visualVM through socks proxy to connect:

visualvm -J-Dnetbeans.system_socks_proxy=localhost:9010 

4) Actually add your JMX remote connection in visualVM

MysqlDump directly on mounted remote directory (CENTOS, Linux, Unix)

If you don’t have space to write a dump file, or want to directly send your SQL to another server (without intermediate transfers), using a remotely mounted folder is a way to go.

There are various mounting options such as:

  • NFS
  • Windows Shares (SAMBA)


Repeating a unix command every X seconds

The watch command can be used to repeat a command every X seconds.


Monitor Disk Usage (updated per second)

watch -n1 df -h

DiskPrint Hello World (every second)

watch -n1 echo “Hello World”