Category Archives: Beginner

How to download Twitter videos (animated GIFs)

There are 2 types of Twitter videos: animated GIFs and real videos. This post is about animated GIFs. They have the text "GIF" printed on them when they are not playing.

To download animated GIFs there doesn't seem to be an easy way in Google Chrome unless you use an extension.

In Firefox:

  • open the tweet
  • right click on the video
  • choose "This Frame" -> "Page Info"
  • Under "Media" choose the mp4-file and click "Save As..."



Buying a used SATA disk

With the evolution of SSD drives, people are selling their old magnetic disks on Ebay or other platforms really cheap. Here are some steps to take after plugging in a bought SATA drive into your Linux system.

Keep in mind that all disk information probably can be manipulated, including model name, serial number, firmware, etc.

Check general drive information

# hdparm -I /dev/sdx
- Model Number
- Serial Number (to identify physical drive e.g. in case of replacement)
- Nominal Media Rotation Rate
- DMA: udma6
- Write cache
- SMART error logging
- SMART self-test
- SCT Error Recovery Control (if used in a RAID array)
- Security: Passwort not enabled/locked
(Enabled features are preceded by *)

Check SMART capabilities

# smartctl -i /dev/sdx
- SMART support is: Availabe
- SMART support is: Enabled (if not, enable it with "smartctl -s on /dev/sdx")

Check detailed SMART information

# smartctl -a /dev/sdx
- Model Family/Device Model
- User Capacity
- Rotation Rate
- SATA Version: current speed
- Vendor specific SMART attributes:
o Start_Stop_Count
    (Usually the same as Power_Cycle_Count)
o Reallocated_Sector_Ct
    (Bad sectors that have been marked by the disk?)
o Power_On_Hours
    (Disk has been used 24/7 as a NAS drive?)
o Power_Cycle_Count
    (Usually the same as Start_Stop_Count)
o G-Sense_Error_Rate
   (Disk has been dropped on the floor?)
o Load_Cycle_Count
   (Usually the same as Start_Stop_Count and Power_Cycle_Count)
o Temperature_Celsius
- SMART Error Log (Are there any entries?)
- SMART Self-test (Anything other than "Completed without error")

Temperature history and SCT

# smartctl -x /dev/sdx
- Temperature history
- SCT Error Recovery Control
    (Only important for use in RAID arrays, see one of my previous posts)

SMART tests

SMART tests do not degrade drive performance, they are more like collecting statistical data from the drive. Online and offline tests can be executed during normal operation.

# smartctl -t long /dev/sdx
Expected output:

root@linux:~# smartctl -t long /dev/sdx

Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 103 minutes for test to complete.
Test will complete after Fri May 20 09:48:56 2016

Use smartctl -X to abort test.

Check test result in drive logs:

# smartctl -l selftest /dev/sdx
Expected output:

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 37143 -

# smartctl -l error /dev/sdx
Expected output:

SMART Error Log Version: 1
No Errors Logged


So what are you doing if some of the values are not looking right? Don't worry. The drive might still be working without problems for one or two years. But you should have an eye on it:

  • Run regular SMART tests to see if error rate / reallocated sector count increases.
  • Don't use the drive as a sole disk medium for critical high performance data. Maybe make it part of a RAID 1 or RAID 6 array or use it as a hotspare / cold standby drive. Even then you should run regular SMART tests on the drive.
  • Make sure that the temperature is not too high (should be somewhere around 40 degrees celcius and is dependent on the drive).
  • Minimize power cycles. Using a worn out disk on a PC or laptop that gets rebooted a couple of times every day is not a good idea.
  • If you can afford it, use more file system and RAID caching to minimize disk reads and writes. RAID controllers usually support writethrough and writeback. While writeback minimizes disk writes, it should only be used on battery backed or flash backed RAID controllers. Don't use software RAID or fake RAID controllers.
  • On Linux there is a tool called iotop to identify processes with heavy read/write operations. Reconfigure your system to use different disks.
  • Run the disk for a couple of days without any important data on it. Check SMART values and see if you are comfortable with it.
  • Make frequent backups of your data to prepare for disk failure. Don't use the drive as a backup medium.
  • Don't use the drive in high availability environments (with or without RAID). If you use the drive in your laptop or a PC without RAID, make sure to have a spare drive at hand and make daily backups.

