Skip to content

Instantly share code, notes, and snippets.

View hihellobolke's full-sized avatar
💭
I may be slow to respond.

Some Guy hihellobolke

💭
I may be slow to respond.
View GitHub Profile
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"$id": {
"type": "string",
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
## Based of config provided by logstash ... modified to suit our captures
## Documentation of the haproxy log formats can be found at the following links:
## http://code.google.com/p/haproxy-docs/wiki/HTTPLogFormat
## http://code.google.com/p/haproxy-docs/wiki/TCPLogFormat
HAPROXYTIME (?!<[0-9])%{HOUR:haproxy_hour}:%{MINUTE:haproxy_minute}(?::%{SECOND:haproxy_second})(?![0-9])
HAPROXYDATE %{MONTHDAY:haproxy_monthday}/%{MONTH:haproxy_month}/%{YEAR:haproxy_year}:%{HAPROXYTIME:haproxy_time}.%{INT:haproxy_milliseconds}
## Based of config provided by logstash ... modified to suit our captures
## Documentation of the haproxy log formats can be found at the following links:
## http://code.google.com/p/haproxy-docs/wiki/HTTPLogFormat
## http://code.google.com/p/haproxy-docs/wiki/TCPLogFormat
HAPROXYTIME (?!<[0-9])%{HOUR:haproxy_hour}:%{MINUTE:haproxy_minute}(?::%{SECOND:haproxy_second})(?![0-9])
HAPROXYDATE %{MONTHDAY:haproxy_monthday}/%{MONTH:haproxy_month}/%{YEAR:haproxy_year}:%{HAPROXYTIME:haproxy_time}.%{INT:haproxy_milliseconds}
#!/usr/bin/python
def hash(s, key="acdegilmnoprstuw", seed=7, multiplier=37):
'''hashes string and return int
pseudocode:
Int64 hash (String s) {
Int64 h = 7
@hihellobolke
hihellobolke / Oracle-jdk-downloader.sh
Created August 27, 2014 09:42
Downloading JDK via script
#!/bin/bash
URL=http://www.oracle.com/technetwork/java/javase/downloads/index.html
PAGE=$(mktemp)
echo "Downloading $URL"
elinks --dump $URL >> $PAGE
echo " + webpage for JDK 7"
PAGE_JDK7=$(sed -n '/Java se 7u[0-9]\+/I s/^.*\[\([0-9]\+\)]java se.*$/\1/Ip' $PAGE | head -1 )
// Create Vertices
val users: RDD[(VertexId, (String, String))] = sc.parallelize(Array(
//Alice her bank is HSBC, she has APPL shares
(1000L, ("human", "Alice")),
(1001L, ("bank", "HSBC")),
(1002L, ("shares", "APPL")),
//Transaction vertices
@hihellobolke
hihellobolke / scala
Last active April 12, 2019 07:08
Spark GraphX Pattern Matching
import org.apache.spark.graphx._
import org.apache.spark.rdd.RDD
import org.apache.spark.graphx.lib._
/*
* Alice, Dave and Bob are share traders,
* Each maintains atleast 1 trading account in their banks
* Trading accounts have shares, which are bought/sold in a transaction..
*
* E.g.
@hihellobolke
hihellobolke / ssh.plist
Last active August 29, 2015 14:01
ssh plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>com.openssh.sshd</string>
<key>Program</key>
<string>/usr/libexec/sshd-keygen-wrapper</string>
# Grub is updated with correct root=/dev/rootvg/rootvolmenuentry
'Fedora (3.14.3-200.fc20.x86_64) 20 (Heisenbug)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.10-301.fc20.x86_64-advanced-/dev/mapper/rootvg-rootvol' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then