Skip to content

Instantly share code, notes, and snippets.

View yuuichi-fujioka's full-sized avatar

yuuichi fujioka yuuichi-fujioka

View GitHub Profile
@yuuichi-fujioka
yuuichi-fujioka / show veth peer.sh
Created September 22, 2014 00:38
show veth peer with ethtool
#!/bin/bash
sudo ethtool -S ${interface_name}
@yuuichi-fujioka
yuuichi-fujioka / userdata
Created September 21, 2014 23:39
set password with cloud-init.
#cloud-config
password: mysecret
chpasswd: { expire: False }
ssh_pwauth: True
@yuuichi-fujioka
yuuichi-fujioka / plugin_command.sh
Created September 18, 2014 07:55
command for rabbitmq plugin
# list
rabbitmq-plugin list
# to enable
rabbitmq-plugin enable ${plugin_name}
# to disable
rabbitmq-plugin disable ${plugin_name}
@yuuichi-fujioka
yuuichi-fujioka / Dockerfile
Created September 17, 2014 01:42
http proxy with docker
FROM ubuntu:latest
MAINTAINER [email protected]
RUN apt-get update -q && apt-get upgrade -y
RUN apt-get install -y squid
EXPOSE 3128
CMD /usr/sbin/squid3 -N
@yuuichi-fujioka
yuuichi-fujioka / MyKey.cs
Created September 16, 2014 14:48
Keyable class
public class MyKey : IEquatable<Item>
{
public int no;
public bool Equals(Item other)
{
return no == other.no;
}
public override int GetHashCode()
@yuuichi-fujioka
yuuichi-fujioka / one_server.json
Created September 16, 2014 04:51
simple heat template with json
{
"heat_template_version": "2013-05-23",
"parameters": {},
"resources": {
"server1":{
"type": "OS::Nova::Server",
"properties": {
"name": "Server1",
"image": "cirros-0.3.2-x86_64-uec",
"flavor": "m1.tiny",
@yuuichi-fujioka
yuuichi-fujioka / safe_commit.sh
Created September 3, 2014 02:26
safe commit qcow2
cp ${backing_image} ${new_backing_image}
qemu-img rebase -b ${new_backing_image} ${img}
qemu-img commit ${img}
@yuuichi-fujioka
yuuichi-fujioka / gnerate-skeleton.sh
Created September 2, 2014 11:04
Alias for generate python project skeleton
alias gen-skeleton='git clone https://github.com/yuuichi-fujioka/setuptools_skeleton.git'
@yuuichi-fujioka
yuuichi-fujioka / convert_image_to_compat_0.10.sh
Created September 2, 2014 00:51
convert qcow from compat 1.1 to compat 0.10
qemu-img convert -f qcow2 -O qcow2 -o compat=0.10 ${src_img} ${dst_img}
@yuuichi-fujioka
yuuichi-fujioka / np_mid.py
Created August 19, 2014 01:25
wsgi middleware
class NPMiddleware:
def __init__(self, app):
self.app = app
def __call__(self, env, start_resp):
return self.app(env, start_resp)