Skip to content

Instantly share code, notes, and snippets.

View PharaohKJ's full-sized avatar
👺
Ten-goods come on! Working from home

ふぁらお加藤 PharaohKJ

👺
Ten-goods come on! Working from home
View GitHub Profile
@PharaohKJ
PharaohKJ / gist:d62c9ecc48d55a86d020
Created February 4, 2015 03:07
osxでconsoleにいてworking directoryのgithub上のmasterブランチを開く
open `git remote -v|grep origin|grep git@github|head -n1|sed -e 's#origin.*git@\(.*\)\:\(.*\).git.*#https:\/\/\1\/\2\/#'`tree/master/$(pwd |sed -e "s|`git rev-parse --show-toplevel`/||")
[pharaohkj]$ defaults write com.apple.dock expose-animation-duration -float 0.15; killall Dock
[pharaohkj]$ defaults write com.apple.dock expose-animation-duration -int 0; killall Dock
git checkout --orphan <new_branch>
git rm -rf .
<create document files>
git add .
git commit
@PharaohKJ
PharaohKJ / gist:ceb2081a94f2066dcfe8
Created May 28, 2015 03:41
show_md_style_link_bookmarklet
javascript:(function(){window.prompt('選択してコピーしてください','['+document.title+']'+'('+document.URL+')');})();
@PharaohKJ
PharaohKJ / history_of_install_jenkins_on_sakura_vps
Last active December 17, 2015 01:58
jenkins install command log
1002 yum list installed|grep java
1003 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
1004 sudo rpm --import http://pkg.jenkins-ci.org/redhat-stable/jenkins-ci.org.key
1005 sudo yum install jenkins
1006 yum list installed|grep java
1007 sudo yum install java-1.7.0-openjdk
1008 java -version
1009 sudo yum install jenkins
1010 sudo service jenkins start
1011 sudo chkconfig jenkins on
@PharaohKJ
PharaohKJ / iptables
Created May 7, 2013 15:48
http://www.imosan-works.com/archives/1074 よりパクらせてもらった設定のメモ。sshのポートは隠すよ。
*filter
# INPUTチェイン宣言(全ての入力パケットを許可する)
:INPUT ACCEPT [0:0]
# FORWARDチェイン宣言(全ての転送パケットを許可する)
:FORWARD ACCEPT [0:0]
# OUTPUTチェイン宣言(全ての出力パケットを許可する)
:OUTPUT ACCEPT [0:0]
#Firewallのセッティング
:Firewall-setting1-INPUT - [0:0]
@PharaohKJ
PharaohKJ / history_of_install_jenkins_on_my_ubuntu
Created May 8, 2013 06:48
apt-get jenkinsしたあとに、バージョンが古いので本家からインストールしようとしたら結構ハマった。 たぶん最初のsudo apt-get remove jenkinsを **sudo apt-get --purge autoremove jenkins** にしてればさっくりいったんだと思われる。
2009 sudo apt-get remove jenkins
2010 cd tmp/
2011 wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
2012 sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
2013 sudo apt-get update
2014 sudo apt-get install jenkins
2015 whoami
2016 ls /usr/share/jenkins/jenkins.war
2017 ls /usr/share/jenkins/jenkins.war -al
2018 ls /usr/share/jenkins/
@PharaohKJ
PharaohKJ / Makefile
Last active December 17, 2015 04:59
間違えて非公開にしちゃったので公開で。redmineをupdateしたあとに入力するコマンド忘れるのでMakefileにしておきます。
## Redmineをアップデートしたら叩くmake
## make update
## としてくれ
# DBのアップデート
migration:
rake db:migrate RAILS_ENV="production"
# キャッシュの削除
clean_cache:
@PharaohKJ
PharaohKJ / thunderbird_with_log.sh
Created May 22, 2013 10:03
debug smtp log for thunderbird
export NSPR_LOG_FILE=/tmp/smtplog.log
export NSPR_LOG_MODULES=IMAP:5,SMTP:5,POP3:5
thunderbird
gvim /tmp/smtplog.log
@PharaohKJ
PharaohKJ / randompass.sh
Created June 22, 2013 08:34
A-Za-z0-9_でのパスワード生成シェル 数字は文字数
tr -dc A-Za-z0-9_ < /dev/urandom | head -c 12 | xargs