Skip to content

Instantly share code, notes, and snippets.

@radixvinni
radixvinni / qtkb.py
Last active December 20, 2015 20:56
virtual MIDI keyboard on PyQt4. To run this use commands: jack_control start && timidity -iA -Oj -B2,8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"virtual MIDI keyboard on PyQt4. To run this use commands: jack_control start && timidity -iA -Oj -B2,8"
from PyQt4.QtGui import QGridLayout, QHBoxLayout, QLineEdit, QPushButton, QSizePolicy, QVBoxLayout, QWidget
from PyQt4.QtCore import QSize, SIGNAL, QEvent
# this app will list all MIDI devices and associated numbers
# Pick the correct number associated, and restart the app.
@radixvinni
radixvinni / dir2dot.pl
Last active October 29, 2022 02:16
Plot directory or file tree structure graph with graphviz neato
#!/usr/bin/perl
# dir2dot.pl v0.5 (C) Darxus@ChaosReigns.com, released under the GPL.
# Download from: http://www.chaosreigns.com/code/
#
# Generates a directed graph of a directory tree using graphviz like so:
#
# find . -type d -print | perl dir2dot.pl > dirtree.dot
# neato -Tpng dirtree.dot > dirtree.png
#
groups = {
"POST": ["NOUN","ADJF","ADJS","COMP","VERB","INFN","PRTF","PRTS","GRND","NUMR","ADVB","NPRO","PRED","PREP","CONJ","PRCL","INTJ"],
"anim": ["ANim","anim","inan","Inmx"],
"GNdr": ["masc","femn","neut","Ms-f"],
"NMbr":["sing","plur","Sgtm","Pltm","Fixd"],
"CAse":["nomn","gent","datv","accs","ablt","ablt","loct","voct","gen1","gen2","acc2","loc1","loc2"],
"ASpc":["perf","impf"],
"TRns":["tran","intr"],
"PErs":["1per","2per","3per"],
"TEns":["pres","past","futr"],
@radixvinni
radixvinni / gist:3799787
Created September 28, 2012 13:16
cryptsetup
cryptsetup -y --cipher aes-xts-plain:sha512 --key-size 512 luksFormat /dev/sdb1
@radixvinni
radixvinni / .bashrc
Created May 27, 2011 21:27
.bash_rc для удаленного доступа к компьютеру через ssh
export DISPLAY=`echo $SSH_CONNECTION | awk '{print $1}'`":0.0"
@radixvinni
radixvinni / iptable-radmin
Created May 16, 2011 10:04
iptables add rule to route port 3899(radmin) to 10.0.1.196
iptables -t nat -A PREROUTING -s 195.230.96.32 -d 91.206.57.66 -i eth0 -p tcp -m tcp --dport 3899 -j DNAT --to-destination 10.0.1.196:3899
iptables -t filter -I RH-Firewall-1-INPUT 10 -d 10.0.1.222 -p tcp -m tcp --dport 80 -j ACCEPT