Skip to content

Instantly share code, notes, and snippets.

View drakmail's full-sized avatar
🇦🇷
Working

Alex Maslov drakmail

🇦🇷
Working
View GitHub Profile
[pid: 11659|app: 0|req: 39822/77306] 62.176.21.105 () {46 vars in 1615 bytes} [Sat Aug 25 00:58:56 2012] GET /notifications/count/ => generated 1 bytes in 390 msecs (HTTP/1.1 200) 3 headers in 112 bytes (1 switches on core 0)
[pid: 11659|app: 0|req: 39823/77307] 62.176.21.105 () {46 vars in 1615 bytes} [Sat Aug 25 00:59:01 2012] GET /notifications/count/ => generated 1 bytes in 362 msecs (HTTP/1.1 200) 3 headers in 112 bytes (1 switches on core 0)
[pid: 11660|app: 0|req: 37485/77308] 93.186.224.104 () {36 vars in 596 bytes} [Sat Aug 25 00:59:02 2012] GET /news/ugly_vk/ => generated 2367 bytes in 5 msecs (HTTP/1.1 200) 2 headers in 94 bytes (242 switches on core 0)
[pid: 11659|app: 0|req: 39824/77309] 62.176.21.105 () {46 vars in 1615 bytes} [Sat Aug 25 00:59:07 2012] GET /notifications/count/ => generated 1 bytes in 378 msecs (HTTP/1.1 200) 3 headers in 112 bytes (1 switches on core 0)
[pid: 11659|app: 0|req: 39825/77310] 62.176.21.105 () {46 vars in 1615 bytes} [Sat Aug 25 00:59:12 2012] GET /notifications/c
iostat -x
Linux 2.6.32-5-amd64 (d-hc.ru) 08/24/2012 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
1.14 0.00 0.25 1.89 0.00 96.72
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 4.38 21.96 1.80 15.62 729.42 298.68 59.05 0.63 36.34 14.34 24.97
sdb 3.86 21.95 2.36 15.62 733.11 298.68 57.36 0.54 30.29 12.87 23.14
md0 0.00 0.00 0.00 0.00 0.00 0.02 7.98 0.00 0.00 0.00 0.00
cat /usr/share/uwsgi/conf/default.ini
# User-made changes in this file will be silently lost, as it is silently
# rewrited with upgrade of uwsgi package.
#
# If you want to change default options of uWSGI daemon, then:
# * copy this file somewhere
# * add/remove/change options in copied file
# * edit /etc/default/uwsgi and change location of inherited configuration
# file to path to copied file
@drakmail
drakmail / .bashrc
Created September 18, 2012 10:10
Nice PS1 for bash
# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
bash_prompt() {
local NONE="\[\033[0m\]" # unsets color to term's fg color
@drakmail
drakmail / remove_background.sh
Created October 29, 2012 15:52
remove white background with imagemagick
convert "$1" -bordercolor white -border 1x1 \
-alpha set -channel RGBA -fuzz 20% \
-fill none -floodfill +0+0 white \
-shave 1x1 $2
#!/bin/sh
HERE=0
while [ 1 -eq 1 ]; do
hcitool info 54:9B:12:9B:9E:0D > /dev/null
MAG=$?
hcitool info F4:9F:54:4F:6F:23 > /dev/null
V1RUS=$?
if [ $V1RUS -eq 0 -o $MAG -eq 0 ] ; then
echo "HE IS HERE"
@drakmail
drakmail / gist:5476161
Created April 28, 2013 07:08
Определение пола на ruby. Использование - detect_gender_by_given_name("Имя", "Фамилия", "Отчество").
# -*- coding: utf-8 -*-
FEMININE = 0
MASCULINE = 1
UNDEF = -1
MASCULINE_NAMES = %w[Аба Азарья Акива Аккужа Аникита Алёша Андрюха Андрюша Аса Байгужа
Вафа Ваня Вася Витя Вова Володя Габдулла Габидулла Гаврила Гадельша
Гайнулла Гайса Гайфулла Галиулла Гарри Гата Гдалья Гийора Гиля Гошеа
Данила Джиханша Дима Зайнулла Закария Зия Зосима Зхарья Зыя Идельгужа
wget -O chruby-0.3.4.tar.gz https://github.com/postmodern/chruby/archive/v0.3.4.tar.gz
tar -xzvf chruby-0.3.4.tar.gz
cd chruby-0.3.4
PREFIX=$HOME/chruby make install
echo 'source ~/chruby/share/chruby/chruby.sh' >> ~/.bash_login
git clone git://github.com/sstephenson/ruby-build.git ~/chruby-0.3.4/ruby-build
cd ~/chruby-0.3.4/ruby-build
PREFIX=$HOME/chruby ./install.sh
~/chruby/bin/ruby-build 2.0.0-p0 ~/.rubies/2.0.0-p0
echo 'chruby 2.0.0-p0' >> ~/.bash_login
{
'packages': {
'groups': ['KDE', 'Gnome', 'minimal'],
'else': ['inkscape', 'gimp', 'firefox']
},
'timezone': 'Europe/Moscow',
'users': {
'root': {'password': 'asdf'},
'rogvold': {'password': 'qwerty',
'full_name': 'Rogaboru Kujimoshi',
# Sends reminders to issue assignees
# Available options:
# * :days => how many days in the future to remind about (defaults to 7)
# * :tracker => id of tracker for filtering issues (defaults to all trackers)
# * :project => id or identifier of project to process (defaults to all projects)
# * :users => array of user ids who should be reminded
def self.reminders(options={})
days = options[:days] || 7
project = options[:project] ? Project.find(options[:project]) : nil
tracker = options[:tracker] ? Tracker.find(options[:tracker]) : nil