Skip to content

Instantly share code, notes, and snippets.

View zwass's full-sized avatar
🌐
Hiring engineers #remote worldwide: fleetdm.com/jobs

Zach Wasserman zwass

🌐
Hiring engineers #remote worldwide: fleetdm.com/jobs
View GitHub Profile
@zwass
zwass / etc_hosts.table
Last active August 7, 2018 23:24
osquery etc_hosts table schema
table_name("etc_hosts", aliases=["hosts"])
description("Line-parsed /etc/hosts.")
schema([
Column("address", TEXT, "IP address mapping"),
Column("hostnames", TEXT, "Raw hosts mapping"),
])
attributes(cacheable=True)
implementation("etc_hosts@genEtcHosts")
This is a test CLA
$ make clean && make distclean && make deps && make -j2 && make test
cd build/precise && cmake ../../ && \
CTEST_OUTPUT_ON_FAILURE=1 make clean --no-print-directory
-- Requested dependencies may have changed, run: make deps
-- Building for platform Ubuntu (ubuntu, precise)
-- Building osquery version 1.0.3-2313-g81109ef sdk 1.0.3
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vagrant/osquery/build/precise
rm -rf .sources build/precise build/debug_precise build/docs
/*
* Copyright (c) 2004-2015 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
@zwass
zwass / worker.py
Created April 21, 2013 03:40
Really old work on aggregating RSS feeds into a Twitter account. Style is lacking, could really use some lovin'.
import os
import time
import json
from urllib import urlencode
import tweepy
import feedparser
import pymongo
import requests
from BeautifulSoup import BeautifulSoup
@zwass
zwass / break_hash.go
Created April 1, 2013 22:52
For cracking the hash in http://xkcd.com/1193/
package main
import (
"fmt"
"crypto/skein" //https://github.com/wernerd/Skein3Fish
"encoding/hex"
"os"
"bufio"
"io"
"strings"
@zwass
zwass / scrape_ama_reviews.py
Created February 26, 2013 19:39
Basic scraping of Amazon reviews
import requests
from bs4 import BeautifulSoup, NavigableString
def get_review_text(block):
"""Get just the text of a review from it's DIV"""
strings = []
for possible_text in block.children:
if isinstance(possible_text, NavigableString):
stripped_text = possible_text.strip()
@zwass
zwass / gist:4991471
Created February 20, 2013 00:06
Watch out, Chrome.
҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈⃦⃧⃜⃧⃛⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧⃤⃧ ⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧⃧ه҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈҈
@zwass
zwass / euler4.py
Created December 11, 2012 22:48
One-liner brute force solution to Project Euler problem 4 (http://projecteuler.net/problem=4)
print sorted([int(c) for c in [str(x * y)
for x in range(999, 99, -1)
for y in range(999, x - 1, -1)]
if all([c[i] == c[-1 - i]
for i in range(len(c) / 2)])])[-1]
@zwass
zwass / gist:4163491
Created November 28, 2012 19:28
Haskell config
;;Haskell setup
(defun haskell-custom-setup ()
(progn
(define-key haskell-mode-map (kbd "C-x C-s") 'haskell-mode-save-buffer)
(setq haskell-indent-offset 2)
(ghc-init)
(flymake-mode 1)
(defun haskell-mode-stylish-buffer-custom ()