Skip to content

Instantly share code, notes, and snippets.

View onjin's full-sized avatar

Marek Wywiał onjin

View GitHub Profile
@onjin
onjin / mkchangelog
Created March 7, 2014 07:41
Script creates CHANGELOG.txt according to current git tags.
#!/bin/bash
#
# usage: ./mkchangelog
#
# author: Marek Wywiał <[email protected]>
#
# description: Script creates CHANGELOG.txt according to current git tags. Also
# supports commits without tags (git log HEAD...first_tag).
# Lines starting with 'Merge' will be skipped.
# Remember to add 'include CHANGELOG.txt' into your MANIFEST.in if
[gui]
editor = gvim
[color]
ui = auto
diff = auto
branch = always
status = off
[color "branch"]
current = yellow reverse
local = yellow
<advancedsettings>
<network>
<cachemembuffersize>20971520</cachemembuffersize>
<disableipv6>true</disableipv6>
</network>
<fanartres>720</fanartres>
<imageres>540</imageres>
<gputempcommand>echo "$(/opt/vc/bin/vcgencmd measure_temp | grep -o "[0-9]\{2\}") C"</gputempcommand>
<cputempcommand>echo "$(/opt/vc/bin/vcgencmd measure_temp | grep -o "[0-9]\{2\}") C"</cputempcommand>
<lookandfeel>
@onjin
onjin / gist:7819537
Created December 6, 2013 06:40
Fix skype audio/video on ubuntu 13.10 x64 - audio distortion or missing and inverted video. Put it in ~/bin/skype and add ~/bin to PATH in f.i. .bashrc export PATH=~/bin:$PATH.
#!/bin/bash
env PULSE_LATENCY_MSEC=30 LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so /usr/bin/skype
@onjin
onjin / grant_ro_pgsql_access.sh
Created November 8, 2013 08:46
grant select permission for given database (tables) to given database user
#!/bin/bash
#
# Grant SELECT on database to given username
# ./grant_ro_pgsql_access.sh dbname dbuser
#
function usage {
echo "Usage: $0 dbname dbuser"
}
@onjin
onjin / dropshot
Last active December 22, 2015 11:29
Command to get region screenshot and publish it on Dropbox
#!/bin/bash
#
# Gets screenshot using imagemagick import command
# puts it in Dropbox folder and returns dropbox url
# to screenshot
# Usage: dropshot [suffix]
# suffis - is optional, default 'dropshot'
# screenshots target directory
@onjin
onjin / docker
Created July 12, 2013 08:19
/etc/init.d/docker file for debian
#!/bin/sh
# https://launchpad.net/~dotcloud/+archive/lxc-docker/+packages
### BEGIN INIT INFO
# Provides: docker
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: autofs $network $named alsa-utils pulseaudio
# Should-Stop: autofs $network $named alsa-utils pulseaudio
# Default-Start: 2 3 4 5
@onjin
onjin / cgminer.conf
Created April 29, 2013 06:41
My cgminer config for 7950
{
"pools" : [
{
"url" : "http://stratum.d7.lt:3333",
"user" : "user.1",
"pass" : "pass"
}
]
,
@onjin
onjin / commit-msg.py
Last active November 5, 2019 01:49
Git commit hook to check commit message according to angularjs guidelines: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
#!/usr/bin/env python
"""
Git commit hook:
.git/hooks/commit-msg
Check commit message according to angularjs guidelines:
* https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
"""
import sys
@onjin
onjin / gist:5353305
Created April 10, 2013 09:50
json grep utility
#!/usr/bin/env python
import sys
import re
import json
def jsongrep(d, patterns):
try:
pattern = patterns.pop(0)
except IndexError: