Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| username="" | |
| publickey="" | |
| create_user () { | |
| sudo adduser $1 | |
| sudo echo $1 | passwd --stdin $1 | |
| echo "user" $1 "created" | |
| sudo mkdir -p /home/$1/.ssh | |
| echo "directory user" $1 "created" | |
| sudo cat <<EOF >> authorized_keys |
| #first seen here: http://www.snip2code.com/Snippet/63701/Ansible-task-to-install-nvm-and-node | |
| # Here is how to install nvm and node in an Ansible task. | |
| # I tried a bunch of different things, and as usual it's simple, but you have to get it right. | |
| # The important part is that you have to shell with /bin/bash -c and source nvm.sh | |
| --- | |
| - name: Install nvm | |
| shell: > | |
| curl https://raw.githubusercontent.com/creationix/nvm/v0.7.0/install.sh | sh | |
| creates=/home/{{ ansible_user_id }}/.nvm/nvm.sh |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # create a separate partition and initialize with ext4 | |
| sudo mkfs.ext4 /dev/xvdb | |
| # turn off journaling | |
| sudo tune2fs -o journal_data_writeback /dev/xvdb | |
| sudo tune2fs -O ^has_journal /dev/xvdb | |
| # add to fstab | |
| echo '/dev/xvdb /mnt/databases ext4 defaults,auto,noatime,nodiratime,noexec 0 0' | sudo tee -a /etc/fstab |
| ########## Install NGINX ############## | |
| # Install software-properties-common package to give us add-apt-repository package | |
| sudo apt-get install -y software-properties-common | |
| # Install latest nginx version from community maintained ppa | |
| sudo add-apt-repository ppa:nginx/stable | |
| # Update packages after adding ppa |
| Windows Registry Editor Version 5.00 | |
| [HKEY_CURRENT_USER\Console] | |
| ; 00BBGGRR, not RGB! | |
| "ColorTable00"=dword:00222827 ; 0 - black | |
| "ColorTable04"=dword:004e06cc ; 1 - dark red | |
| "ColorTable02"=dword:0018ac7a ; 2 - dark green | |
| "ColorTable06"=dword:0045a9f0 ; 3 - dark yellow | |
| "ColorTable01"=dword:00e9C721 ; 4 - dark blue | |
| "ColorTable05"=dword:00ff337e ; 5 - dark magenta |
| # This is just a cheat sheet: | |
| # On production | |
| sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
| # On local | |
| scp -C production:~/database.sql.gz | |
| dropdb database && createdb database | |
| gunzip < database.sql.gz | psql database |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>GistRun</title> | |
| <link rel="stylesheet" href="styles.css"> | |
| </head> | |
| <body> | |
| <h1>Hello world!</h1> | |
| <script src="script.js"></script> |
Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!