Skip to content

Instantly share code, notes, and snippets.

@pawitk
pawitk / ROR110313
Created March 11, 2013 17:07
CentOS6 + Ruby2 + RoR4 + Passenger + Nginx - 11/03/13
sudo yum update -y
sudo yum upgrade -y
sudo yum groupinstall "Development Tools"
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh # or the path that is given by your rvm
rvm requirements run force
rvm install 2.0.0 --default
Verifying that +pawitk is my Bitcoin username. You can send me #bitcoin here: https://onename.io/pawitk
@pawitk
pawitk / run.sh
Created November 17, 2014 06:09
Meteor.js folder structure
mkdir client
mkdir server
mkdir lib
mkdir public
touch client/main.html
touch client/main.css
touch client/main.js
meteor add iron:router
meteor add mizzao:bootstrap-3
mkdir client/stylesheets
@pawitk
pawitk / gist:e866e152be676fff664e
Created February 2, 2015 17:07
digital ocean 14.04 add swap
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo su -c "echo '/swapfile none swap sw 0 0' >> /etc/fstab"
sudo su -c "echo 'vm.swappiness=10' >> /etc/sysctl.conf"
sudo su -c "echo 'vm.vfs_cache_pressure = 50' >> /etc/sysctl.conf"
@pawitk
pawitk / init_nginx.sh
Last active August 29, 2015 14:24
nginx launch
wget -O init-nginx.sh https://gist.githubusercontent.com/pawitk/7fa6d86dc8db3236a6b0/raw/d436d327d2dadac67ddbd9c66161a9e72a0f484a/init_nginx.sh
sudo mv init-nginx.sh /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee --append /etc/fstab
@pawitk
pawitk / clear.sh
Created September 24, 2017 07:49
clear old kernels on ubuntu 16.04
dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2) | xargs sudo apt-get -y purge
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnzJPwVaOk1CCwbssiMh0FfcRVRY005fI+w7njLT4lus7YAIntyQwUsOzTfiLthgM07pZTKdTlPts6i1X/vigxUoJviZDnMbaXwD5v0TNB+Bd5KFGKrEuKFdIiW3jf4F0xqn5g8s3hjDPDYzCAgTGzLVUdPmc+bUx7A7eC/Mge3rvkQyj0HFHTVQ+Gc5GB7Q5kJh+MmgyhF6mLOUq1rHIB8uBGSXR2qrpH0gFB2qrFxBJMOw1XaC5P7DgabIQpiwKVbFU+SvqtIpQykboJG1RUlt56HqUTM27Bp2j6QxA6JwmoLKKt9DmIGo7xXdQvIvfc8YsK7IYwcEnEM8necchd pawit@Pawits-MacBook-Pro.local
@pawitk
pawitk / .pgpass
Last active June 5, 2018 01:23
Postgresql backup
# db credentials
hostname:port:database:username:password
# Put in /etc/logrotate.d/
/path/to/*.log {
rotate 30
daily
compress
missingok
notifempty
create 0640 deploy deploy
sharedscripts
postrotate