<commit_before>#!/bin/bash

######
## Description:
##  This script setups a tiny tile server with h2o-tile, which only serves a small region around Tokyo, Japan.
##
## Assumed Platform: Debian 8.0 (jessie) 64bit; >=50GB storage, >=2GB RAM
##  Ubuntu latest may also work by fixing apt package names
##  (in particular, font packages tend to be named quite differently)
##
##  RHEL/CentOS can be problematic, mainly due to their outdated gcc compiler (but not actually tested myself)
##
## Notice: Before you run the script:
##  - Do NOT open ports other than 22 and 8080
##  - Do NOT mix-place your important data and codes
##  Be aware, this is NOT a production-level, security-assured setup!!
##
## Prerequisites
##
##  Some steps are performed as a user named "osm" (useradd-ed at the first step of the script), so first
##    $ visudo
##  and add:
##    Defaults        timestamp_timeout=-1
##    osm   ALL=(ALL:ALL) ALL
##  This super-permissive privilege may be discarded after the setup.
##
##  Major data files are placed as follows:
##  - PostGIS database is under /var/lib/postgresql/9.4/main, this is the default of the apt package
##  - tiles are under /opt/osm/tiles:
##      + So, your /opt must have an enough space (several tens GBs), AND
##      + I **STRONGLY RECOMMEND** to mount /opt to a **Btrfs-formatted** partition, because...
##          the tiles/ dir will contain huge, really huge number of files:
##          even with our tiny region, we will potentially have **multi-millions** of .png iamges at the maximum zoom level.
##          Good old ext4 is, certainly, not suitable t such a usecase (what if # of files gets multi-billions?)
##          On the other hand, btrfs does not limit inodes a priori.
##        Mounting a btrfs partition, in a simplest form, is:
##          $ sudo sudo apt-get -qq install btrfs-tools
##          $ sudo mkfs.btrfs -O^extref -m single /dev/part/for/tiles
##          $ sudo vi /etc/fstab # and add the following line
##          /dev/part/for/tiles  /opt       btrfs   auto,noexec,noatime,autodefrag,compress=lzo,space_cache      0       2
##          # "compress=lzo" may not be very effective.

sudo apt-get -qq update
sudo useradd -m -s /bin/bash -d /opt/osm osm

sudo apt-get -qq install sudo passwd
sudo apt-get -qq install apt-utils
sudo apt-get -qq install ntp

# All packages required are installed here.
sudo apt-get -qq install btrfs-tools
sudo apt-get -qq install lvm2
sudo apt-get -qq install g++
sudo apt-get -qq install python
sudo apt-get -qq install python-dev<commit_msg>Update make.demo-server.sh<commit_after>#!/bin/bash

######
## Description:
##  This script setups a tiny tile server with h2o-tile, which only serves a small region around Tokyo, Japan.
##
## Assumed Platform: Debian 8.0 (jessie) 64bit; >=50GB storage, >=2GB RAM
##  Ubuntu latest may also work by fixing apt package names
##  (in particular, font packages tend to be named quite differently)
##
##  RHEL/CentOS can be problematic, mainly due to their outdated gcc compiler (but not actually tested myself)
##
## Notice: Before you run the script:
##  - Do NOT open ports other than 22 and 8080
##  - Do NOT mix-place your important data and codes
##  Be aware, this is NOT a production-level, security-assured setup!!
##
## Prerequisites
##
##  Some steps are performed as a user named "osm" (useradd-ed at the first step of the script), so first
##    $ visudo
##  and add:
##    Defaults        timestamp_timeout=-1
##    osm   ALL=(ALL:ALL) ALL
##  This super-permissive privilege may be discarded after the setup.
##
##  Major data files are placed as follows:
##  - PostGIS database is under /var/lib/postgresql/9.4/main, this is the default of the apt package
##  - tiles are under /opt/osm/tiles:
##      + So, your /opt must have an enough space (several tens GBs), AND
##      + I **STRONGLY RECOMMEND** to mount /opt to a **Btrfs-formatted** partition, because...
##          the tiles/ dir will contain huge, really huge number of files:
##          even with our tiny region, we will potentially have **multi-millions** of .png iamges at the maximum zoom level.
##          Good old ext4 is, certainly, not suitable to such a usecase (what if # of files gets multi-billions?)
##          On the other hand, btrfs does not limit inodes a priori.
##        Mounting a btrfs partition, in a simplest form, is:
##          $ sudo sudo apt-get -qq install btrfs-tools
##          $ sudo mkfs.btrfs -O^extref -m single /dev/part/for/tiles
##          $ sudo vi /etc/fstab # and add the following line
##          /dev/part/for/tiles  /opt       btrfs   auto,noexec,noatime,autodefrag,compress=lzo,space_cache      0       2
##          # "compress=lzo" may not be very effective, however.

sudo apt-get -qq update
sudo useradd -m -s /bin/bash -d /opt/osm osm

sudo apt-get -qq install sudo passwd
sudo apt-get -qq install apt-utils
sudo apt-get -qq install ntp

# All packages required are installed here.
sudo apt-get -qq install btrfs-tools
sudo apt-get -qq install lvm2
sudo apt-get -qq install g++
sudo apt-get -qq install python
sudo apt-get -qq install python-dev
{'fraction_non_alphanumeric': 0.1025141297992594, 'fraction_numerical': 0.008185538881309686, 'mean_word_length': 3.060126582278481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5510865', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1541, 'n_words': 679}