Skip to content

Instantly share code, notes, and snippets.

@t-cyrill
t-cyrill / install-virtualbox.sh
Created April 22, 2013 04:38
Virtualbox Install Script for debian squeeze
#!/bin/bash
echo 'deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free' >> /etc/apt/sources.list.d/virtualbox.list
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
apt-get update
aptitude install virtualbox-4.2
@t-cyrill
t-cyrill / install-vagrant.sh
Last active December 16, 2015 12:09
vagrant install script
#!/bin/bash
sudo gem install vagrant
vagrant box add debian http://ergonlogic.com/files/boxes/debian-current.box
Vagrant::Config.run do |config|
config.vm.box = "debian"
config.ssh.port = 1022
config.vm.forward_port 22, 1022
config.vm.forward_port 80, 1080
config.vm.network :hostonly, "192.168.50.11"
config.vm.host_name = "vg001"
config.vm.provision :shell, :path => "setup_user.sh"
config.vm.customize do |vm|
#!/bin/bash
cd /tmp
wget http://redis.googlecode.com/files/redis-2.6.13.tar.gz
tar xf redis-2.6.13.tar.gz
cd redis-2.6.13
make
cp src/redis-server src/redis-cli /usr/local/bin/
mkdir /etc/redis
@t-cyrill
t-cyrill / build-tmux.sh
Last active July 25, 2016 21:44
build tmux 1.8 on debian squeeze
#!/bin/bash
wget "https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz"
tar -xf libevent-2.0.21-stable.tar.gz
./configure
make
make verify
sudo make install
@t-cyrill
t-cyrill / recipe.md
Last active December 18, 2015 01:59

豚肉とピーマンの中華風炒め

材料

  • 豚バラ肉(細切れでもOK)
  • 150g ~ 200g
  • ピーマン
  • 中3個
  • 甜麺醤
  • 大さじ 1/2強
  • オイスターソース
@t-cyrill
t-cyrill / setup_munin-node_memcached.sh
Created June 7, 2013 03:20
Setup debian's munin-node for memcached.
#!/bin/bash
apt-get install munin-plugins-extra libcache-memcached-perl
cd /etc/munin/plugins
ln -sf /usr/share/munin/plugins/memcached_ memcached_bytes
ln -sf /usr/share/munin/plugins/memcached_ memcached_counters
ln -sf /usr/share/munin/plugins/memcached_ memcached_rates
/etc/init.d/munin-node restart
@t-cyrill
t-cyrill / ImagickFilter.php
Created June 27, 2013 06:08
PHP imagick wrapper
<?php
class ImagickFilter {
private $imagick;
private function __construct($imagick)
{
$this->imagick = clone $imagick;
$this->imagick->profileImage('*', null);
}
<?php
echo json_encode(json_decode(stream_get_contents(STDIN)), JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);
<?php
$path_samples = array(
'/temp/hoge/foo',
'/temp/./hoge/foo',
'/temp//hoge/foo',
'/temp///hoge/foo',
'/temp//bar/../hoge/foo',
'/temp/bar/../../../..//temp//bar/../hoge/foo',
'/temp/bar/../../../..//temp//bar/../hoge/foo////',