Skip to content

Instantly share code, notes, and snippets.

View superbrothers's full-sized avatar
🌏
Working from the earth

Kazuki Suda superbrothers

🌏
Working from the earth
View GitHub Profile
package main
import (
"math/rand"
"fmt"
"strings"
)
var words = []string {
"ボ",
cat Dockerfile
# 4.3.12 should probably be something like 4.3.10 or somesuch
#
FROM boot2docker/boot2docker
RUN apt-get install p7zip-full
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/4.3.12/VBoxGuestAdditions_4.3.12.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
@yoshikaw
yoshikaw / Screenx.rb
Created December 25, 2011 14:22
開発版GNU Screenにあてているパッチ
require 'formula'
class Screenx < Formula
homepage 'http://www.gnu.org/software/screen/'
url 'http://git.savannah.gnu.org/cgit/screen.git/snapshot/screen-master.tar.gz'
sha1 '642588a585fca1def67bd85172addf9cd0a0c745'
version '4.1.0-20110819git450e8f3'
head 'git://git.savannah.gnu.org/screen.git', :branch => 'master'
@riywo
riywo / dstat_log.pl
Created March 18, 2012 06:31
dstatのCSVをその場でパースしてなんかする方法
#!/usr/bin/env perl
use strict;
use warnings;
use POSIX qw/mkfifo/;
use File::Temp qw/tempfile/;
use Scalar::Util qw/looks_like_number/;
use IO::Handle;
my $log_file = '/tmp/dstat.log';
my (undef, $pipe) = tempfile("dstat_XXXX", DIR => '/tmp', SUFFIX => '.pipe');
@detro
detro / script-FIXED.js
Created October 8, 2012 17:05 — forked from davisford/script-log.js
phantom cookies: now cookies are PERSISTENT as expected
var page = require('webpage').create();
phantom.cookiesEnabled = true;
console.log('\n\n cookies we know about => \n\n' + JSON.stringify(phantom.cookies, null, 2));
// spoof user-agent
page.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0';
const USER = 'cvUg338yQa';
const PASS = 'GNyoqNKJK5';
@mirakui
mirakui / compile_assets_and_rsync_with_remote_cache.rb
Created November 15, 2012 13:19
Fast deploy using capistrano_rsync_with_remote_cache and turbo-sprockets-rails3
# Requirements:
# https://github.com/vigetlabs/capistrano_rsync_with_remote_cache
# https://github.com/ndbroadbent/turbo-sprockets-rails3
require 'capistrano/recipes/deploy/strategy/rsync_with_remote_cache'
Capistrano::Deploy::Strategy::RsyncWithRemoteCache.class_eval do
def deploy!
update_local_cache
prepare_assets
update_remote_cache
finalize_assets
@clicube
clicube / spec_helper.rb
Last active December 14, 2015 02:59
To use SimpleCov with fork, add this code to spec_helper.rb
pid = Process.pid
SimpleCov.at_exit do
SimpleCov.result.format! if Process.pid == pid
end
@kozy4324
kozy4324 / shared_serverspec.md
Last active December 19, 2015 19:29
serverspecをshared_examplesを使ってRole毎のspecを分けてみる

serverspecをshared_examplesを使ってRole毎のspecを分けてみる

spec/_role以下にspecファイルを分離してみた.

$ tree spec/
spec/
├── _role
│   ├── cloudforecast_spec.rb
│   ├── growthforecast_spec.rb
@yifan-gu
yifan-gu / dex-kubernetes.md
Last active May 8, 2019 06:52
dex/kubernetes guide

Create CA cert/key files

In order to enable oidc authenticator in kube-apiserver, we need to have TLS enabled between kubectl and kube-apiserver, as well as between kube-apiserver and OpenID Provider(dex-worker here)

For simplicity, we will use cfssl to create the bundles.

Start dex worker

Checkout and build dex

@apsoto
apsoto / base.rb
Created March 7, 2011 18:11 — forked from jtimberman/base.rb
a sample base chef role
name "base"
description "Baseline configuration for all systems."
run_list(
"recipe[ohai]",
"recipe[chef-client::delete_validation]",
"recipe[chef-client]",
"recipe[zsh]",
"recipe[git]",
"recipe[users]",