Skip to content

Instantly share code, notes, and snippets.

View aviafelix's full-sized avatar

Alexander Okrugin aviafelix

View GitHub Profile
@aviafelix
aviafelix / lilypond-makefile
Created September 29, 2015 15:39
Makefile example for LilyPond
SRC = a4.ly tenor1.ly tenor2.ly bass1.ly bass2.ly lyrics.ly header.ly ../lib/paper.ly
RESULT = a4.pdf all.midi
DIRNAME = $(realpath .)
.PHONY: preview publish archive dist play view help
preview pre view $(RESULT): $(SRC)
lilypond a4.ly
mv -f a4.midi all.midi
see a4.pdf &
publish pub a4.publish.pdf: $(SRC)
@aviafelix
aviafelix / create.py
Created May 28, 2015 06:20
Create empty files (e.g.in windows: create a.x b.y ...)
import sys
if len (sys.argv) > 1:
for i in range(1, len(sys.argv)):
open(sys.argv[i], 'a').close()
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
9 = Bad file descriptor
@aviafelix
aviafelix / python-parsing-dates.py
Created April 27, 2015 16:24
Python datetime / dateutil parsing dates example
import datetime
import dateutil.parser
timestring1 = '2007-03-04T21:08:12.127'
timestring2 = '2012-03-04 12:08:12.354'
dt1 = datetime.datetime.strptime(timestring1, '%Y-%m-%dT%H:%M:%S.%f')
dt2 = datetime.datetime.strptime(timestring2, '%Y-%m-%d %H:%M:%S.%f')
dup1 = dateutil.parser.parse(timestring1)
dup2 = dateutil.parser.parse(timestring2)
@aviafelix
aviafelix / amazonlinux_changed.md
Created April 14, 2015 10:42
Setup tsung for AmazonLinux
@aviafelix
aviafelix / configure-load-testing-stand.md
Created April 14, 2015 08:33
Example: Setting up load testing stand with Yandex-Tank, JMeter and Tsung on CentOS 7+
@aviafelix
aviafelix / tsung-centos-install.txt
Created April 10, 2015 08:46
installing tsung in centos
yum -y install erlang perl perl-RRD-Simple.noarch perl-Log-Log4perl-RRDs.noarch gnuplot perl-Template-Toolkit firefox
wget http://tsung.erlang-projects.org/dist/tsung-x.x.x.tar.gz
tar zxfv tsung-1.4.2.tar.gz
cd tsung-1.4.2
./configure && make && make install
cp /usr/share/doc/tsung/examples/http_simple.xml /root/.tsung/tsung.xml
@aviafelix
aviafelix / gosthash.js
Created January 23, 2015 06:43
Javascript GOST R 34.11-94 hash function implementation
/**
* Javascript GOST R 34.11-94 hash function implementation.
* Based on C-code by Alexei Kravchenko and Markku-Juhani Saarinen
* and Utf8 class by Chris Veness.
*
* Usage: gosthash("<string>") returns a hash-string.
* Alexander Okrugin (November, 11, 2011)
*/
var Utf8 = {}; // Utf8 namespace
Utf8.encode = function (strUni) {
@aviafelix
aviafelix / graphite-dashboards.txt
Created January 18, 2015 18:44
Graphite Dashboards and Tools
Graphite dashboards:
http://dashboarddude.com/blog/2013/01/23/dashboards-for-graphite/
stackoverflow.com/a/15840928/318557
Charcoal https://github.com/cebailey59/charcoal
Cubism.js http://square.github.com/cubism/
Dashing http://shopify.github.com/dashing/
Descartes https://github.com/obfuscurity/descartes
Dusk https://github.com/obfuscurity/dusk