Skip to content

Instantly share code, notes, and snippets.

View simultechnology's full-sized avatar

Takatsugu Ishikawa simultechnology

View GitHub Profile
---
- hosts: all
sudo: yes
tasks:
- name: add a new user
user: name=ishikawa
- name: install libselinux-python
yum: name=libselinux-python state=latest
- name: insall vim
yum: name=vim state=latest
@simultechnology
simultechnology / setup_ansible_and_vagrant.md
Last active August 29, 2015 14:06
setup dev environment

Setup Dev Environment Guide

Install ansible

$ brew update  
$ brew install ansible  

Setup vagrant

$ vagrant box list  
@simultechnology
simultechnology / couple.html
Last active August 29, 2015 14:00
coupleの組み合わぜを決めるhtml
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
</head>
<body>
<script>
/**
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
}
var t = true;
function aa() { return !t && 23 || 77 };
aa(); //77
t = false;
aa(); //23
@simultechnology
simultechnology / gist:5764158
Created June 12, 2013 10:04
change values of associative array
function prefixToArray($prefix, $arr) {
$prepend = function($val) use ($prefix) {
return $prefix . $val;
};
return array_map($prepend, $arr);
}
$testArray =
array("A" => "test",
@simultechnology
simultechnology / read_csv_to_sql.py
Last active December 12, 2015 09:58
csvファイルをオープンし、読み出してSQLのUPDATE文を出力します
# -*- coding:utf-8 -*-
import sys
def process_file(filename):
'''csvファイルをオープンし、読み出してSQLのUPDATE文を出力します'''
input_file = open(filename, "r")
header = input_file.readline().strip().split(',')
buffer = ''
for line in input_file:
@simultechnology
simultechnology / gist:4291989
Created December 15, 2012 07:44
The commands i think i have to get used to using.
# カレントディレクトリ以下のphpファイルのstep数をカウントする
find . -type f | grep .php | xargs wc -l
@simultechnology
simultechnology / pexec.c
Created August 1, 2012 18:04
sample code using execlp
#include <stdio.h>
#include <unistd.h>
int main(int argc, const char* argv[]) {
printf("Running ps with execlp\n");
execlp("ps", "ps", "-ax", 0);
printf("Done. \n");
exit(0);
}