This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #string concatenation 02 | |
| name = raw_input("what's your name ?") | |
| if name == "jack": | |
| print(name + " is cool") | |
| else: | |
| print(name + " is not cool") | |
| #string concatenation 03 | |
| name = raw_input("what's your name ?") | |
| if name == "jack": | |
| print("{} is cool".format(name)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| machine learning | |
| ## make virtualenv | |
| mkvirtualenv machine-learning | |
| ## install security to prevent sslinsecure | |
| pip install requests[security] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #### Create some directory | |
| HOMEDIR=/home/$USER | |
| APPSDIR=$HOMEDIR/app | |
| PASSDIR=$APPSDIR/public | |
| TEMPLATEDIR=$APPSDIR/templates | |
| TMPDIR=$APPSDIR/tmp | |
| STATICDIR=$APPSDIR/static | |
| for i in "$APPSDIR" "$PASSDIR" "$TEMPLATEDIR" "$TMPDIR" "$STATICDIR"; do | |
| mkdir -p "$i" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| HOMEDIR=/home/$USER | |
| APPSDIR=$HOMEDIR/apps | |
| APPDIR=$APPSDIR/app | |
| TEMPLATEDIR=$APPSDIR/templates | |
| PASSDIR=$APPSDIR/public | |
| TMPDIR=$APPSDIR/tmp | |
| STATICDIR=$APPSDIR/static | |
| for i in "$APPSDIR" "$APPDIR" "$TEMPLATEDIR" "$TMPDIR" "$PASSDIR" "$STATICDIR"; do | |
| mkdir -p "$i" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: nginx | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: nginx init.d dash script for Ubuntu or other *nix. | |
| # Description: nginx init.d dash script for Ubuntu or other *nix. | |
| ### END INIT INFO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #download source nginx | |
| wget http://nginx.org/download/nginx-1.8.0.tar.gz | |
| tar -xvzf nginx-1.8.0.tar.gz | |
| #download module | |
| #pagespeed | |
| wget https://github.com/pagespeed/ngx_pagespeed/archive/release-1.9.32.4-beta.zip | |
| unzip release-1.9.32.4-beta.zip | |
| cd ngx_pagespeed-release-1.9.32.4-beta/ | |
| wget https://dl.google.com/dl/page-speed/psol/1.9.32.4.tar.gz | |
| tar -xzvf 1.9.32.4.tar.gz # extracts to psol/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install imagemagick |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install python-pip python-dev | |
| source .bashrc | |
| pip install --user virtualenv | |
| pip install --user virtualenvwrapper | |
| nano .bashrc | |
| export PATH=$HOME/.local/bin:$PATH | |
| export WORKON_HOME=$HOME/.virtenvs | |
| export PROJECT_HOME=$HOME/Devel | |
| source $HOME/.local/bin/virtualenvwrapper.sh | |
| pip install pyopenssl ndg-httpsclient pyasn1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update | |
| sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev | |
| git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
| echo 'eval "$(rbenv init -)"' >> ~/.bash | |
| source .bashrc | |
| git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
| rbenv install 2.2.2 | |
| rbenv global 2.2.2 | |
| git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| download from vagrant.es | |
| wget https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box | |
| install vagrant | |
| vagrant box add foo-box /path/to/vagrant-box.box | |
| vagrant init foo-box | |
| vagrant up |
NewerOlder