QNAP TS-420 web interface not accessible over SSL

After a reboot the web interface on a QNAP TS-420 NAS was not accessible over SSL. A nmap showed the NAS was not listening on the SSL port and it was configured to force SSL connections over the standard 443 SSL-port. So trying to access it over the non-SSL port just directed me to https://<ip-address of the nas> where there was no response.

To be able to access the web interface over the non-SSL port 8080 i had to ssh into the NAS using the admin account, then I issued the following commands:

/sbin/setcfg SYSTEM "Force SSL" 0
/etc/init.d/thttpd.sh restart

After this it was possible to access the NAS web interface over the non-SSL port, i. e. http://<ip-address of the nas>:8080

 

Start embedded Youtube video at specific time

When you share a video on Youtube you can select to start the shared video at a certain point of time in the video. Like this (selected to start at 0:40).

Youtube share with start at

This option however is not availible when embedding a video. It can be solved manually though. The embed code from Youtube looks something like this:

<iframe width=”560″ height=”315″ src=”//www.youtube.com/embed/6bHSP9Ddw5w” frameborder=”0″ allowfullscreen></iframe>

To start the video from a specific time, you add the ?start=XXX where XXX is the point counted in seconds. So if the start time includes minutes you have to convert into seconds. If I want the embedded video to start at 0:40 I add ?start=40 like this:

<iframe width=”560″ height=”315″ src=”//www.youtube.com/embed/6bHSP9Ddw5w?start=40” frameborder=”0″ allowfullscreen></iframe>

This is the embedded video starting at 0:40 (and yes, that is me reverse driving an articulated 18 meter bus – sometimes, when I’m not busy ruling Nerdia or working as an IT consultant I walk out into the real world where I sometimes work as a bus driver and it is great fun! :)):

Error 404 when trying to password protect administrator folder in Joomla using Apache htaccess

When protecting the administrator folder in Joomla using Apache htaccess to increase the security of the website (which by the way is a good thing to do to prevent too interested individuals to peek where they shouldn’t), you might get an error 404 message when trying to access administrator and the expected password prompt never appears.

The cause can be that the server is configured to allow user defined error pages stored in for example the error folder. If some of the error files are missing the above mentioned problem can occur. Make sure you have the correct folder name and file names for your error files.

This particular problem occured for me when I moved a Joomla site from one hosting provider to another and by mistake also replaced the error folder with the one from the old hosting provider which had a completely different file name structure for the error message files.

Ubuntu 12.04 hangs in different stages of the boot sequence

A server I am maintaining stopped during boot on the "Stopping userspace bootsplash" or "Configuring network interfaces". If Ctrl-Alt-Del was pressed the machine rebooted so it was not completely stuck. I tried booting in rescue mode and checked the /etc/network/interfaces syntax but no problem visible there.

The solution was quite simple. Boot in rescue mode and select package repair. After repairing my packages the machine was rebooted, then fsck was ran automatically (which took quite a while). After that the machine booted normally.

 

Copy of PrestaShop default-bootstrap theme from 1.6.0.6 doesn’t display submenus after upgrade to 1.6.0.9

I made a customized theme by copying the PrestaShop default-bootstrap theme in version 1.6.0.6. After an upgrade to 1.6.0.9 the theme will no longer show the dropdown submenus.

The reason is that after the upgrade, the default-bootstrap has been updated but my customized copy hasn’t causing some needed JS files not being loaded.

The quickest solution is to go into Advanced Parameters -> Performance and enable Move JavaScript to the end

 

I found information about the problem here.

 

Multiple attributes / combinations in PrestaShop

Here is the documentation on how to add attributes / combinations to a product in PrestaShop -> http://doc.prestashop.com/display/PS16/Managing+Product+Attributes

If you plan on using multiple attributes for a product, like size and colour, do use the combinations generator and select both the possible sizes and colours at the same time. If you add them by hand one by one you risk ending up with a scenario where only the first attribute is visible in the shopping cart and on the resulting order (like the size but not the colour), i.e. you will have to contact the customer to ask about the other attribute(s).

By using the generator PretaShop will create the all the necessary combinations for you, i.e. size 1 + colour 1, size 2 + colour 1, size 1 + colour 2, size 2+ colour 2 and so on.

 

Improving wifi in a crowded wifi environment

This is a litle trick I use when I travel and hook up to a wifi network in a crowded wifi environment. Sometimes the network performance over wifi is really bad and the problem is that it can be caused by heavy traffic (like file sharing) on another wifi network sharing the same channel as yours. I have experienced this especially when travelling to big cities like Paris, Amsterdam and so on. First of all, it is recommended that you disable 802.11n wifi mode which works terribly bad in crowded environments. See this article for Windows and this for Linux (Ubuntu).

 

Crowded wifi environment (Wifi Analyzer for Android)

Crowded wifi environment (Wifi Analyzer for Android)

The problem with the wifi technology is that networks in the neighbourhood is sharing the same channels. In the 2,4 GHz band there are only 11-14 channels availible (depending on your region) and those channels overlap. That means if your network is on channel 1 you will get interference with traffic on channels 1, 2 and 3. Another problem with wifi is that is has no means of evenly dividing the capacity (like timeslots), so it is kind “the one shouting highest gets the most bandwidth”. And when someone already is using a lot of bandwidth (like file sharing) it is very hard for other users to obtain a part of the bandwidth. Even if it is the neighbours wifi which you can’t access but it shares the wifi channel.

