GAEで "Error,failed auth error" が発生した場合のアップデート方法
-
- oauth2 オプションを追加して実行
# appcfg.py --oauth2 update appdir
Ubuntu 32bit環境にAtomをインストール
ターミナルから
# sudo add-apt-repository ppa:webupd8team/atom # sudo apt-get update # sudo apt-get install atom
MacにPostgreSQLをソースからインストール
configureでパスを指定してインストール(足りないものがあれば適宜brew)
他のUNIXならだいたい同じかと
./configure --prefix=/Users/user/Desktop/postgresinstall make make install
initdbを実行してからpostgresを起動
cd /Users/user/Desktop/postgresinstall/bin ./initdb -D /Users/user/Desktop/postgresrun/ --encoding=UTF8 --no-locale ./postgres -D /Users/user/Desktop/postgresrun -p 5555
起動できていたら別のターミナルから接続
./psql -p 5555 -d template1 \q
ユーザー作成と一覧
CREATE ROLE hoge LOGIN PASSWORD 'password'; \du
DB作成とDB選択
CREATE DATABASE testdb; \c testdb
テーブル作成
create table testtable (hogehoge char(10)); insert into testtable (hogehoge) values('test1'); select * from testtable;
Tweepyのインストールに失敗する場合の対処
Tweepyをpipでインストールしようとしたら失敗する場合あり
"parse_requirements() missing 1 required keyword argument: " TypeError: parse_requirements() missing 1 required keyword argument: 'session'
原因はpipが古いため
pipをアップデートすれば大丈夫っぽい
pip install -U pip
GAEで日本語ファイル名を指定してファイル出力
とりあえず例としてContent-Typeはoctet-stream
self.response.headers["Content-Type"] = "application/octet-stream; "
SetHeaderString = 'attachment; filename="' JpStr = u'_日本語ファイル名_'.encode('utf-8') JpStr = urllib.quote(JpStr) SetHeaderString += JpStr SetHeaderString += '.csv"' self.response.headers['Content-Disposition'] = SetHeaderString
あとはひたすら吐き出す
self.response.out.write( something )
Macでmgoをインストールしようとしたら "bzr": executable file not found
Mongoのgoドライバ,mgoを入れようとしたらBazaarがないよと
go: missing Bazaar command. See http://golang.org/s/gogetcmd package labix.org/v2/mgo: exec: "bzr": executable file not found in $PATH
Bazaarが足りないのでbrewで入れる
brew install bzr
入れたらmgoもgo getからインストール
go get labix.org/v2/mgo
Macでgo get
Macでgo getしようとすると
cannot download, $GOPATH must not be set to $GOROOT
が出るので対応方法
パスを確認
which go
/usr/local下にあると permission denyされちゃうので
sudo su
GOPATHを設定
export GOPATH=/usr/local/go/bin
設定したら
go get github.com/****/****