Where to place a wireless router inside the house

It seems that many people put their wireless router near their main phone line, or near a wall with a window, usually that is the location closer to the internet line coming from the street, and it is the most convenient, but it is not the best location for the wireless signal.

Placing the router on an edge of the house, closer to windows, make it much more susceptible to interference from neighbours wireless devices, while placing it in the middle of the house, make the cement walls act as a natural shield for wireless signals coming from farer locations.

It is also better to place the router about 2 meters of the ground, above most humans moving in the place.

It seems that the middle of the house, away from the windows is the best location, however routing cables for internet/power/ethernet seems to be a problem, if that is a problem for you too, try to find a middle ground.

If you have an experience with wireless router placement, please feel free to include it in comments.

Unset an array item in a foreach loop

Trying to remove an item from a PHP foreach loop is not a straight forward job, because, PHP works on a copy of that array, so you need to do it like this:

$items = array('a','b','c','d');
foreach ($items as $key => $value) {
    if ($value=='b' || $value=='d') {

this outputs:

array(2) {
  string(1) "a"
  string(1) "c"

Tools for debugging JavaScript in your browser

If you want to work on Javascript, you will find it very helpful to go through the code and set breakpoints and do more debugging stuff, fortunetly, there are tools in browsers to help with that.

Which tool you will user, depends on which browser you want to debug depends on your browser:

Firefox, you have 2 choices:

You can use built in developer tools, which can be accessed via the:
Menu > Developer > Debugger
and you can also right click on any element in your web page to inspect it.

Another option for firefox is FireBug, which is a very useful add-on, after installing it you will find it either on the top bar as an icon, or you can:
click “alt” > then the old menu will appear, and you will find firebug under
View > Firebug
you can also click anywhere in the webpage and select ‘Inspect Element with Firebug’


Menu > Tools > Developer tools
Menu > Tools > Javascript Console

Internet Explorer:

Just click ‘F12′
Tools > F12 Developer tools

Traceroute is not installed by default on Ubuntu, replaced by mtr

To my surprise, when trying to run this command on Linux mint 17, based on Ubuntu 14.04, I found out that traceroute is not available anymore.

 $ traceroute google.com
The program 'traceroute' can be found in the following packages:
 * inetutils-traceroute
 * traceroute
Try: apt-get install <selected package>

After doing a bit of searching, I found out that there is a new command, that does roughly the same job, but it display the output as live updating as it does pinging of the hosts through the route.

If you do not like this change, you can always install traceroute

 $ sudo apt-get install traceroute

mtr is executed like this:

 $ mtr google.com

And the result:

                             My traceroute  [v0.82]
s-20-75 (                                      Tue Sep  9 23:31:10 2014
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                       Packets               Pings
 Host                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. hidden-address                   66.7%    13    0.5   4.1   0.5  14.8   7.1
 2. hidden-address                    0.0%    13    1.4   1.4   1.1   2.6   0.4
 3. hidden-address                    0.0%    13    5.0   5.0   4.9   5.4   0.1
 4. hidden-address                   90.9%    12    4.8   4.8   4.8   4.8   0.0
 5. google.as15169.fr.eu              0.0%    12    5.1   5.1   5.1   5.3   0.1
 6.                     0.0%    12    5.4   6.9   5.4  16.1   3.3
 7.                     0.0%    12    5.8   5.6   5.5   5.9   0.1
 8. par10s10-in-f5.1e100.net          0.0%    12    5.3   5.3   5.2   5.5   0.1