Skip to content

Instantly share code, notes, and snippets.

View jrwren's full-sized avatar
💭
🤯💯👍🔥🎉🤷‍♀️😍😕🕴🏽😵😞🤕🤮

Jay R. Wren jrwren

💭
🤯💯👍🔥🎉🤷‍♀️😍😕🕴🏽😵😞🤕🤮
View GitHub Profile
@ollyg
ollyg / logstash.conf
Created June 20, 2012 13:29
logstash config and filter to fully parse a syslog message (PRI, timestamp, host)
filter {
# strip the syslog PRI part and create facility and severity fields.
# the original syslog message is saved in field %{syslog_raw_message}.
# the extracted PRI is available in the %{syslog_pri} field.
#
# You get %{syslog_facility_code} and %{syslog_severity_code} fields.
# You also get %{syslog_facility} and %{syslog_severity} fields if the
# use_labels option is set True (the default) on syslog_pri filter.
grok {
type => "syslog-relay"
@wendal
wendal / read_mp3_id3.go
Created September 26, 2012 00:31
GOLANG读取MP3文件的ID3信息
//from http://0x55aa.sinaapp.com/%E7%AE%97%E6%B3%95-%E7%BC%96%E7%A8%8B/676.html?1348618006
package main
import (
"fmt"
"os"
"errors"
"strings"
)
//no tag
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@smoser
smoser / ubuntu-cloud-virtualbox.sh
Last active June 3, 2024 20:36
example of using Ubuntu cloud images with virtualbox
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
@debasishg
debasishg / gist:8172796
Last active May 10, 2024 13:37
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@DavyLandman
DavyLandman / ssh-ssl-in-one.go
Last active January 31, 2016 14:13
The ssh-ssl-behind same port trick but now in go (previous version was in nodejs https://gist.github.com/DavyLandman/8314380 ) for more details on how it works, see the other issue. *why go?:* nodejs is not that nice for low-performance cpu's, and go nicely compiles to a native application :)
package main
import (
"net"
"log"
"time"
)
var noDeadline = time.Time{}

When I need to remember the spelling for a list comprehension with more than one loop in Python, I find the following mnemonic helpful:

write the for statements in the same order you would write a nested loop

For example, suppose we have a nested list that we wish to flatten:

>>> nested_list = [[1, 2, '5!'], (3, 'sir!')]
alienino 3511c0997339cfcccccca39f214322eb22e8fc43
all'equipaggio 14555555ec8dcf1400db9b375c5b8ca836362d8b
Anacyclus 182c40fc4df5b4d997feeeeee22c4dbf059a95d4
bajar 1352a687f6840df8801aaaaaadf71de84b816f86
bandwagon's f6e6deb71111110839bc14dd9cbab6eb7b16f09c
barbihecho bc45de24f03f2a086666668e2a0812a5f270c8cb
calcitrant 86d4ffffff9aae00ace440e93c1d87bb4ec8b56c
cornetti 000000f636f0d7cbc963a62f3a1bc87c9c985a04
crépir a21303cfa9b7c6f0cccccc19cc59556a188ccac7
cyclosporin's b5baaaaaa744f480586a905f692cdec2fa0a1919