A countermeasure to improve the situation is to constantly use some bandwidth forcing the heavy users to pull back a bit. Before transmitting, each node in the network listens in the air if the channel is free, so by using a little bit of bandwidth even if idle you don’t give the other node the same possibilty to hog the entire capacity.

First of all, find out the IP address of your local network default gateway. In WIndows you run a command prompt (cmd) and type the command ipconfig. In Linux you can use netstat -rn.

To constantly use up a small portion of the bandwidth I use the ping comand. Ping normally sends very small packets (56 bytes), but to get this to work we need a bit larger packets (but not to large, then we will hog the entire capacity). 1024 bytes is good.

In Windows you run the command (replace 192.168.0.1 with the IP-address of your local network which you found out above):

ping -t -l 1024 192.168.0.1

and in Linux you run:

ping -s 1024 192.168.0.1

 

ping with 1024 bytes

ping with 1024 bytes

Voila! Now my wifi connection gets a lot more stable because I force the other wifi nodes to pull pack a bit since I constantly make them aware of my presence.

 

Install Ubuntu 14.04 on Samsung Ultrabook Ativ Book 9

To install Ubuntu 14.04 on a Samung Ultrabook Ativ Book 9, this is how to do it.

I decided to keep the factory installed Windows 8.1 beside my Ubuntu install using dual boot. Thanks to enrish for the basic info. I found out there is no need to shrink the Windows 8.1 partition as long there is space enough for Ubuntu. The Ubuntu installation will do this for you. Before you do anything – make sure you have a backup as usual. If you decide not to keep the Windows 8.1 install, do keep the recovery partitions. No need to install any screen drivers, Ubuntu worked out of the box.

  1. In WIndows, run the Samsung Update Utility and update everything including BIOS/firmware.
  2. In Window Control Panel go to Power options and click on Choose what the power button does. Click on Change settings that are currently unavailable then scroll down and deselect Turn on fast startup (source http://askubuntu.com/questions/221835/installing-ubuntu-on-a-pre-installed-windows-8-64-bit-system-uefi-supported). Restart your system.
  3. When booting, press F2 to enter the setup.
  4. In the Boot section, disable Fastboot
  5. Insert the USB flash drive with Ubuntu ISO (prepared with create startup disk on another computer). 
  6. Configure boot device order, setting the flash drive to be the first option.
  7. Save and reboot. Now the system should be booting on the flash drive.
  8. Select to Install Ubuntu. During installation Ubuntu will recognize that you have Windows 8.1 installed and you have the option to install Ubuntu beside the Windows 8.1. The Ubuntu install will shrink the Windows 8.1 partition to make room for Ubuntu. By dragging the vertical bar you can decide how large the partitions for Windows vs Ubuntu should be. Continue installing Ubuntu as usual.
  9. After installing Ubuntu, unplug the flashdrive and when booting, press F2 and enable Fastboot again.

 

Disable 802.11n on Compaq 6910p with iwl4965 in Ubuntu

I’ve found out that the 802.11n high speed wifi / wlan mode (300 Mbps theoretically) tends to cause more harm than good, i.e. the performance in many, especially crowded, wifi environments will be really poor and it is a better option to turn it off.

My Compaq 6910p laptop comes with an Intel Wireless WiFi Link 4965AGN chipset. The 802.11n mode can be disabled making it fall back to only use 802.11a/b/g modes casuing the connection to be much more stable and often the overall bandwidth will be better.

To check if your chipset is running with 802.11n enabled, enter the command:

sudo iwconfig wlan0

The output will look something like this:

wlan0     IEEE 802.11abgn  ESSID:"XXXXXX"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:0C:F6:82:90:28
          Bit Rate=14.4 Mb/s   Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=51/70  Signal level=-59 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:66  Invalid misc:36   Missed beacon:0

If the first line says 802.11abgn your chipset has 802.11n activated.

To disable 802.11n mode do the following:

sudo modprobe -r iwl4965
sudo modprobe iwl4965 11n_disable=1

This will disable 802.11n until next reboot. Now check again with sudo iwconfig wlan0 and the output should display the first line without the “n” after 802.11, like this:

wlan0     IEEE 802.11abg  ESSID:”XXXXXX”
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:0C:F6:82:90:28
          Bit Rate=54 Mb/s   Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=46/70  Signal level=-64 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:7  Invalid misc:485   Missed beacon:0

If you want to make this change permanent, i.e. always disable 802.11n, do the following:

sudo echo "options iwl4965 11n_disable=1" >> /etc/modprobe.d/iwl4965.conf

After rebooting, verify using sudo iwconfig wlan0 that 802.11n is not enabled.

 

Samsung Ultrabook series 5 loses wifi connection intermittently

On a rather new Samsung Ultrabook series 5 we had intermittent / sporadic connection problems on some wifi networks. The status for the network shifts forth and back between ok and “No internet access”. This doesn’t happen on all wifi networks. It seems the problem is the 802.11n mode, especially in a crowded wifi environment.

The solution (or workaround) is to disable the 802.11n mode in the wifi driver for the Intel(R) Centrino(R) Advanced-N 6235 chipset. This gives a lower bandwidth connection but on the other hand, a stable connection.

  1. Go to the Control panel
  2. Open Network connections (search for it if you have troble to find it)
  3. Right click on your wifi connection and select Properties
  4. Click Configure in the upper part of the box (my screenshot is danish, so it is the button labeled “Konfigurer…”)

    Intel Centrino Advanced N-6235

    Intel Centrino Advanced N-6235

  5. Click on the Advanced tab
  6. Find the 802.11n mode status configuration parameter and select to set it inactive (off)
  7. Click Save / OK in the bottom