nginx: 413 Request Entity Too Large – File Upload Issue

I got above error message in nginx. Stackoverflow post 413 Request Entity Too Large – File Upload Issue had all information to resolve the issue. The solution was written by User Arun.

One has to edit /etc/nginx/nginx.conf

client_max_body_size 15900M

and /etc/php/php.ini

; Maximum allowed size for uploaded files.
upload_max_filesize = 15900M

; Maximum amount of memory a script may consume (128MB)
memory_limit = 6900M

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
post_max_size = 25900M

Besides editing /etc/nginx/nginx.conf and /etc/php/php.ini I had to stop nginx and php-fpm:

systemctl stop nginx
systemctl stop php-fpm

so the changes take effect.

After starting the two services then check with phpinfo().

Small Scale Computing

Below is a short overview of small scale computers for use in embedded computing.

  1. Intel Galileo, single core Quark/Pentium, ca. 100 USD, <15 W
  2. Intel Edison, dual core Atom Silvermont, 500 MHz, ca. 100 USD, <1 W
  3. Raspberry Pi, single core ARM, 700 MHz, ca. 35 USD, ~1 W
  4. Arduino series, e.g., Intel Quark/Cortex, 32 MHz, ca. 15 USD, ~1 W
  5. ESP8266 (spec), single core Tensilica Xtensa LX106, 80 MHz, 7 USD, 1 mW

On the other end of the spectrum there are Mini PCs.

  1. Intel NUC, quadcore Intel i5/i7, ca. 400 USD (no SSD+no RAM), 6-60 W
  2. Apple Mac Mini, Intel i5/i7, ca. 500 USD, 6-85 W
  3. Apple Mac Pro, Intel 3.5 GHz 6-Core Intel Xeon E5, ca. 4,000 USD, <450 W

Now comes the fun part: connecting many small scale computers to a cluster.

Connecting 64 Raspberry Pi running MPI and putting them all into a Lego frame, see Raspberry Pi at Southampton.

Clustering 48 PandaBoards and putting this all into an industrial trashcan, see Phoronix: Building A 96-Core Ubuntu ARM Solar-Powered Cluster.

Clustering ten Intel NUCs each with 10GB RAM: Orange Box, see The Orange Box: Cloud for the Free Man, motto: Most planes fly in clouds…this cloud flies in planes!

Mac Pros are offered in the cloud, see Dedicated Mac Pro server hosting.

Working with Windows Junctions in Python

I had to detect Windows junctions (similar but not identical to symbolic links) in Python. On I read the following Python code given by a user named eryksun for handling them, as os.islink() does not work for junctions.

The routines access Windows functions CreateFileW(), DeviceIoControl(), CloseHandle() in kernel32.

Continue reading

Suppressing Advertisement on Web-Pages a.k.a. Ad-Blocking

Advertisements on web-pages is ubiquitous. Without advertisement even this blog could not be offered free of charge. But advertisement can be a real nuisance with its blinking, flickering, moving, and distracting appearance. Sometimes they even contain malware.

There are two simple remedies for this problem:

  1. use an adblocker plug-in for your browser
  2. modify your /etc/hosts file

The first one is easy to accomplish, but sometimes web-pages no longer work as expected. The second approach is in some ways more direct and more brutal, and leaves visual clues on the web-pages that brute force has been applied.

Editing /etc/hosts on your Linux desktop is easy. On Android you connect via adb shell, switch to root user with su, then

mount -o remount,rw /system

i.e., remount the /system directory from read-only to write-enabled, then edit /etc/hosts. Either reboot your smartphone, or

mount -o remount,ro /system

I use the following list of hosts in my /etc/hosts, which has a somewhat German felling: Continue reading

Upgrading from OxygenOS 1.0.0 to 1.0.3 on the OnePlus One Smartphone

I upgraded my OnePlus One smartphone from Oxygen 1.0.0 to 1.0.3, see Installing OxygenOS 1.0 on the OnePlus One Smartphone.

Download OxygenOS 1.0.3 from OxygenOS 1.0.3 with the latest Stagefright patches, and check MD5. Then upload the zip-file.

adb push ~/Download/ /sdcard/

It is stated in Oxygen 1.0.2 Release with Stagefright security patches that “If you are already on OxygenOS, this update does not require a reset.” I had to factory reset my phone as TWRP didn’t recognize the system partition; it was encrypted, although encryption in my previous efforts never worked. It looks like it worked for TWRP only.

Shut down phone, and reboot with power-button and volume-down pressed, boot into TWRP, select your image on /sdcard. That’s it.

These are the versions displayed:

  1. Android version 5.0.2
  2. OxygenOS version 1.0.3
  3. Kernel version 3.4.0-perf-g2e81366, #1
  4. Build date 27-Aug-2015
  5. Build number A0001_12_150827

Using OxygenOS 1.0.3 I noticed the following:

  1. Battery consumption is still high.
  2. It is no longer possible to initiate SIP calls with the build-in telephone application, although you may still receive SIP calls, see also shahazadkm in OnePlus forum.
  3. Apps apparently no longer install automatically after factory default.
  4. I didn’t try encryption as this was a fiasco in OxygenOS 1.0.0.

For an answer as why not update to a higher OxygenOS version see OxygenOS 2.0 Q&A:

As for all of you wondering when the OnePlus One will get an update to the latest OxygenOS version, the answer is that we are working on it but the official date is not quite set yet. Since 2.0 is optimized for Snapdragon 810, it will take us a bit of time to port things over. In the meantime, the OnePlus One will still be officially supported by CM.

The OnePlus One has a Snapdragon 801.

See also Marshmallow upgrade schedule for OnePlus devices:

For the OnePlus One, Cyanogen OS will be updating to Marshmallow in the first quarter of 2016. We created a community build of OxygenOS for the OnePlus One, but this isn’t what the product officially ships with. We will be updating the community build of OxygenOS for the OnePlus One when time allows.