Skip to content

Instantly share code, notes, and snippets.

@CLCL
CLCL / composer.json
Last active April 7, 2016 05:48
モリサワのフォント見本のページでよみかたが入ったが、どちらかというとJSONがほしいのである
{
"require": {
"php": ">=5.3.3",
"fabpot/goutte": "~1.0"
}
}
@CLCL
CLCL / composer.json
Last active April 7, 2016 05:36
composerでPHP 5.3用のgoutte(ウェブスクレーパー)をインストールする。
{
"require": {
"php": ">=5.3.3",
"fabpot/goutte": "~1.0"
}
}
@CLCL
CLCL / akizuki-7seg-10col.js
Last active March 12, 2016 06:52
秋月電子7セグメントLED DIP化キット [AE-7SEG-BOARD] 10個をRaspberry Piにつないで、数字をnode.jsで表示する。
'use strict';
// akizuki-7seg-10col.js:
// Usage:
// (Raspberry PiにRaspbian Jessieをインストールして、
// sudo raspi-config で SPI使用を有効にしてリブート後、
// piユーザでログイン)
// sudo apt-get update
// sudo apt-get -y remove nodered nodejs nodejs-legacy
// curl -LO http://node-arm.herokuapp.com/node_latest_armhf.deb
@CLCL
CLCL / a.sh
Created March 2, 2016 13:21
JenkinsCIをyum updateすると、これのせいでworkdir以下のchownが時間掛かり過ぎる JENKINS_INSTALL_SKIP_CHOWNの変数で制御できるのかな今度試す
/sbin/chkconfig --add jenkins
# If we have an old hudson install, rename it to jenkins
if test -d /var/lib/hudson; then
# leave a marker to indicate this came from Hudson.
# could be useful down the road
# This also ensures that the .??* wildcard matches something
touch /var/lib/hudson/.moving-hudson
mv -f /var/lib/hudson/* /var/lib/hudson/.??* /var/lib/jenkins
rmdir /var/lib/hudson
## ビルドツール・依存パッケージインストール
## rootユーザで作業
uname -r
yum -y groupinstall 'Development Tools'
yum -y install rpmdevtools
yum -y install kernel-devel iptables-devel
yum -y install epel-release
yum -y --enablerepo=epel install perl-Text-CSV_XS
@CLCL
CLCL / passwd_change.sh
Created November 2, 2015 11:56
シェルスクリプトでlinuxユーザのパスワードを設定
#!/bin/sh
# シェルスクリプトでwebuserユーザのパスワードをpassw0rdに設定する。
# 大量のバッチ処理の場合は、別ファイルにユーザパスワードリスト
# を用意したうえで、`chpasswd' を使おう。
echo passW0rd | passwd webuser --stdin
@CLCL
CLCL / package.json
Last active September 1, 2015 16:35
akibaLEDピカリ館の単色LEDマトリクスパネルP10をRaspberry Piのnode.jsで光らせて文字をスクロールする
{
"name": "picari-banner-gorinpikku.js",
"private": true,
"scripts": { "start": "node picari-banner-gorinpikku.js" },
"dependencies": {
"canvas": ">=1.2.7",
"onoff" : ">=1.0.2",
"pi-spi": ">=1.0.0"
}
}
@CLCL
CLCL / picari-01.js
Last active August 29, 2015 14:27
akibaLEDピカリ館で販売している単色LEDパネル(32cm×16cm)を専用基盤を使わずRaspberry Piとnode.jsを使いパターン点灯させるサンプル。Raspberry Pi(256MB以上)、Node.js 0.12で動作確認済み。
'use strict';
// akibaLEDピカリ館の単色LEDマトリクスパネルP10を
// Raspberry Piのnode.js(v0.12)で光らせる
//
// 配線については http://cl.hatenablog.com/entry/picari-ledmatrix-raspberrypi 参照
// Usage:
// (Raspberry PiにRaspbian Wheezyをインストールして、piユーザでログイン後)
// git clone https://gist.github.com/aad7b6ad8f97ca9a8a2a.git picari
// cd $_
@CLCL
CLCL / picari-01.ino
Last active November 29, 2021 00:14
#include <SPI.h>
#define OE 7
#define DYNA 8
#define DYNB 9
#define DATA 11
#define LATCH 10
#define CLK 13
char pattern[] = {
@CLCL
CLCL / epel.md
Created July 28, 2015 04:21
CentOS 6標準でEPELリポジトリ参照用パッケージを入れる

CentOS 6で、追加のリポジトリのEPELを使うことがよくありますね。tmux入れたり、grance入れたり、proftpd入れたり(今更FTPなのは察してください)、標準の状態でyumって入らない時はEPELに入っていることが多いですのでよく使いますね。

で、EPELなんだが、いつの間にか標準のパッケージになってたというやつ。

# yum -y install epel-release
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp