Skip to content

Instantly share code, notes, and snippets.

@iamsilvio
iamsilvio / deleteonerror.dvtcolortheme
Created October 11, 2014 22:54
deleteonerror Xcode color theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 0.886275 0.180392 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 0.886275 0.180392 1</string>
@iamsilvio
iamsilvio / gist:4529535
Created January 14, 2013 11:43
add a thumbnail Photo to a AD User
$photo = [byte[]](Get-Content d:\port300.png -Encoding byte)
Set-ADUser SAMACCOUNTNAME -Replace @{thumbnailPhoto=$photo}
@iamsilvio
iamsilvio / removecompletedtorrents.sh
Last active December 13, 2015 19:28 — forked from bulljit/removecompletedtorrents.sh
F: Added prowl support
#!/bin/sh
# script to check for complete torrents in transmission folder, then stop and move them
# either hard-code the MOVEDIR variable here…
MOVEDIR=/media/tc/downloads # the folder to move completed downloads to
# …or set MOVEDIR using the first command-line argument
# MOVEDIR=%1
AUTH="PWD"
USER="USER"
# And push a message to PROWL
# Fill in with your own API key here
@iamsilvio
iamsilvio / enforce-message.py
Last active December 14, 2015 05:49
Mercurial commit message hook B: fixed Changegroup handling
import re
def checkMessage(message):
"""
Checks if the message content matches one of the message rules
B: <message>
R: <message>
F: <message>
S: <message>
Merge
@iamsilvio
iamsilvio / prow_push.py
Created March 23, 2013 12:59
quick and dirty prowl push with proxy (keep care to specify a real exception to catch and log if needed)
import urllib
import urllib2
API_URL = 'https://api.prowlapp.com/publicapi/add'
API_KEY = 'xxxxxxxxxxxxxxxxxxx'
PROXY = 'xxx.xxx.xxx.xxx:xxxx'
def push():
@iamsilvio
iamsilvio / prowlHandler.py
Created May 13, 2013 14:05
a loggingHandler for Python to send notifications via the Prowl API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
class ProwlHandler(logging.Handler):
"""
A handler class which sends a Prowl notification for each logging event.
"""
@iamsilvio
iamsilvio / Default (Linux).sublime-keymap
Last active December 19, 2015 08:09 — forked from coldnebo/Default (Linux).sublime-keymap
Changed Tidy xml to work with Sublime Text 3 Beta 3047 Added Some error output to the console
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
@iamsilvio
iamsilvio / commit-msg
Created July 10, 2013 10:19
git commit-msg hook to reject bad formated messages
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
def checkMessage(msg):
"""
Checks if the message content matches one of the message rules
B: <message>
@iamsilvio
iamsilvio / MapCapslockToControl.ps1
Created October 16, 2018 14:56
Map caps lock to Ctrl on Windows
#-> Map caps lock to control (Run as Admin -> reboot required)
$hexified = "00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00".Split(',') | ForEach-Object { "0x$_"};
$kbLayout = 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout';
New-ItemProperty -Path $kbLayout -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$hexified);
@iamsilvio
iamsilvio / zfs_health_check.sh
Created May 9, 2020 10:50 — forked from Rychu-Pawel/zfs_health_check.sh
ZFS Health Check script for monit. For detailed description and usage go to http://pawelrychlicki.pl/Article/Details/58/zfs-health-check-script-for-monit-09
#! /bin/sh
#
## ZFS health check script for monit.
## v0.9.0.2
#
## Should be compatible with FreeBSD and Linux. Tested on Ubuntu.
## If you want to use it on FreeBSD then go to Scrub Expired section
## and comment two Ubuntu date lines and uncomment two FreeBSD lines
#
## Assumed usage in monitrc (where 80 is max capacity in percentages