Skip to content

Instantly share code, notes, and snippets.

@DosAmp
DosAmp / gist:868276
Created March 13, 2011 17:28
Simple VBscript to toggle IE proxy usage
Dim wsh, enabled, antwort
Const PROXY_KEYNAME = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
Set wsh = WScript.CreateObject("WScript.Shell")
enabled = wsh.RegRead(PROXY_KEYNAME)
dialogText = "Die Proxynutzung ist "
If enabled = 0 Then
dialogText = dialogText & "deaktiviert." & vbCrLf & _
@DosAmp
DosAmp / gist:913635
Created April 11, 2011 14:49
Autofire script for semiautomatic Source weapons
// autofire.cfg: DosAmp's simple autofire script
/// core autofire functionality
alias +attack_af "alias do_af af; do_af"
alias -attack_af "alias do_af -attack"
// adapt "wait 4" for desired fire delay (in frames)
alias af "+attack; wait; -attack; wait 4; do_af"
/// autofire toggle switch
@DosAmp
DosAmp / gist:951489
Created May 2, 2011 11:41
Auto-updater cron script for BOINC projects
#!/bin/sh
# /etc/cron.hourly/boinc-update: forces all BOINC projects to update regularly
RPC_AUTH_FILE=/var/lib/boinc-client/gui_rpc_auth.cfg
# sometimes: RPC_AUTH_FILE=/var/lib/boinc/gui_rpc_auth.cfg
# in Debian: RPC_AUTH_FILE=/etc/boinc-client/gui_rpc_auth.cfg
RPC_AUTH=
if [ -r $RPC_AUTH_FILE ] && [ -s $RPC_AUTH_FILE ]; then
RPC_AUTH=`cat $RPC_AUTH_FILE`
@DosAmp
DosAmp / resize_mc.c
Created July 17, 2011 13:38
Windows tool for resizing Minecraft to a specific frame size
#include <windows.h>
#define MC_LAUNCHER_WINDOW_TITLE L"Minecraft Launcher"
#define MC_GAME_WINDOW_TITLE L"Minecraft"
#define TARGET_WIDTH 432
#define TARGET_HEIGHT 240
// method by Guy Lecky-Thompson
// http://www.suite101.com/content/client-area-size-with-movewindow-a17846
@DosAmp
DosAmp / gist:1099630
Created July 22, 2011 15:06
Central European Timezone snippet for times when you have no control over /etc/TZ or /etc/timezone
cetz() {
LANG=C
# current year
YEAR=`date +%Y`
# current time stamp
NOW=`date +%s`
# transition day for Central European Summer Time
LAST_SUNDAY_OF_MARCH=`cal 3 $YEAR | sed '/^$/d' | tail -n 1 | cut -d ' ' -f 1`
# transition day for Central European Time
#!/usr/bin/python3
import socket, json
server_address = ('', 25565)
disconnect_message = "Server currently unavailable"
# encode an integer into a protobuf-compatible VarInt
def varint(i):
if i < 0:
@DosAmp
DosAmp / windowtoggle.c
Last active December 10, 2015 06:59
Windows console tool for toggling visibility of windows
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <windows.h>
#include <tchar.h>
#if defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif
@DosAmp
DosAmp / gpgwrapper.ps1
Last active December 19, 2015 11:39
Small drag-and-drop wrapper script for GnuPG
$gpgid = "DEADBEEF" # recipient ID (hex/email)
# add full path to binaries if needed
$gpgcommand = "gpg2"
$7zcommand = "7z"
foreach ($file in $args) {
$source = Get-Item -ErrorAction:SilentlyContinue $file
if ($source) {
if (-not $source.PSIsContainer) {
# file encryption/decryption
@DosAmp
DosAmp / encryptporn.sh
Last active December 23, 2015 11:09
Because sometimes there is no use in obscuring a script’s purpose in its name.
#!/bin/bash
GPG_EXTRA_OPTIONS="--compress-algo none"
RECIPIENT="--default-recipient-self"
OUTDIR=
QUIET=
while getopts "h\?r:o:q" o
do
@DosAmp
DosAmp / Wetten v2.csv
Last active December 29, 2015 20:39
Liste von Wetten in #winhistory
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Wer;hat gegen wen;wann;um was;unter welcher Einschränkung;bezüglich was gewettet;mit welchem Ausgang;und hat dies erfüllt?
gandro;Commodore-Freak;;1 Flasche Mate;;Commodore-Freak hält es NICHT länger als eine Woche mit NetworkManager aus;negativ;ja
Commodore-Freak;;;1 Runde Schnitzel am C3;;Winhistory-Community existiert NICHT mehr nach dem Ende von Facebook;
gandro;DosAmp;26.10.2012;1 Flasche Mate;nur am 29C3;Obama bleibt US-Präsident nach der Wahl;positiv;
Commodore-Freak;oreissig;07.11.2012;1 Getränk;nur am 29C3;Erraten von Commos neuen Smartphone;positiv;ja
Commodore-Freak;;07.11.2012;HTC Mozart;nur am 29C3;im Gegenzug für meiste ausgegebene Getränke auf der Party;;
Kaiser;;07.11.2012;;;Commodore-Freaks HP Pre3 hält NICHT länger als bis zum 06.05.2013;negativ;
oreissig;Commodore-Freak;11.11.2012;1 Bier;nur am 29C3;oreissigs Tablet hat eine höhere Version von WebOS als Commos HP Pre3;positiv;ja
gandro;TAL;04.02.2013;1 Flasche Mate;;Horizontal Dock von Henge Docks (https://hengedocks.com/order_horizontal_do