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
check process nginx with pidfile /var/run/nginx.pid | |
start program = "/bin/systemctl start nginx" | |
stop program = "/bin/systemctl stop nginx" |
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
# <div app-show-if-ready ui-view></div> | |
appShowIfReady = ($animate, $rootScope, $timeout, cfpLoadingBar) -> | |
restrict: 'A' | |
link: ($scope, $element) -> | |
container = $element.parent() | |
stateChangeStartOff = $rootScope.$on '$stateChangeStart', -> | |
container.hide() | |
stateChangeSuccessOff = $rootScope.$on '$stateChangeSuccess', -> | |
$timeout -> |
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
echo Please, enter domain name: | |
read DOMAIN_NAME | |
echo Please, enter domain IP: | |
read SERVER_IP | |
echo Please, enter domain directory: | |
read DOMAIN_DIR | |
echo "Please, enter Nginx config directory (default /etc/nginx/conf.d):" | |
read CONFIG_DIR | |
echo "Please, enter socket path (default /var/run/php7-fpm.sock):" | |
read SOCKET_PATH |
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
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz | |
tar zxvf ioncube_loaders_lin_x86-64.tar.gz | |
PHP_CONFD="/etc/php5/conf.d" | |
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") | |
PHP_EXT_DIR=$(php-config --extension-dir) | |
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR | |
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini" | |
rm -rf ./ioncube | |
rm ioncube_loaders_lin_x86-64.tar.gz | |
service php5-fpm restart |
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
development: | |
adapter: postgresql | |
host: localhost | |
port: 5432 | |
pool: 5 | |
encoding: unicode | |
database: | |
username: | |
password: |
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
# add it to spec/spec_helper.rb | |
RSpec.configure do |config| | |
... | |
config.include TestObservers | |
... | |
end |
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 | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
CURRENT=`grep -e "^[^#]" $1` | |
if [ -z "$CURRENT" ] | |
then | |
NEW_MSG=$(echo "$BRANCH"; cat "$1") | |
echo "$NEW_MSG" > $1 | |
fi |
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
namespace :god do | |
def god_command | |
"cd #{current_release}; ENV=#{env} SHARED=#{shared_path} bundle exec god" | |
end | |
def god_is_running | |
!capture("#{god_command} status >/dev/null 2>/dev/null || echo 'not running'").start_with?('not running') | |
end | |
desc "Stop god" |
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
APP_PATH = File.dirname(__FILE__) + '/..' | |
SHARED = ENV['SHARED'] || APP_PATH | |
God.pid_file_directory = "#{SHARED}/tmp/pids" | |
God.watch do |w| | |
w.name = "resque" | |
w.log = "#{SHARED}/log/god.log" | |
w.pid_file = "#{SHARED}/tmp/pids/resque.pid" | |
w.interval = 30.seconds | |
w.stop_timeout = 30.seconds |
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
width, height = ARGF.read(24).unpack("@16N2") | |
p "width: #{width}px, height: #{height}px" | |
# $ ruby image_size.rb photo.jpg | |
# width: 400px, height: 500px | |