This file contains 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 <=9.10. | |
# Description: nginx init.d dash script for Ubuntu <=9.10. | |
### END INIT INFO |
This file contains 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 -l -c 'sh /home/ec2-user/scripts/monitor.sh postgresql93 redis-server nginx memcached >> /var/log/cron 2>&1' | |
* * * * * /bin/bash -l -c 'sleep 30; sh /home/ec2-user/scripts/monitor.sh postgresql93 redis-server nginx memcached >> /var/log/cron 2>&1' |
This file contains 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 | |
echo "starting check sidekiq" | |
process=`cat /path-to/sidekiq.pid` | |
processConfirmation=`ps aux | awk '{print $2 }' | grep $process` | |
if [ -z $processConfirmation ] | |
then | |
echo "oops! not running... restarting sidekiq" |
This file contains 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 | |
commands=("$@") | |
echo "starting monitor check" | |
for command in "${commands[@]}"; do | |
if [ $command == "postgresql93" ] | |
then | |
check="postmaster" |
This file contains 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
$ cat ~/.bashrc | |
export GIT_PS1_SHOWDIRTYSTATE=true | |
export GIT_PS1_SHOWUNTRACKEDFILES=true | |
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting | |
### Added by the Heroku Toolbelt | |
export PATH="/usr/local/heroku/bin:$PATH" | |
ruby-2.2.1 | objet (master) |
This file contains 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
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
\curl -sSL https://get.rvm.io | bash -s stable |
This file contains 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 | |
# | |
# nginx – this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /opt/nginx/conf/nginx.conf | |
# pidfile: /opt/nginx/logs/nginx.pid |
This file contains 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 | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
This file contains 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
daemonize yes | |
pidfile /var/run/redis.pid | |
port 6379 | |
tcp-backlog 511 | |
bind 127.0.0.1 | |
timeout 0 | |
tcp-keepalive 0 | |
loglevel notice | |
logfile "/var/log/redis.log" | |
databases 16 |
This file contains 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
pg_dump -U user-name -d database-name -W > backup.sql | |
scp user-name@server-address:path-to-file my-path |