Ever had a folder with 200000 files and needed to split them into smaller folders? If so, the following code can be executed within the directory from your command prompt (terminal) to split into n directories of 10000 files each:
for f in *;
d=dir_$(printf %03d $((i/10000+1)));
mkdir -p $d;
mv "$f" $d;
Whenever I try to start Elasticsearch within Docker on my Mac, I get the following error:
[2017-11-07T11:16:00,625][INFO ][o.e.b.BootstrapCheck ] [y4U9OH5] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
max virtual memory areas vm.max_map_count  is too low, increase to at least 
To fix this problem the following should be entered in terminal
sudo sysctl -w vm.max_map_count=262144
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
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
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
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.
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…