I hereby claim:
- I am sharshenov on github.
- I am sharshenov (https://keybase.io/sharshenov) on keybase.
- I have a public key whose fingerprint is ED36 8D30 17B6 39F8 B58E 1E7D EDF0 0A21 B208 D134
To claim this, I am signing this object:
class HealthCheckResponder | |
def initialize(app, options = {}) | |
@app = app | |
end | |
def call(env) | |
if env["REQUEST_PATH"] == "/health_check" | |
return [200, {}, [""]] | |
else |
<h1>Page not found</h1> |
SECRET_KEY_BASE=ahsbdjhasbjhdabks # run rake:secret to generate | |
DATABASE_URL=postgres://user:pass@dbhost/database |
#!/bin/bash | |
cd ~/ror | |
# remove temporary uploads | |
find ./ -path "*/uploads/tmp/*" -delete | |
# null logfiles | |
for logfile in `find ./ -type f -name "*.log"` | |
do |
# 1. Pause replication | |
sudo -u postgres psql -c 'SELECT pg_xlog_replay_pause();' | |
# 2. Perform backup | |
sudo -u postgres pg_dump -Fc DBNAME > /path/to/backup | |
#3. Resume replication |
1. Select Preferences / Key Bindings(user) | |
2. Paste this: | |
```json | |
[ | |
{ "keys": ["ctrl+w"], "command": "close_file" }, | |
] | |
``` |
# open console as postgres user | |
sudo -u postgres psql | |
# paste this | |
update pg_database set datistemplate = FALSE where datname = 'template1'; | |
drop database template1; | |
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0; | |
update pg_database set datistemplate = TRUE where datname = 'template1'; |
I hereby claim:
To claim this, I am signing this object:
#Original article: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-12-04 | |
dd if=/dev/zero of=/swapfile bs=1M count=1k | |
mkswap /swapfile | |
swapon /swapfile | |
echo '/swapfile none swap sw 0 0 ' >> /etc/fstab | |
echo 1 | tee /proc/sys/vm/swappiness | |
echo vm.swappiness = 1 | tee -a /etc/sysctl.conf | |
chown root:root /swapfile | |
chmod 0600 /swapfile |
# save as /etc/logrotate.d/APPNAME | |
/home/deploy/apps/APPNAME/shared/log/*.log { | |
su deploy deploy | |
daily | |
missingok | |
rotate 30 | |
compress | |
delaycompress | |
notifempty | |
copytruncate |