Skip to content

Instantly share code, notes, and snippets.

View harasou's full-sized avatar

SOGO Haraguchi harasou

View GitHub Profile
#!/bin/bash -exv
readonly MAINTAINER="harasou <harasou5@gmail.com>"
readonly REPOSITORY="harasou/centos-core"
function usage(){
cat<<EOD 1>&2
Usage:
$0 version
[root@localhost vagrant]# ll /etc/httpd/conf.d/
total 20
-rw-r--r--. 1 root root 366 10月 19 20:39 README
-rw-r--r--. 1 root root 2926 10月 19 20:39 autoindex.conf
-rw-r--r--. 1 root root 1252 10月 19 16:44 userdir.conf
-rwxr-xr-x. 1 root root 210 2月 10 22:00 vhost.conf
-rw-r--r--. 1 root root 824 10月 19 16:44 welcome.conf
[root@localhost vagrant]#
[root@localhost vagrant]# ll /etc/httpd/conf.exbind/
total 0
@harasou
harasou / fuse.h
Last active December 5, 2017 04:55
libfuse で Hello World !
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU LGPLv2.
See the file COPYING.LIB.
*/
#ifndef _FUSE_H_
#define _FUSE_H_
@harasou
harasou / gist:d43867621030e74ff3af
Created January 6, 2015 15:16
nc コマンドで whois サーバに問合せする
echo -ne "google.co.jp\r\n" | nc whois.jp 43 | iconv -f ISO-2022-JP -t utf8
cat <<'EOD' | ./main {query}
{
"services": [
{"name":"lolipop", "url":"http://munin001.phy.lolipop.jp/munin/"},
{"name":"minne", "url":"http://manage001.minne.com/munin/"},
{"name":"muumuu", "url":"http://manage01.muumuu-domain.com/munin/"},
{"name":"heteml", "url":"http://munin.heteml.jp/munin/"}
]
}
EOD
@harasou
harasou / file0.txt
Last active August 29, 2015 14:06
markdown + remark.js + gh-pages でプレゼン資料を公開する ref: http://qiita.com/harasou@github/items/1fa3cca6ac1ef175c876
# サンプルをダウンロード
git clone git@github.com:harasou/slides.git
# ブラウザで開く
open slides/sample.html
# ブラウザが Google Chrome の場合
open -a "Google Chrome" --args --allow-file-access-from-files $(pwd)/slides/sample.html
@harasou
harasou / index.html
Last active August 29, 2015 14:06
remark.js sample
<DOCTYPE html>
<html>
<head>
<title>Presentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);

スライド1ページ目

--

1ページめに追記

--

さらに追記

@harasou
harasou / bash
Created August 24, 2014 08:21
シェルスクリプトで IPアドレス計算 ref: http://qiita.com/harasou@github/items/5c14c335388f70e178f5
$ ip2decimal 192.168.0.1
3232235521
$ decimal2ip 3232235521
192.168.0.1
$
$ ip2decimal 255.255.255.0
4294967040
$ cidr2decimal 24
4294967040