Skip to content

Instantly share code, notes, and snippets.

@usaturn
usaturn / test_pep8.py.error.txt
Created October 3, 2012 03:55
test_pep8.pyのエラー
C:\work\repo\poker>nosetests
E.......
======================================================================
ERROR: Failure: SyntaxError (invalid syntax (test_pep8.py, line 2))
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\nose\loader.py", line 390, in loadTestsFromName
addr.filename, addr.module)
File "C:\Python27\lib\site-packages\nose\importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
@usaturn
usaturn / alminium.log
Created October 11, 2012 01:30
ALMiniumのインストールNGログ
[root@redmine alminium]# sh uninstall
which: no gem1.9.3 in (/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
ALMiniumをアンインストールします。
データベース(全てのRedmineの情報)とリポジトリを削除しますか?(y/N)y
Apacheの設定を削除しますか?(y/N)y
Passengerを削除しますか?(y/N)y
uninstall: line 44: gem: コマンドが見つかりません
@usaturn
usaturn / crashed_sphinx.log
Created October 11, 2012 09:16
sphinx壊れちゃった
[root@localhost tes]#
[root@localhost tes]# uname -a
Linux localhost.localdomain 2.6.32-279.el6.i686 #1 SMP Fri Jun 22 10:59:55 UTC 2012 i686 i686 i386 GNU/Linux
[root@localhost tes]#
[root@localhost tes]#
[root@localhost tes]# cat /etc/redhat-release
CentOS release 6.3 (Final)
[root@localhost tes]#
[root@localhost tes]#
[root@localhost tes]# pip uninstall sphinx
@usaturn
usaturn / gist:5222086
Created March 22, 2013 15:19
画像重複検出のリファクタリング? awkは1回でいいのさ
# 260ファイル 計54MBに対して処理
# timeコマンドで計測。
# /dev/nullに捨てる事によりオーバーヘッドを最小限にした。
# 初めにmd5sumを1回、パイプをいくつか挟み、シェルのfor文の中でさらにmd5sumを使用
time for i in $(md5sum *.jpg|awk '{print $1}'|sort|uniq -c|awk '{print $1,$2}'|grep -v ^1|awk '{print $NF}');do md5sum *.jpg|grep $i;done > /dev/null
# 結果 20秒以上
# real 0m23.894s
# user 0m12.430s
@usaturn
usaturn / vimrc_ng
Created May 16, 2013 12:07
Neobundleが動かないんです・・・
set nocompatible
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#rc(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'
@usaturn
usaturn / click
Last active December 23, 2015 14:39
AutoHotKey用のクリックするだけスクリプト。 使い方は引数でスクリプトを指定、 AutoHotkey.exe click.txt Alt+Shift+c で発動します。 6億回ループしますが、Ctrlを押すと止まります。
ClickClick:
Loop, 600000000
{
MouseClick, left
Sleep, 10
GetKeyState ctrlon, Ctrl
if ctrlon = D
Break
}
return
@usaturn
usaturn / usaturn.py
Created November 20, 2013 16:15
超高度なAI
print("うさたーんだよっ")
#!/usr/bin/awk -rf
BEGIN{
url_list="url_list"
while (getline < url_list > 0) {
flvname=gensub(/^(http.+)\.flv.+/, "\\1", 1, $0)
if(flvname in flv) true
else {
flv[flvname]++
}
}
#!/usr/bin/awk -rf
BEGIN{
list=ARGV[1]
while (getline < list > 0) {
word[$1]++
}
close(list)
}
@usaturn
usaturn / .profile
Created June 3, 2014 08:31
ssh-keygen -R がメンドくさい
function rmkey(){
TARGET_HOST=$1
if [ -z "$TARGET_HOST" ]; then
echo "must hostname or ipaddr"
return 1
fi
if [[ $TARGET_HOST =~ [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} ]]; then
ssh-keygen -R $TARGET_HOST
elif [[ $TARGET_HOST =~ [a-zA-Z0-9]{3,20} ]]; then
ssh-keygen -R $TARGET_HOST