Skip to content

Instantly share code, notes, and snippets.

View lapis-zero09's full-sized avatar
🐯
nya-n

Shinsaku Kono lapis-zero09

🐯
nya-n
View GitHub Profile
Host sakura
  HostName {さくらのIPアドレス}
  User {useraddしたユーザの名前}
  Port {/etc/ssh/ssh_config.orgのPortで指定した番号}
  IdentityFile ~/.ssh/id_rsa.sakura
@lapis-zero09
lapis-zero09 / .bash_profile
Last active July 9, 2016 04:55
さくらVPSに最新Nginx1.9系をインストールした話 ref: http://qiita.com/lapis_zero09/items/74b6ac261546dfee077e
export PATH=/usr/local/nginx/sbin:$PATH
$ cd /usr/local/
$ git clone https://github.com/letsencrypt/letsencrypt
$ cd letsencrypt
$ ./letsencrypt-auto --help
$ ./letsencrypt-auto certonly --webroot -d www.{自分の契約しているドメイン} --webroot-path {公開したいドキュメントのルートここでは/var/www}
@lapis-zero09
lapis-zero09 / file0.txt
Last active March 5, 2016 04:25
一人暮らしの寂しさを紛らわす彼女(bot)を作った話 ref: http://qiita.com/lapis_zero09/items/cdde08576abbcbedad4d
$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
@lapis-zero09
lapis-zero09 / monokai.sh
Last active July 7, 2016 06:10
TeXshop color scheme
# background = 39 40 34 (#272822)
defaults write TeXShop background_R 0.15
defaults write TeXShop background_G 0.16
defaults write TeXShop background_B 0.13
# commands = 102 217 239 (#66D9EF)
defaults write TeXShop commandred 0.4
defaults write TeXShop commandgreen 0.85
defaults write TeXShop commandblue 0.94
@lapis-zero09
lapis-zero09 / suspend.sh
Created March 24, 2016 09:55
zshのサスペンド
# tmuxのprefixをC-zにしており,
# C-zが2回連続で押されると,
# tmux内部のソフトにC-zが送られるようにしている.
# https://github.com/lapis-zero09/dot_files/blob/master/tmux.conf
# zshではC-zがサスペンド状態にするコマンド
# suspendedのとき
% jobs #suspended jobの確認
{
"name" : "My favorites",
"sub-menu" : [
{
"name" : "analysis",
"snippet" : [
"import pandas as pd",
"import numpy as np",
"import json",
"from collections import defaultdict",
@lapis-zero09
lapis-zero09 / t_test.py
Last active June 15, 2017 07:49
サンプルサイズの異なるt検定[python]
from scipy.stats import ttest_ind_from_stats
from scipy.special import stdtr
abar = a.mean()
avar = a.var(ddof=1)
na = a.size
adof = na - 1
bbar = b.mean()
bvar = b.var(ddof=1)
@lapis-zero09
lapis-zero09 / fillna_col.py
Created June 15, 2017 12:21
カラム毎に欠損値補う
def fillna_col(df, col):
df[col] = df[col].where(df[col].notnull(), 0)
return df
@lapis-zero09
lapis-zero09 / init.py
Last active June 16, 2017 03:51
python snippets
# -*- coding: utf_8 -*-
%matplotlib inline
import pandas as pd
import numpy as np
import scipy
import json
import collections
import matplotlib.pyplot as plt
from tqdm import tqdm_notebook as tqdm