Skip to content

Instantly share code, notes, and snippets.

View skatsuta's full-sized avatar

Soshi Katsuta skatsuta

View GitHub Profile
@skatsuta
skatsuta / mkcd
Last active August 29, 2015 14:02
mkdir and cd
mkdir -p $1 && cd $1
@skatsuta
skatsuta / ginb
Created June 1, 2014 12:01
grunt-init and npm install and bower install
grunt-init && npm install && bower install
@skatsuta
skatsuta / disasm.fsx
Created July 6, 2014 10:32
8086 逆アセンブラ 統合版
let bin = System.IO.File.ReadAllBytes "../../cc"
let mutable i = 0
let show len asm =
printf "%08X " i
for j = 0 to len - 1 do
printf "%02X" bin.[i + j]
for j = len to 8 do
printf " "
printfn "%s" asm
i <- i + len
@skatsuta
skatsuta / build.gradle
Created July 7, 2014 00:56
Scala 用 build.gradle
apply{
plugin 'scala'
plugin 'idea'
}
ext {
scalaVersion = '2.11'
spec2Version = '2.3.12'
}
@skatsuta
skatsuta / pscheck.sh
Last active August 29, 2015 14:04
プロセスの起動確認
#!/bin/bash
PROCESS=$1
PROCESS_NUM=$(ps cax | grep $PROCESS | wc -l)
# 引数チェック
if [ $# -eq 0 ]; then
echo "Usage: $0 process_name" 1>&2
exit1
fi
@skatsuta
skatsuta / menuwork.sh
Created July 16, 2014 06:10
カレントディレクトリにあるシェルスクリプトの一覧を表示して実行する
#!/bin/bash
counter=0
menu=(`ls *.sh`)
echo "### MENU ###"
for item in "${menu[@]}"; do
echo "$counter: $item"
counter=`expr $counter + 1`
done
@skatsuta
skatsuta / mysql_backup.sh
Last active August 29, 2015 14:04
MySQL で dump ファイルを出力し、scp で外部サーバに転送する
#!/bin/bash
dumpfile="dump.sql"
user="user"
host="XXX.XXX.XXX.XXX"
distdir="."
mysqldump -u root dbname > $dumpfile
scp $dumpfile $user@$host:$distdir
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@skatsuta
skatsuta / tomcat.sh
Last active August 29, 2015 14:07
Tomcat start & stop script
#!/bin/bash
CATALINA_HOME=/usr/local/src/apache-tomcat-8.0.14/
start() {
$CATALINA_HOME/bin/startup.sh
return 0
}
stop() {
@skatsuta
skatsuta / auto_ssh.sh
Created December 19, 2014 02:21
Auto login script
#!/bin/sh
auto_ssh() {
HOST=$1
ID=$2
PASS=$3
KEY=$4
expect -c "
set timeout 10