Skip to content

Instantly share code, notes, and snippets.

View jskripsky's full-sized avatar

Juraj Skripsky jskripsky

  • Zurich, Switzerland
View GitHub Profile
@jskripsky
jskripsky / BigIntSqrt.fs
Created October 11, 2011 10:07
Square root for BigInteger in F# (taken from http://www.codeproject.com/KB/recipes/BigIntSqrRoot.aspx)
module Roots
open System
open System.Numerics
@jskripsky
jskripsky / rem-color-profiles.sh
Created October 13, 2011 10:50
GraphicsMagick: remove color profile(s)
mogrify +profile '*' -define jpeg:preserve-settings
@jskripsky
jskripsky / push-to-kindle.sh
Created October 19, 2011 14:18
Transfer multiple files to amazon for conversion and delivery on kindle
for file in *.doc; do echo $file; echo "" | mail -s "" -a "$file" -r [sender-addr] [name]@kindle.com; sleep 5; done
@jskripsky
jskripsky / remove-color-profile.sh
Created October 20, 2011 23:14
Remove color profiles, preserve everything else
gm mogrify -define jpeg:preserve-settings +profile "*"
@jskripsky
jskripsky / del-old-zoom-bundles.sh
Created December 5, 2011 17:09
fischer/schuler: delete old zoom bundles
for file in $(ls -t *.xml | tail -n 50); do dir=$(echo $file | sed -e "s/.xml/\//"); rm $file -f; rm $dir -rf; done
#list of files:
# for file in $(ls -t *.xml | tail -n 50); do ls -l $file; done | less
@jskripsky
jskripsky / samples.ldif
Created December 21, 2011 13:11
LDIF samples
dn: dc=mail,dc=domain.ch,ou=hosting,o=hotfeet.ch
arecord: 0.0.0.0
associateddomain: mail.domain.ch
dc: mail
objectclass: dNSDomainExtended
objectclass: domainRelatedObject
dn: cn=Lisa Jangles,ou=People,dc=example,dc=com
changetype: modify
add: telephonenumber
@jskripsky
jskripsky / rsync-daily
Created April 8, 2012 16:41
Script for automated daily rsync-based backups (keeps last 7 days)
#!/bin/sh
### expects file "conf" with configuration
###
### example:
### src="root@mercury"
### dirs="/var /etc /root /home"
### excludes="/var/log/nagios/spool/checkresults/*"
log() {
@jskripsky
jskripsky / rsync_homedirs-exclude.lst
Created April 15, 2012 07:48
rsync: directories and files to exclude in home/*
.evolution
.thumbnails
.gftp/cache
.mozilla/firefox/*/Cache
.wapi
.wine
.ies4linux
.Trash
.ccache
@jskripsky
jskripsky / list-all-rpm-sizes.sh
Created April 26, 2012 12:43
List all installed rpm packages and sizes.
#!/bin/sh
rpm -qa --queryformat="%10{SIZE}\t%{NAME}\n" | sort -k1,1n
@jskripsky
jskripsky / show-all-file-changes.sh
Created April 26, 2012 13:09
show all file additions, modifications, deletions and renames in repo.
#!/bin/sh
for commit in $(git log --pretty=format:%H); do git diff --name-status -M100 $commit~1 ${commit}; done