Steps with explanations to set up a server using:
- Virtualenv
- Virtualenvwrapper
- Django
- Gunicorn
| #!/bin/bash | |
| # PLUGINS=で始まってる行をコメントアウトしたり追加したりして、 | |
| # 好きなプラグインをインストールできるよ。 | |
| # まぁ、普通は、JenkinsのWeb UIから「プラグインの管理」でインストールすればいいと思う。 | |
| # 同じ環境を何個も作りたい場合はこのスクリプトをどうぞ。 | |
| PLUGINS=() | |
| # Jenkin Build Pipeline Plugin |
| # Split MYSQL dump file | |
| zcat dump.sql.gz | awk '/DROP TABLE IF EXISTS/{n++}{print >"out" n ".sql" }' | |
| # Parallel import using GNU Parallel http://www.gnu.org/software/parallel/ | |
| ls -rS *.sql | parallel --joblog joblog.txt mysql -uXXX -pYYY db_name "<" | |
| #!/bin/bash | |
| SOURCEINSTANCE=${SOURCEINSTANCE:-''} | |
| SOURCEUSER=${SOURCEUSER:-'admin'} | |
| SOURCEPORT=${SOURCEPORT:-'5439'} | |
| SOURCEDB=${SOURCEDB:-'db'} | |
| SOURCESCHEMA=${SOURCESCHEMA:-'public'} | |
| SCHEMA=${SCHEMA:-'public'} | |
| echo "CREATE TABLE ${SCHEMA}.${TABLE} (" | |
| psql -h ${SOURCEINSTANCE} -U ${SOURCEUSER} -p ${SOURCEPORT} ${SOURCEDB} -t -c "select (\"column\" || ' ' || type || ' ENCODE ' || encoding || ',' ) from pg_table_def where schemaname='$SCHEMA' and tablename = '$TABLE'" | sed 's/ENCODE none/ENCODE RAW/' | sed '$d' | sed '$ s/,$//' | |
| echo ")" |
| { | |
| "variables": { | |
| "aws_access_key": "{{env `AWS_ACCESS_KEY`}}", | |
| "aws_secret_key": "{{env `AWS_SECRET_KEY`}}" | |
| }, | |
| "builders": [ | |
| { | |
| "type": "amazon-ebs", | |
| "ssh_pty": true, | |
| "access_key": "{{user `aws_access_key`}}", |
A small library for padding strings in JavaScript. Marmalade-free.
![NPM version][shield-npm] ![Node.js version support][shield-node] ![Build status][shield-build] ![Code coverage][shield-coverage]
| #!groovy | |
| # Best of Jenkinsfile | |
| # `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins | |
| node { | |
| } |
command line
$ PYTHON_CONFIGURE_OPTS="--enable-shared" \
LDSHARED="clang -bundle" \
LDCXXSHARED="clang++ -bundle" \
BLDSHARED="clang -bundle -lpython2.7" \
pyenv install 2.7.11
SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.
apt-get install sshpass
The security group and Network ACLs parts of CloudFormation templates can be difficult to read. This template containing Jinja macros converts easier-to-read YAML dictionaries of security group and NACL rules into JSON.
Here ais a generic macro template and some example files showing how to use it.