Skip to content

Instantly share code, notes, and snippets.

@zohead
zohead / keybase.md
Created September 16, 2019 11:39
keybase.md

Keybase proof

I hereby claim:

  • I am zohead on github.
  • I am nocwat (https://keybase.io/nocwat) on keybase.
  • I have a public key whose fingerprint is BFB4 5684 D59B 108F E33E 26CC 3B09 D460 88AD ED69

To claim this, I am signing this object:

@zohead
zohead / win10-spotlight
Created August 21, 2017 06:19
Export Windows 10 Spotlight images by WSL (Bash on Windows)
#!/bin/sh
[ -d test ] || mkdir test
ind=0
username=`whoami`
for i in `ls /mnt/c/Users/$username/AppData/Local/Packages/Microsoft.Windows.ContentDeliveryManager_*/LocalState/Assets/*`; do
cp $i test/$ind.jpg
ind=`expr $ind + 1`
done
#!/usr/bin/python
"""
msysGit to Unix socket proxy
============================
This small script is intended to help use msysGit sockets with the new Windows Linux Subsystem (aka Bash for Windows).
It was specifically designed to pass SSH keys from the KeeAgent module of KeePass secret management application to the
ssh utility running in the WSL (it only works with Linux sockets). However, my guess is that it will have uses for other
@zohead
zohead / SimpleHTTPServerWithUpload.py
Last active March 14, 2020 21:18 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version, support port parameter
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@zohead
zohead / crouton
Created January 16, 2016 16:18
modified crouton script for China user, download ad_hd from googlesource.com via itzmx proxy
#!/bin/sh -e
# Copyright (c) 2015 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file of the source repository, which has been replicated
# below for convenience of distribution:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
@zohead
zohead / modcrc.c
Created March 11, 2015 07:36
display linux module vermagic and CRC value
a/*
* Linux kernel module fucker
*
* by wzt <wzt.wzt@gmail.com>
*
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@zohead
zohead / bind.c
Created July 8, 2014 09:39
libc bind and connect function wrapper module to specify fixed bind port
/*
Copyright (C) 2000 Daniel Ryde
Modified by Uranus Zhou (2014)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
@zohead
zohead / copy_qqmsg.au3
Created April 8, 2014 14:12
AutoIt script to export QQ remote message log
Local $hWnd = WinGetHandle("[CLASS:TXGuiFoundation; TITLE:qqgroup]", "")
Local $editWnd = WinGetHandle("EditPlus", "")
$i=1
While $i<=200
WinActivate($hWnd)
Local $aPos = WinGetPos("[ACTIVE]")
MouseClick("left", $aPos[0] + $aPos[2] - 52, $aPos[1] + $aPos[3] - 18)
Sleep(100)
$i=$i+1
@zohead
zohead / xml2json.xslt
Last active July 13, 2016 07:10
xsl stylesheet used to convert XML to JSON, details: https://zohead.com/archives/libexslt-xml-json/
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Copyright (c) 2006, Doeke Zanstra
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
@zohead
zohead / exec-notify.c
Created December 31, 2013 06:56
Linux process notification, from: http://users.suse.com/~krahmer/exec-notify.c
/* exec-notify, so you can watch your acrobat reader or vim executing "bash -c"
* commands ;-)
* Requires some 2.6.x Linux kernel with proc connector enabled.
*
* $ cc -Wall -ansi -pedantic -std=c99 exec-notify.c
*
* (C) 2007-2010 Sebastian Krahmer <krahmer@suse.de> original netlink handling
* stolen from an proc-connector example, copyright folows:
*/
/*