Skip to content

Instantly share code, notes, and snippets.

Chris chriscz

  • South Africa
Block or report user

Report or block chriscz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chriscz
chriscz / yardoc_cheatsheet.md
Last active Feb 13, 2020 — forked from phansch/yardoc_cheatsheet.md
Improved YARD cheatsheet
View yardoc_cheatsheet.md
View protobuf3_install.sh
#!/bin/bash
# https://gist.github.com/sofyanhadia/37787e5ed098c97919b8c593f0ec44d8
# Make sure you grab the latest version
set -euo pipefail
VERSION='3.5.1'
FILENAME=protoc-${VERSION}-linux-x86_64.zip
INSTALL="/opt/protobuf/protoc-${VERSION}"
CURRENT="/opt/protobuf/current"
@chriscz
chriscz / signalhandling.py
Last active Dec 27, 2016
Snippet for signal handling in Python (useful for monitoring)
View signalhandling.py
import signal
import os
import readline
from pprint import pprint
def handle_shell(signal, frame):
frames = []
while frame:
@chriscz
chriscz / filemonitor.py
Last active Feb 10, 2017
Python snippet for monitoring where files were opened
View filemonitor.py
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@chriscz
chriscz / mucow.c
Last active Apr 8, 2018
Dirty COW PoC with multipage support
View mucow.c
/*
* Multipage COW PoC
*/
#include <fcntl.h>
#include <pthread.h>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/mman.h>
#include <sys/stat.h>
@chriscz
chriscz / timewn.py
Last active Oct 17, 2019
A python script to notify you of your current TimeWarrior task
View timewn.py
#!/usr/bin/env python
# Notifies the user of the curently active TimeWarrior task every m minutes (default 10min).
# Requirements
# - python 2.7
# - pynotify
# Usage:
# python timewn.py [optional seconds]
import sys
import pynotify
You can’t perform that action at this time.