Skip to content

Instantly share code, notes, and snippets.

View georgik's full-sized avatar

Juraj Michálek georgik

View GitHub Profile
@georgik
georgik / rename-to-lowercase.sh
Created September 4, 2016 10:31
Rename files in current directory to lower case - bash
#!/bin/bash
for I in *; do
mv $I `echo $I|tr [A-Z] [a-z]`
done
@georgik
georgik / gist:75c1974af9aa0ccfd1d3
Created July 1, 2014 13:48
DHCP LPR detection
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SCDynamicStoreCopyDHCPInfo.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
CFDictionaryRef info = SCDynamicStoreCopyDHCPInfo(NULL, NULL);
if (info != NULL) {
// code RFC 2132 - http://www.ietf.org/rfc/rfc2132.txt
task helloFromGist() {
description "Say Hello! Code stored as gist at Github."
doLast {
println "Hello from gist!"
}
}
@georgik
georgik / .zshrc
Created March 11, 2014 15:43
zshrc - color prompt
zmodload zsh/complist
export ZLS_COLORS=''
#Saving history
HISTSIZE=200
HISTFILE=~/.zsh_history
SAVEHIST=200
function precmd {
@georgik
georgik / gist:5750758
Created June 10, 2013 17:43
Parse file, find version number and increase it. Version for Linux
#!/bin/bash
if [ -z "$1" ]; then
echo "Specify file name"
exit 1
fi
FILE="$1"
VERSION=`grep ' : "v' "$FILE" | sed -e 's/^.* : "v\([^"]*\)*".*$/\1/g' `
VERSION=$[ VERSION + 1 ]