Counting files in large directories

This weekend I was running some processes, which created > 100k files in directories. To monitor the process, I felt it beneficial to just check the number of files from time to time.

in macOS (and other Unix based Operating Systems) you can count the number of files in a directory with the following shortcut:

ls | wc -l

PHP File Upload with UPLOAD_ERR_INI_SIZE

If you created a multipart/form-data form to upload a file to your server and it gives you an error 1 (UPLOAD_ERR_INI_SIZE) , you need to update the php.ini for your machine.

PHP.ini is usually found in /etc/  directory of your server. On my AWS AIM Linux instance the current PHP Version is 5.6 and thus the file to edit is /etc/php-5.6.ini

Edit the ini file to find the  upload_max_filesize variable and update it to something more appropriate for your needs. The default on my instance was 2M and that caused me headaches no end.

To reload the php.ini you can ask the server to gracefully restart apache with  sudo apachectl -k graceful

Translations with gettext() and POEdit not working on your Ubuntu server?

I tried to get gettext() translations going on a Ubuntu 16.04.2 server and while the code was solid, there was one major bit missing – the locale was not available on the server.

So if you have the same problem – simply run for each locale you plan to support:

So what does it do?

Compiled locale files take about 50MB of disk space, and most users only need few locales. In order to save disk space, compiled locale files are not distributed in the locales package, but selected locales are automatically generated when this package is installed by running the locale-gen program.

Source: https://www.systutorials.com/docs/linux/man/8-locale-gen/

Welcome

This page will basically be a home to my various development projects. I haven’t really done much yet, but hope to bring out some blog posts surrounding “OtzPlane” soon. So stay tuned…