Skip to content

Instantly share code, notes, and snippets.

View Kilobyte22's full-sized avatar

Stephan Henrichs Kilobyte22

View GitHub Profile
CREATE MATERIALIZED VIEW haproxy.access_logs_view
(
remote_addr String,
remote_port Int32,
ts DateTime,
frontend LowCardinality(String),
tls Boolean,
backend LowCardinality(String),
server LowCardinality(String),
time_request Int32,
#!/bin/bash
title=$(dmenu -p 'password title: ' < /dev/null)
if [[ "$title" != "" ]]; then
if [[ -f ~/.password-store/"$title".gpg ]]; then
ans=$(echo -e 'no\nyes' | dmenu -p 'answer: ' -mesg 'Password exists, do you want to overwrite?' -only-match)
if [[ "$ans" == yes ]]; then
pass generate -f -c "$title" 30 && \
notify-send "Password Store" "Password generated"
#!/usr/bin/env ruby
require 'json'
require 'yaml'
require 'net/http'
KIBI = 1024
MEBI = KIBI * 1024
GIBI = MEBI * 1024
default partial alphanumeric_keys
xkb_symbols "basic" {
include "gb"
include "level3(caps_switch)"
name[Group1] = "English (UK, international with German umlaut)";
key <AD03> { [ e, E, EuroSign, cent ] };
key <AD07> { [ u, U, udiaeresis, Udiaeresis ] };
key <AD09> { [ o, O, odiaeresis, Odiaeresis ] };
key <AC01> { [ a, A, adiaeresis, Adiaeresis ] };
key <AC02> { [ s, S, ssharp ] };
package at.chaosfield.packupdate.common
import scala.util.parsing.combinator._
class BasicAuthParser extends RegexParsers {
// A RegexParsers automatically ignores whitespace by default.
// Technically this means this parser accepts inputs it shouldn't, but i don't really care
// A single token according to RFC2616
def token: Parser[String] = """[^()<>@,;:\\"/\[\]?={} \t]+""".r ^^ { _.toString }
#!/bin/bash
# Preparation:
# create folder addbuildfiles. put your recources (like mcmod.info, images) here
# create folder out. Heres your build output
# create file VERSION. put version here. replace dots with spaces. This version number is 3 parts big (like 1 2 3 (which is 1.2.3), not 1 2 3 4 or 1 2)
# done.
MODNAME="<put your mod name here>"
echo "Reading version file..."
@Kilobyte22
Kilobyte22 / core.rs
Last active August 4, 2017 22:11
Proof of Concept Plugin system for rust
extern crate libloading as lib;
extern crate libplugin as plugin;
use plugin::Plugin;
fn main() {
let lib = lib::Library::new("plugins/libtestplugin.so").unwrap();
unsafe {
let func: lib::Symbol<unsafe fn() -> Box<Plugin>> = lib.get(b"gimme_pluginz\0").unwrap();
let plugin: Box<Plugin> = func();
1. You lose the game by thinking about it
2. When you lose the game you have to publically announce it making everyone around you lose it as well
3. After losing the game you have 30 minutes to forget it again
4. By knowing these rules you are automatically participating
Congratulations, you just lost the game
#include "stdio.h"
#include "stdlib.h"
#include "unistd.h"
void usage() {
printf("Usage: environment command [arguments]\n");
exit(1);
}
int main(int argc, char **argv) {
user:
someone: NOPE
group:
somegroup: YOU GUYS ALL SUCK
#default: uncomment this to set a default message