start new:
tmux
start new with session name:
tmux new -s myname
| #!/bin/bash | |
| echo "*****************************************" | |
| echo " Based on information from Google" | |
| echo " http://dev.chromium.org/spdy/spdy-best-practices" | |
| echo "*****************************************" | |
| sudo su | |
| yum –y update | |
| echo "*****************************************" | |
| echo " Changing initcwnd and initrwnd" | |
| echo " Step 1: check route settings." |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| -- Index hit rate | |
| WITH idx_hit_rate as ( | |
| SELECT | |
| relname as table_name, | |
| n_live_tup, | |
| round(100.0 * idx_scan / (seq_scan + idx_scan + 0.000001),2) as idx_hit_rate | |
| FROM pg_stat_user_tables | |
| ORDER BY n_live_tup DESC | |
| ), |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| #!/bin/bash | |
| # | |
| # Bash script to setup headless Selenium (uses Xvfb and Chrome) | |
| # (Tested on Ubuntu 12.04) trying on ubuntu server 14.04 | |
| # Add Google Chrome's repo to sources.list | |
| echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list | |
| # Install Google's public key used for signing packages (e.g. Chrome) | |
| # (Source: http://www.google.com/linuxrepositories/) |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)Centos 6.* comes with Python 2.6, but we can't just replace it with v2.7 because it's used by the OS internally (apparently) so you will need to install v2.7 (or 3.x, for that matter) along with it. Fortunately, CentOS made this quite painless with their Software Collections Repository
sudo yum update # update yum
sudo yum install centos-release-scl # install SCL
sudo yum install python27 # install Python 2.7
To use it, you essentially spawn another shell (or script) while enabling the newer version of Python: