2017-01-01から1年間の記事一覧

シェルのコマンド例記録

参考になったコマンド ## a~gまで出力して、field numberが4以上だと、3連番する $ echo {a..g} | xargs -n 1 | awk 'NR>=4{print $1, $1, $1}NR<4{print $1, $1}' ## 80ポートのtcp udpの確認 $ grep '80/[tu][cd]p' /etc/services ## 出現文字列の種類を…

memcachedのインストール方法

Git hubよりインストール github.com [vagrant@localhost ~]$ tar -zxf memcached-1.5.3.tar.gz [vagrant@localhost ~]$ cd memcached-1.5.3/ [vagrant@localhost memcached-1.5.3]$ ./configure --prefix=/usr/local/memcached --enable-64bit --with-libev…

make testのエラーについて(memcachedのmake install前)

memcachedをインストールする前に、make testを行うとエラーがでた。 perlのモジュールがないかららしい。 $ sudo yum install -y perl-CPAN $ sudo cpan cpan> install Test::More cpan> quit $ make test http://forums.devshed.com/perl-programming-6/in…

pip.exceptions.DistributionNotFoundでpip installできない

以下でいけるっぽい。 $ pip install --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org <package_name> stackoverflow.com</package_name>

はてなのMarkdownについてまとめてあった

python class A(object): print('hogehoge') shell?? $ ls -lh いろいろあった。 jsstudy.hatenablog.com

Jupyterをvagrantにて実行する

vagrantで $ vagrant ssh -- -L 8888:localhost:8888 vagrant で ipython notebook 環境を構築した話 · kamatari qiita.com

Git ignoreでゴミを消す。

Git

怖いけどこれが一番簡単 $ git rm -r --cached . $ git add apps/ $ git add .gitignore

けいせん でtreeの情報を記載する

基本的に けいせん を変換すると出て来る。知らなかった qiita.com

Apacheのapachectl (version 2.2) の引数について。

引数 説明 start apache 起動 stop apache 停止 restart apache が停止しているなら起動。apache が起動しているなら再起動。設定ファイルに間違いがあると、apache が停止したりする。 fullstatus mod_status モジュールが有効になっていて、かつhttpd.conf…

git diffについてチートシートが便利

Git

qiita.com

サーバのシステムコールの順番

Pythonでソケットの勉強をしていたときの順番について socket → bind → listen → accept → recv/send → shutdown → close www.infra.jp

Postgresの早見サイト

qiita.com qiita.com

Bashの[ -e /home/... ]による確認

[ -e filepath ] Returns true if file exists. [ -x filepath ] Returns true if file exists and executable. [ -S filepath ] Returns true if file exists and its a socket file. [ expr1 -a expr2 ] Returns true if both the expression is true. [ e…

Pythonのコードの計測について(line-profiler)

@profile def fizzbuzz(n): if n % 3 == 0 and n % 5 == 0: return 'FizzBuzz' $ kernprof -l fizzbuzz.py 1 2 Fizz ...(省略)... 97 98 Fizz Wrote profile results to fizzbuzz.py.lprof $ python -m line_profiler fizzbuzz.py.lprof Timer unit: 1e-06 s…

Solrのf.<field>.facet.<param>のvalue指定

f.<field>.facet.<param>のvalue指定させる場合、以下の{terms=...,...}を指定すればいい。 curl http://localhost:8983/solr/testurltext/select?indent=on&q=*:*&wt=json&facet=true&facet.field={!terms=value1,value2}category1_name&rows=0 Faceting | Apache Solr Re</param></field>…

Gitでブランチ切って作業して、マージする。

git flowのルールにそって 作業しない場合に $ git branch * master # ブランチカット $ git checkout -b feature-create-api feature-create-api $ git add . $ git commit -am "commit message!" $ git push -u origin feature-create-api $ git checkout …

boostnoteとかいうmarkdownでメモできるアプリ

qiita.com

PostgresとMySQLのcreatedbなどの違い

scientre.hateblo.jp

daemonでDjangoを動かす方法など

daemontools http://cr.yp.to/daemontools.html # インストール sudo yum -y install rpm-build wget http://mirrors.qmailtoaster.com/daemontools-toaster-0.76-1.3.6.src.rpm rpmbuild --rebuild daemontools-toaster-0.76-1.3.6.src.rpm sudo rpm -ivh ~…

DjangoをHerokuで実装するときにチェック

devcenter.heroku.com

AWSでelasticsearchとkibanaをinstall

そもそもAWSのポートが空いてなかった。 $ netstat -na | grep LISTEN ... tcp 0 0 ::1:9200 :::* LISTEN ... ## elasticsearch install $ curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.0.tar.gz $ tar -xvzf elasti…

Python3.6の仮想環境作成について

python3 -m venv /path/to/new/virtual/environment でいけるらしい。 stackoverflow.com

Elasticsearchを用いて、kibanaで分析する

ElasticSearchで分析するやり方があるらしい。 データの投入はSparkを使ったりするっぽいよ。 $ ES_JAVA_OPTS="-Xms512m -Xmx512m" ./bin/elasticsearch qiita.com 楽しい可視化 : elasticsearchとSpark Streamingの出会い | NTTデータ先端技術株式会社

PostgreSQLのCentOS7での立ち上げ方やコマンドなどの便利なサイト+自動インストール

DjangoではPostgreが推奨のDBMSらしいよ。 www.digitalocean.com qiita.com #!/bin/sh # -*- MAINTAINER -*- Lasha Gogua Lh4cKg@gmail.com # -*- RUN -*- $ bash install.sh # system update and install epel package yum update -y && yum upgrade -y wget…

リスト内包表記(IFあり)

リスト内包表記ってっこんな感じ。 [(処理1)if (条件式) else (処理2) for 仮引数 in (リストオブジェクト)] qiita.com

PortForwordという言葉の意味

知らなかった。。。ポートフォーワードという内容はsshでポートを指定すると、 localhost:[port名]で確認できる。 開発サーバなどで、SSHに使う22番ポートは解放しているけど、HTTPに使う80番ポートは外部に解放していないという状況があります。 $ ssh -L 8…

Jupyterでちょっとやってみた。

localhost以外にアクセスする場合、対応する。 $ jupyter notebook --no-browser --ip=0.0.0.0 qiita.com

Gitのdevelopがごっちゃになったので、masterのbranch内容に変更する。

Git

masterにdevelopをあわせる。 $ git checkout develop $ git reset --hard master $ git push -f stackoverflow.com stackoverflow.com

Atomの一括インストール

$ apm install --packages-file recommend_packages.txt $ apm list -ib > recommend_packages.txt atom-dark-ui-slim autocomplete-paths blame color-picker git-time-machine highlight-selected jumpy maximize-panes merge-conflicts minimap minimap-a…

djangoの管理画面より、カレンダーの入力を引っ張ってくる。

stackoverflow.com