# dpkg-reconfigure locales # ja_JP.UTF-8 UTF-8 を選択 # dpkg-reconfigure tzdata # アジア→Tokyo を選択
deb http://ftp.jp.debian.org/debian/ jessie main contrib non-free #deb-src http://ftp.jp.debian.org/debian/ jessie main contrib non-free #deb http://security.debian.org/ jessie/updates main contrib non-free #deb-src http://security.debian.org/ jessie/updates main contrib non-free deb https://repositories.collabora.co.uk/debian/ jessie rpi2
# apt-get update # apt-get upgrade # apt-get install emacs-nox screen # apt-get install wicd-curses firmware-ralink # WiFi設定 # apt-get install curl build-essential # rpi-update
# adduser USER # gpasswd -a USER sudo
# wget -O /usr/local/bin/rpi-update https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update # chmod +x /usr/local/bin/rpi-update
# BOOT_PATH=/boot/firmware ROOT_PATH=/ rpi-update # reboot
safe_mode_gpio=4 max_usb_current=1
# fdisk /dev/mmcblk0 Command (m for help): p Disk /dev/mmcblk0: 29.5 GiB, 31657558016 bytes, 61831168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x50446648 Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 2048 249855 247808 121M c W95 FAT32 (LBA) /dev/mmcblk0p2 249856 6146047 5896192 2.8G 83 Linux Command (m for help): d Partition number (1,2, default 2): 2 Partition 2 has been deleted. Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): p Partition number (2-4, default 2): 2 First sector (249856-61831167, default 249856): Last sector, +sectors or +size{K,M,G,T,P} (249856-61831167, default 61831167): Created a new partition 2 of type 'Linux' and of size 29.4 GiB. Command (m for help): p Disk /dev/mmcblk0: 29.5 GiB, 31657558016 bytes, 61831168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x50446648 Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 2048 249855 247808 121M c W95 FAT32 (LBA) /dev/mmcblk0p2 249856 61831167 61581312 29.4G 83 Linux Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Re-reading the partition table failed.: Device or resource busy The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
# resize2fs /dev/mmcblk0p2
Linux jessie-rpi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux
total used free shared buffers cached Mem: 949328 132992 816336 12248 8396 77424 -/+ buffers/cache: 47172 902156 Swap: 0 0 0
# apt-get install nginx monit redis-server # apt-get install sqlite3 libdbd-sqlite3-perl libjson-xs-perl libdatetime-perl # apt-get install libmoose-perl libredis-perl libmojolicious-perl libwww-perl
set httpd port 2812 and use address localhost allow admin:monit
server { listen 80; location /monit/ { rewrite ^/monit/(.*) /$1 break; proxy_pass http://localhost:2812; proxy_redirect http://localhost:2812/monit /monit/; proxy_set_header Host $host; } }
check process datafetch matching "detafetch" start program = "/home/pi/detafetch/bin/datafetch.pl -log" as uid pi and gid pi stop program = "/usr/bin/pkill datafetch.pl" as uid pi and gid pi if 5 restarts within 5 cycles then unmonitor
[global] port = 1433 tds version = 8.0 client charset = UTF-8
# apt-get install debootstrap # debootstrap --arch=armvhf jessie /var/lib/container/jessie 以下のコマンドでコンテナに入る。 # systemd-nspawn -D jessie #コンテナの中 # apt-get install dbus sudo # adduser debian …省略… # gpasswd -a debian sudo # exit
# systemctl start systemd-nspawn@jessie.service ちなみに、ホスト起動時、コンテナを自動起動させる場合は、 # systemctl enable systemd-nspawn@jessie.service
# machiectl MACHINE CONTAINER SERVICE jessie container nspawn
# machinectl status jessie jessie Since: 火 2015-09-29 23:54:43 JST; 5min ago Leader: 14828 (systemd) Service: nspawn; class container Root: /var/lib/container/jessie Address: fe80::cee1:d5ff:fe17:b641 2408:10:c300:bb00:cee1:d5ff:fe17:b641 192.168.1.31 OS: Debian GNU/Linux 8 (jessie) Unit: systemd-nspawn@jessie.service tq14827 /usr/bin/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --directory=/var/lib/container/j... tq14828 /lib/systemd/systemd mqsystem.slice tqcron.service x mq14892 /usr/sbin/cron -f tqsystemd-journald.service x mq14842 /lib/systemd/systemd-journald tqconsole-getty.service x mq14899 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 vt102 mqrsyslog.service mq14894 /usr/sbin/rsyslogd -n
# machinectl login jessie