Skip to content

Instantly share code, notes, and snippets.

@emk
emk / apache-logs-hive.sql
Created January 3, 2012 18:01
Apache log analysis with Hadoop, Hive and HBase
-- This is a Hive program. Hive is an SQL-like language that compiles
-- into Hadoop Map/Reduce jobs. It's very popular among analysts at
-- Facebook, because it allows them to query enormous Hadoop data
-- stores using a language much like SQL.
-- Our logs are stored on the Hadoop Distributed File System, in the
-- directory /logs/randomhacks.net/access. They're ordinary Apache
-- logs in *.gz format.
--
-- We want to pretend that these gzipped log files are a database table,
@Antarix
Antarix / UrlImageParser.java
Created November 29, 2012 08:48
UrlImage Parser for android TextView to load Html Image tag
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import android.content.Context;
import android.graphics.Canvas;
@AGWA
AGWA / rpi-hdmi.sh
Last active June 9, 2024 15:15
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
@stefanfoulis
stefanfoulis / README.md
Last active June 10, 2021 03:18
raspberry pi setup

my raspberry pi setup

  • basic setup
  • auto-login on startup
  • chromium
  • shared user with google sync for bookmarks in chromium
  • auto-start chromium with shared bookmark in fullscreen mode (
  • setup synergy
  • setup ssh tunnel for synergy (with restricted rights) (client: ssh -f -N -L 24800:server-hostname:24800 server-hostname)
  • share ssh with zeroconf
@denji
denji / golang-tls.md
Last active July 1, 2024 05:41 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@ecliptik
ecliptik / aisle.txt
Last active January 20, 2022 09:46
Aisle Strings
Resident data ends at 36c4, program starts at 36c4, file ends at 1dd10
Starting analysis pass at address 36c2
End of analysis pass, low address = 36c4, high address = dffc
[Start of code]
Main routine R0001, 0 locals
@mr-pj
mr-pj / dashbutton.py
Last active January 3, 2018 12:34
if dhcp request matches a given mac, an action will be taken. Requires pydhcplib
from pydhcplib.dhcp_network import *
def do_something():
print("button has been pressed")
netopt = {'client_listen_port':"68", 'server_listen_port':"67", 'listen_address':"0.0.0.0"}
class Server(DhcpServer):
def __init__(self, options, dashbuttons):
@elmimmo
elmimmo / DumpCD.tool
Last active August 4, 2022 19:11
Dump contents of optical media upon inserting, then eject and repeat. (requires macOS)
#!/usr/bin/env bash
# Dump contents of optical media upon inserting, then eject and repeat.
#
# Requires macOS.
#
# If ran without the appropriate env variables, it will ask for:
# * destination
# * order no. to be recorded for the first media being copied. The orden no.
# of each copy which will be logged into a CSV file created in _destination_
@fliiiix
fliiiix / telegraf.conf
Created March 27, 2018 17:09
HP 1810-24G Switch (J9450A) telegraf snmp config
[[inputs.snmp]]
agents = [ "atlas.l33t.network:161" ]
community = "l33tsnmp"
[[inputs.snmp.field]]
name = "hostname"
oid = "SNMPv2-MIB::sysName.0"
is_tag = true
# Port 01
[[inputs.snmp.field]]
@cajus
cajus / build-qt-wasm.sh
Last active May 26, 2024 05:56
Building Qt for WebAssembly
# Get dependencies in place (example for Debian based systems)
sudo apt-get build-dep --yes qt5-default
sudo apt-get install --yes libxcb-xinerama0-dev git python cmake default-jre
# Install Emscripten
git clone https://github.com/juj/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source emsdk_env.sh