Skip to content

Instantly share code, notes, and snippets.

View dragolabs's full-sized avatar

Vitaly Shishlyannikov dragolabs

View GitHub Profile
@dragolabs
dragolabs / nginx-vbulletn.conf
Created August 2, 2013 04:06
nginx config for vbulletin 5 forum. And read the comments in config.php: // ****** Base URLs ****** // The following settings all deal with the url of your forum. // If set incorrectly your site/software will not function correctly. // These urls should NOT include a trailing slash <------- !!! // This is the url and web path of your root vBulle…
server {
listen 80;
server_name forum.example.com;
root /var/www/example_forum/;
index index.php;
access_log /var/log/nginx/forum.example.access.log main;
error_log /var/log/nginx/forum.example.error.log;
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@dragolabs
dragolabs / sublime settings
Created March 7, 2014 09:24
sublime settings
{
"font_size": 15,
"ignored_packages":
[
"Vintage",
"Markdown"
],
"open_files_in_new_window": false,
"soda_classic_tabs": true,
"soda_folder_icons": true,
#!/bin/bash
while getopts a:bc: flag; do
case $flag in
a)
opt_a=$OPTARG
;;
b)
opt_b=1
;;
@dragolabs
dragolabs / ubunru-rsyslog-hack.sh
Last active August 18, 2017 16:35
Hack to repair 100% CPU load by rsyslog on ubuntu 12.04 in openvz
#!/bin/sh
service rsyslog stop
sed -i -e 's/^\$ModLoad imklog/#\$ModLoad imklog/g' /etc/rsyslog.conf
service rsyslog start
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@dragolabs
dragolabs / ssh-proxy
Created May 23, 2014 08:30
SOCKS proxy through ssh
ssh -D 9999 user@server
use socks 4\5, disable other proxy settings
@dragolabs
dragolabs / date-formats.md
Last active July 19, 2017 17:38
date formats

Some formats for date command

  • 140702 - date +%y%m%d
  • 20140702 - date +%Y%m%d
  • 20140702155934 - date +%Y%m%d%H%M%S
  • 2014.07.02 - date +%Y.%m.%d
  • 2014-07-02 - date +%F
  • 1404313240 - date +%s [seconds since 1970-01-01 00:00:00 UTC]
@dragolabs
dragolabs / fpm-example.sh
Created July 2, 2014 15:24
Example for packaging pecl extension with fpm
fpm --force \
-s dir \
-t deb \
--vendor dragolabs \
--maintainer 'Vitaly Shishlyannikov <vitaly@dragolabs.org>' \
--deb-user root \
--deb-group root \
--url http://dragolabs.org \
--version $VERSION \
--iteration ddr`date +%y%m%d%H%M` \
@dragolabs
dragolabs / bash-header.sh
Created July 2, 2014 15:28
Example head of bash script
#!/usr/bin/env bash
set -o pipefail
set -o errexit
# set -o xtrace
__DIR__="$(cd "$(dirname "${0}")"; echo $(pwd))"
__BASE__="$(basename "${0}")"
__FILE__="${__DIR__}/${__BASE__}"