Skip to content

Instantly share code, notes, and snippets.

View clevertechru's full-sized avatar

Vitali M clevertechru

View GitHub Profile
@clevertechru
clevertechru / sidekiq
Created April 30, 2015 13:38
debian sidekiq daemon /etc/init.d/sidekiq
#!/bin/bash
# sidekiq Init script for Sidekiq
# chkconfig: 345 100 75
#
# Description: Starts and Stops Sidekiq message processor for Stratus application.
#
# User-specified exit parameters used in this script:
#
# Exit Code 5 - Incorrect User ID
# Exit Code 6 - Directory not found
@clevertechru
clevertechru / graphite
Last active August 29, 2015 14:18 — forked from drawks/graphite
#This is the "site config" for nginx
upstream django {
# Distribute requests to servers based on client IP. This keeps load
# balancing fair but consistent per-client. In this instance we're
# only using one uWGSI worker anyway.
ip_hash;
server unix:/tmp/uwsgi.sock;
}
server {
@clevertechru
clevertechru / unicorn
Created September 28, 2014 11:52
/etc/init.d/unicorn
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@clevertechru
clevertechru / Gemfile
Last active October 15, 2015 23:30 — forked from mm53bar/Gemfile
datadog installation for rails
gem 'dogstatsd-ruby'
@clevertechru
clevertechru / crypt
Last active December 26, 2015 20:59
Вот такое простенькое обратимое шифрование можно использовать. Перед шифрованием хорошо в base64 завернуть, что бы уж точно не поломалось ничего.
function crypt($string, $password = 'secret') {
$strLen = strlen($string);
$seq = $password;
$gamma = '';
while (strlen($gamma) < $strLen) {
$seq = sha1($seq.self::SALT, true);
$gamma.=substr($seq, 0, 8);
}
@clevertechru
clevertechru / hack.sh
Created April 14, 2013 09:42 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#