Why should I go through all this and not buy a new drive? At least its more reliable and the higher price will pay off.

Even new drives might fail within a couple of days or weeks without any prior signs. There is no guarantee that a drive - new or old - will not stop working from one second to the next. Of course older drives are more likely to fail than new drives (see MTBF / load/unload cycles / power-on hours / warranty duration of your drive specification data-sheet).

But if you prepare carefully for disk failures and minimize the risk, you can save some money and spend it for that brand new SSD drive that will be out on the market in one year. SSD technology is progressing rapidly and it might be worth waiting for the prices to drop.


Farmville 2 on Ubuntu Linux (Flash)

If you have trouble running Farmville 2 on you Linux installation in your browser, you should consider upgrading to the latest Ubuntu 16.04 version. I was experiencing some strange problems with an older Ubuntu 14.04 installation and from one day to the next could not run Farmville 2 any longer:

  • Farmville 2 was showing the initial loading screen with the progress bar right in the center, but the progress bar was not moving at all. There was no sound, no error message. Other flash applications were working fine.
  • I tried different browsers with no success: Chromium, Google Chrome, Firefox
  • I tried different Flash versions with no success: adobe flash, pepperflash

Upgrading to Ubuntu 16.04 (see one of my previous posts) solved the problem. I am using the following versions:

  • Chromium (chromium-browser 50.0.2661.102)
  • Flash (pepperflashplugin-nonfree 1.8.2, flash version

Make sure your browser is using the right flash plugin by typing "about:plugins" in the address bar of your Chromium browser (UPDATE: this page is not working anymore, s. It might be that you have several flash versions installed on your computer and Chromium is using an old one. Check your flash version on the official Adobe website:

Chromium is storing flash plugin information in the folder /etc/chromium-browser/customizations. For every installed flash plugin, there is a flash configuration file:

  • 10-flash (adobe-flashplugin / flashplugin-installer)
  • pepperflashplugin-nonfree (pepperflashplugin-nonfree)

Move the file of the flash package you are not using to a backup location and restart Chromium. The flash configuration file also sets the file location of the flash plugin that gets loaded into your browser. Make sure the plugin file path is pointing to the official flash plugin shared object (/usr/lib/pepperflashplugin-nonfree/

With that configuration I am now able to run Farmville 2 on Facebook and use all of its features (which were not all working before either):

  • Full screen mode
  • Sound on/off toggle
  • Screenshot


  • Flash is known to have frequent security issues. If you do not absolutely need Flash, you should remove it from your computer.
  • If you choose to install it, at least make sure to only run Flash applications after you have confirmed them manually. Both Firefox and Chrome/Chromium allow you to configure this option.
  • You might also want to install a second browser without Flash for regular internet surfing, and only use your Flash enabled browser for Farmville 2.
  • Make sure to regularly update your Flash package as soon as there is a new version available.

Seagate 3,5" disk drives

You clearly see that SAS is only used for the highest performance requirements. All other fields of operation are taken over by SATA, which is equal in reliability and enterprise features. If you don't need that extra bit of performance, you should consider using SATA drives especially for NAS or cloud storage. SAS drives offer less capacity and are much more expensive (TCO, not counting IOPS).

If you are interested in SSDs, consider the following:
- Compare DWPD (Drive Writes Per Day) to warranty period
- Compare TBW (Terra Bytes Written) to drive size
- Match your workload to endurance option, there are huge price differences

up to 8 TB
16-256 MB cache
144-220 MB/s
300,000 load cycles
4.0-7.2 W power in idle mode
2 years warranty

Desktop SSHD
up to 4 TB
64 MB cache
180-210 MB/s
300,000 load cycles
ca. 6.2 W power in idle mode
3 years warranty

up to 6 TB
64-128 MB cache
180-216 MB/s
1,000,000 hours MTBF
2.5-7.2 W power in idle mode
3 years warranty

Enterprise NAS
up to 8 TB
7200 RPM
128-256 MB cache
216-230 MB/s
1,200,000 hours MTBF
4.5-6.9 W power in idle mode
5 years warranty

up to 8 TB
128 MB cache
180-190 MB/s
300,000 load cycles
800,000 hours MTBF
3.5-5 W power in idle mode
3 years warranty

Terascale (scale-out storage)
4 TB
64 MB cache
140-170 MB/s
300,000 load cycles
800,000 hours MTBF
4,59 W power in idle mode
3 years warranty

Kinetic (ethernet interface, object data storage API)
4 TB
64 MB cache
60 MB/s
800,000 hours MTBF
300,000 load cycles
3 years warranty

Enterprise Capacity (SAS + SATA)
8 TB
7200 RPM
256 MB cache
up to 237 MB/s
2,000,000 hours MTBF
0.44% AFR
9 W power in idle mode
5 years warranty

Enterprise 10K (SAS)
up to 1.8 TB
10,000 RPM
128 MB cache
108-241 MB/s
0.44% AFR
3.88-4.55 W power in idle mode
5 years warranty

Enterprise 15K (SAS)
up to 600 GB
15,000 RPM
128 MB cache
160-250 MB/s
0.44% AFR
4.8-5.3 W power in idle mode
5 years warranty


Western Digital 3,5" disk drives

Because of its inexpensive price, WD drives are very well suitable for SOHO markets. Most of them have a SATA interface unless otherwise noted. SAS drives usually consume more power, but despite of having a smaller cache they range at the upper scale of performance compared to similar SATA drives.

The new SATA "Gold" models even outperform SAS drives. They are hermetic sealed (unlike regular magnetic drives) and filled with helium gas to reduce friction.

Caviar Green (cool, quiet, decreased power)
up to 3 TB
110 MB/s (123-150 MB/s for *ZRX/*ZDX models)
Intellipower, so no fixed rotational speed (RPM)
64 MB cache
300,000 load cycles
2.1-5.5 W power in idle mode (less power for *ZRX/*ZDX models)
2 years warranty

Green (cool, quiet, decreased power)
up to 4 TB
ca. 150 MB/s
Intellipower, so no fixed rotational speed (RPM)
64 MB cache
300,000 load cycles
2.5-3.3 W power in idle mode
2 years warranty

Caviar Blue (standard desktop)
up to 1 TB
126-150 MB/s
7200 RPM
8-64 MB cache
300,000 load cycles
4.9-6.1 W power in idle mode
2 years warranty

Blue (standard desktop, energy efficient for non *X models)
up to 6 TB
126-175 MB/s (>= 147 MB/s for *Z?? models)
5400 RPM (7200 RPM for *X models)
16-64 MB cache
300,000 load cycles
2.5-3.4 W power in idle mode (>= 4.9 W for *X models)
2 years warranty

Caviar Black (desktop performance)
up to 2 TB
126-150 MB/s
7200 RPM
64 MB cache (32 MB for *LX model)
300,000 load cycles
5.6-8.2 W power in idle mode
5 years warranty

Black (desktop high performance)
up to 6 TB
150-218 MB/s
7200 RPM
64-128 MB cache
300,000 load cycles
6.1- 7.6 W power in idle mode (8.1 W for *FZEX models)
5 years warranty

Purple (Surveillance)
up to 10 TB
110-210 MB/s
5400 RPM
64-256 MB cache
300,000 load cycles
2.9 - 5.7 W power in idle mode
3 years warranty

Red / Red Pro (NAS Storage, *CX models are 2,5", *FF?? are Pro models and faster)
up to 10 TB (up to 1 TB for *CX models)
147-214 MB/s (144 MB/s for *CX models)
Intellipower, so no fixed rotational speed (7200 RPM for *FF?? Pro models)
64-256 MB cache (16 MB for *CX models)
600,000 load cycles
1,000,000 hours MTBF
2.3-5.2 W power in idle mode (0.6 W for *CX models, >= 4.9 W for *FF?? Pro models)
3 years warranty (5 years warranty for Pro models)

Gold (Enterprise-class Storage, HelioSeal Technology)
up to 10 TB
184-249 MB/s
7200 RPM
128-256 MB cache
600.000 load cycles
2,000,000 - 2,500,000 hours MTBF
5.0 - 7.1 W power in idle mode
5 years warranty

Re (RAID Edition)
up to 6 TB
128-225 MB/s
7200 RPM
32-128 MB cache
600,000 load cycles
1,200,000-2,000,000 hours MTBF
0.63% AFR
4.4-9.2 W power in idle mode
5 years warranty

RE4-GP (RAID Edition Green Power)
3.7-4.0 W power in idle mode

Caviar Re (RAID Edition with PATA interface)

Se (Datacenter capacity, increased reliablity)
up to 6 TB
164-214 MB/s
7200 RPM
64-128 MB cache
300,000 load cycles
800,000-1,200,000 hours MTBF
4.6-8.1 W power in idle mode
5 years warranty

Ae (Datacenter archive, spin-down capability for cold data)
6 TB
> 150 MB/s
5760 RPM
64 MB cache
300,000 load cycles
500,000 MTBF
4.8 W power in idle mode
3 years warranty

Xe (Datacenter, SAS)
up to 900 GB
204 MB/s
10.000 RPM
32 MB cache
600,000 load cycles
2,000,000 hours MTBF
5.2 W power in idle mode
5 years warranty



Open Source Press is closing

Open Source Press is closing down by the end of the year. So this is your last chance to buy some of their books or ebooks from their website. You will get them from Amazon or for a while longer, but eventually they will run out of stock too.

I own 13 of their printed books, and they are all of good quality. They offer ebooks too. Some (e)books are in English, but most are German.

Merry christmas and a happy new year.



Browser blank page / white page with php script (WordPress, etc.)

I recently had a completely white / blank browser page when I tried to reset my WordPress password. It was from a local WordPress installation on my Debian 8 Jessie server. I was resetting my password for the admin login. It turned out that there was a problem with my php.ini settings. I had to add the following paths to the open_basedir variable:

open_basedir = /usr/share/php:/usr/share/php5

When resetting the WordPress password, WordPress includes some php files to send a reset email in wp-includes/pluggable.php:

require_once ABSPATH . WPINC . '/class-phpmailer.php';
require_once ABSPATH . WPINC . '/class-smtp.php';

The problem is that with the standard wordpress package on Debian 8 Jessie, class-phpmailer.php and class-smtp.php are symbolic links to /usr/share/php/... . If this path is not included in open_basedir, the php script just terminates without sending any error messages. I couldn't find anything in the apache logs either. The browser showed a blank page.

This might also be a problem with other php web applications. So if you experience a similar situation (no output of php script, blank page) you might want to check the open_basedir variable in you php.ini and make sure that all required / included php files and symbolic links are part of it.

If you have any ideas how to find out if a php script is trying to include a file outside of open_basedir, please leave a comment.


CSL 300 Mbit/s wifi adapter with Debian 8 Jessie

The CSL 300 Mbit/s wifi adapter is available at Amazon and is an inexpensive wifi USB adapter for Linux. It supports 802.11 b/g/n, WPA2, and has an external antenna adapter.

It identifies as follows with "sudo lsusb":

Bus 003 Device 002: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter

The loaded kernel module is "r8712u" (check with "sudo lsmod | grep r8712u").

To make it work with Debian Jessie, all you need to do is to install the standard Debian package "firmware-realtek". The output in "kern.log" after installing the package and plugging in the USB adapter should look something like this:

Sep 27 13:50:37 computername kernel: [    9.617950] r8712u: module is from the staging directory, the quality is unknown, you have been warned.
Sep 27 13:50:37 computername kernel: [    9.618985] r8712u: Staging version
Sep 27 13:50:37 computername kernel: [    9.619009] r8712u: register rtl8712_netdev_ops to netdev_ops
Sep 27 13:50:37 computername kernel: [    9.619014] usb 4-2: r8712u: USB_SPEED_HIGH with 4 endpoints
Sep 27 13:50:37 computername kernel: [    9.619553] usb 4-2: r8712u: Boot from EFUSE: Autoload OK
Sep 27 13:50:37 computername kernel: [   10.284174] usb 4-2: r8712u: CustomerID = 0x000a
Sep 27 13:50:37 computername kernel: [   10.284178] usb 4-2: r8712u: MAC Address from efuse = 20:ac:3f:b9:b9:b9
Sep 27 13:50:37 computername kernel: [   10.284181] usb 4-2: r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
Sep 27 13:50:37 computername kernel: [   10.284258] usbcore: registered new interface driver r8712u
Sep 27 13:50:37 computername kernel: [   10.348992] usb 4-2: firmware: direct-loading firmware rtlwifi/rtl8712u.bin