- Rasbianで動作確認済み。Linuxとして動くようにしておこう
- Raspberry Piのroot権限で動く。液晶の通信のためにやむなし
mkdir /root/pl; cd /root/pl
して、fileを全部ぶっこむ。サウンドファイルとかは自分で調達しよう- Raspberry PiのシステムPerlに
HiPi
を入れた後cpanm
入れてCarton
入れたあと、cd /root/pl
してcarton install
すると、必要なモジュールが/root/pl/local
以下にわんさか入る。 /root/.lcd.yaml
に、Twitterから取得したAPIキーなどを入れる。あと自分のアカウントのscreen_name
も入れる。/root/pl/lcd.pl
で液晶にドットが表示されて、タイムラインで反応があったら1が表示される。/etc/init.d/skelton
を/etc/init.d/lcd
にコピーして、起動スクリプトを作ろう。- なにやら設定すると、次回から自動的にLCDにタイムラインの様子が表示されるぞ!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* JenkinsのCSS設定を変更 */ | |
@import url('http://fonts.googleapis.com/css?family=Inconsolata'); | |
/* フォントに Meiryoを使う */ | |
body, table, form, input, td, th, p, textarea, select { | |
font-family: Verdana, Meiryo, Helvetica, sans serif; | |
/* JenkinsのCSSでp要素は 11px に指定されている */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/env perl | |
# サイボウズガルーンのDBに潜って書き込みの時間帯の分布をみるよ。 | |
# メンテナンス時間決めるときに書き込み少なさそうな時間を選んだりするのに使おう。 | |
use strict; | |
use warnings; | |
use DBI; | |
use DateTime; | |
my $password = 'xxxxxxxx'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Raspberry Pi直結型 LED/ボタン/ブザーアドオンボード | |
# MS100A用Perlアクセスサンプル | |
# CPANのDevice::BCM2835 が必要で、それをインストールする | |
# には http://www.airspayce.com/mikem/bcm2835/ から | |
# bcm2835-1.xx.tar.gz をダウンロードしてビルドする必要が | |
# あるよ。これを実行するときはroot権限が必要だよ。 | |
# Raspbian にplenv+cpanm+cartonでPerl 5.20.0入れた環境で | |
# テストしたよ。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Raspberry Pi用Adafruit RGB-backlit LCD plateのPythonライブラリ | |
# https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/blob/e28539734dfbd6965395f0f0478ecad44ca0eaea/Adafruit_CharLCDPlate/Adafruit_CharLCDPlate.py | |
# から文字の表示とバックライトの変更の部分だけ最低限移植 | |
# Perl用I2C/SMBusアクセスライブラリHiPiを使用 | |
# http://raspberry.znix.com/p/install.html | |
# | |
# This is essentially a complete rewrite, but the calling syntax | |
# and constants are based on code from lrvick and LiquidCrystal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>mikudayo</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>say</string> | |
<string>-v</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Delayを使わないArduino時計 | |
Arduinoにはシステム時刻があって、RTCを持たないArduinoでは | |
起動時必ず1970/01/01T00:00:00Z(UNIX epoch)に初期化されています | |
Arduinoのコンパイラでは__DATE__定数と__TIME__定数が使えますので、 | |
コンパイル時に埋め込まれるこれらの定数を利用してシステム時刻を | |
設定します。 | |
当然ながら、コンパイル時にコンパイラがあるシステムの時刻が定数 | |
として埋め込まれますので、コンパイル直後以外のArduinoリセット時 | |
には時刻が狂うことになります。 | |
DS1307RTCのライブラリを参考にした。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CentOS 6.6 のシステムPHP 5.3.3を消して、phpenv/php-buildでPHP 5.6.3をビルドする | |
# rootで作業 | |
pecl uninstall apc | |
yum -y remove php php-* | |
yum -y install openssl-devel libcurl-devel libmcrypt-devel readline-devel \ | |
libtidy-devel re2c enchant-devel t1lib-devel gmp-devel libc-client-devel \ | |
libicu-devel net-snmp-devel mysql-devel libtool-ltdl-devel git libxml2-devel \ | |
libjpeg-turbo-devel libpng-devel libxslt-devel httpd-devel gcc re2c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MOTD=/etc/motd | |
if [ ! -s $MOTD ] ; then | |
tee $MOTD << EOS | |
[34m d8b 888 ® | |
[34m y8p 888 888 [36m##### # # | |
[34m 888 888 [36m# # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ `ps jax |\grep http[d]| sort -r -n -k1 | awk '{print $1}' | uniq | head -1` == 1 ] ; then killall -9 httpd ; fi |