Skip to content

Instantly share code, notes, and snippets.

View kolosek's full-sized avatar

Nebojsa Zoric kolosek

View GitHub Profile
@kolosek
kolosek / hacker-processes-check.sh
Last active June 10, 2016 11:10 — forked from shaiguitar/gist:1032229
check processes with kill -0
usage()
{
echo "./$0 [--verbose]"
}
VERBOSE=0
if [ "$1" == "--verbose" ]; then
VERBOSE=1
fi
# sets the proxy cache path location, max size 2g
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:100m inactive=24h max_size=2g;
# transfers the `Host` header to the backend
proxy_set_header Host $host;
# uses the defined STATIC cache zone
proxy_cache STATIC;
# cache 200 10 minutes, 404 1 minute, others status codes not cached
@kolosek
kolosek / phantomjs201.sh
Created January 19, 2017 14:05
install-phantomjs-codeship
#!/bin/bash
# Install a custom version 2 of PhantomJS, http://phantomjs.org/
#
# Include in your builds via
# \curl -sSL https://gist.githubusercontent.com/mlocher/f0f731dfa93c82d0fa86/raw/phantomjs2.sh | bash -s
PHANTOMJS_URL="https://s3.amazonaws.com/codeship.io/checkbot/binaries/phantomjs_2.0.1"
CACHED_DOWNLOAD="${HOME}/cache/phantomjs_2.0.1"
# official packages are now available, thus print an info message
echo -e "\e[36mOfficial PhantomJS 2 packages are now available from phantomjs.org\e[39m"
#!/bin/bash
# Install a custom version of PhantomJS, http://phantomjs.org/
#
# If you run into any rate limiting issues from bitbucket, put the download
# file(s) into your own server and point to the location via the PHANTOMJS_HOST
# environment variable.
#
# Add at least the following environment variables to your project configuration
# (otherwise the defaults below will be used).
# * PHANTOMJS_VERSION - Specify the version of PhantomJS
@kolosek
kolosek / rails-install-ubuntu-1604.sh
Last active October 21, 2017 09:51
Latest rails installation script for Ubuntu 16.04
echo "Updates packages. Asks for your password."
sudo apt-get update -y
echo "Installs packages. Give your password when asked."
sudo apt-get install -y curl nodejs libcurl4-gnutls-dev git-core libxslt1-dev libxml2-dev libsqlite3-dev libgmp-dev libmysqlclient-dev git git-doc libncurses5-dev build-essential rake libqt4-dev libqtwebkit-dev openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config libv8-dev libmagickwand-dev libreadline-dev libedit-dev libgdbm-dev libffi-dev zlib1g-dev rake curl vim libgmp3-dev phantomjs imagemagick
echo "Setting up mysql"
sudo apt-get install -y mysql-server mysql-client
echo "Setting up postgres"
@kolosek
kolosek / ubuntu-install-nodejs-npm.sh
Last active December 24, 2018 14:21
Install node.js version 6.x Ubuntu 16.04
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
echo "Installing NodeJS 6.x"
sudo apt-get install nodejs
echo "Install webpack globally"
sudo npm install webpack -g
echo "Install nightwatch globally"
sudo npm install nightwatch -g
@kolosek
kolosek / ubuntu-basic-software.sh
Last active July 12, 2019 07:57
Installing basic software for development machine
echo "Installing sublime"
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
echo "Installing Atom"
sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xzvf ImageMagick.tar.gz
cd ImageMagick-7.0.6-0/
./configure --prefix=/opt/imagemagick-7.0 && make
checkinstall
@kolosek
kolosek / no_animations.rb
Created September 3, 2017 20:43 — forked from keithtom/no_animations.rb
Rack Middleware to disable Disable CSS3/jQuery Animations for Capybara
module Rack
# disable CSS3 and jQuery animations in test mode for speed, consistency and avoiding timing issues.
# Usage for Rails:
# in config/environments/test.rb
# config.middleware.use Rack::NoAnimations
class NoAnimations
def initialize(app, options = {})
@app = app
end