Skip to content

Instantly share code, notes, and snippets.

@okbm
okbm / scp_batch
Last active December 23, 2015 14:29
vi scp_batch_devloper
#!/bin/bash
SVC='user@hogehoge.net'
IS_FAILED='0'
HOME_DIR="/home/hogehoge/"
if [ $# -lt 1 ] ; then
echo "argument not found."
masayoshi@standard$ cat my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#!/bin/bash
function print_help () {
cat <<__EOF__
Usage: $0 <opt> <path>
Options
-n dryrun
-h, --help show this message
__EOF__
}
#!/bin/sh
function print_help () {
cat <<__EOF__
Usage: sh $0
簡易デプロイシェル
1) git fetch -p && git checkout master && git pull
2) DocumentRoot以下にrsyncするだけ
Options
-h, --help show this message
@okbm
okbm / Varantfile
Last active August 29, 2015 14:05
vagrantでのpythonのインストール(2.7系と3.4系)
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "vagrant-python-dev"
config.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_debian-7.1.0_provisionerless.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
@okbm
okbm / mac_python3_install.md
Last active November 14, 2017 06:24
macにpyenvでpython3いれる

mac でpython3の最新入れる

$ brew install pyenv-virtualenv

# zshrcに追加
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"

$ cd tmp
@okbm
okbm / meme.md
Last active August 29, 2015 14:15
mysqlがtimeoutする(2006のエラー)
$ mysql 

mysql > SHOW VARIABLES LIKE 'max_allowed_packet';

# cnfの場所
$ mysql --help | grep my.cnf
                order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf 
@okbm
okbm / tips.md
Last active April 6, 2017 00:28
よく忘れるtips的な何か

git

masterブランチにマージされたローカルブランチを削除する

git br --merged | grep -v '^\*' | grep -v master | xargs git br -d

git管理外のファイル抹殺

git co . && git clean -df
@okbm
okbm / hatebu.rb
Created July 10, 2016 08:15
はてぶ棚卸しに使えそうなruby ワンライナー
require 'net/https'
require 'uri'
time = Time.now - 24*60*60 * 180
url = "http://b.hatena.ne.jp/okbm/atomfeed?date=#{time.strftime('%Y%m%d')}"
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
$ rbenv local 2.5.1
$ ruby -v
ruby 2.5.1

$ gem install bundler
$ mkdir my_project
$ cd my_project
$ bundle init