Skip to content

Instantly share code, notes, and snippets.

View aalemayhu's full-sized avatar
💭
If at first the idea is not absurd, then there is no hope for it - Albert

Alexander Alemayhu aalemayhu

💭
If at first the idea is not absurd, then there is no hope for it - Albert
View GitHub Profile
@aalemayhu
aalemayhu / uuid.alemayhu.service
Created July 7, 2019 06:05
Deno Systemd service file for uuid.alemayhu.com
[Unit]
Description=uuid.alemayhu.com - generating random UUID's
Documentation=https://uuid.alemayhu.com
After=network.target
[Service]
Type=simple
User=scanf
WorkingDirectory=/home/scanf/src/github.com/scanf/uuid.alemayhu.com/src
ExecStart=/home/scanf/.deno/bin/deno run --allow-read --allow-net main.ts
module.exports = function Next(views, sViews, body) {
const directions = ['forward', 'right', 'left'];
const treatMatch = views.find(v => { return v == "treat"});
if (treatMatch) {
return treatMatch.direction;
}
let possibleActions = directions;
module.exports = function Next(views, sViews, body) {
const directions = ['up', 'down', 'right', 'left'];
const treatMatch = views.find(v => { return v == "treat"});
if (treatMatch) {
return treatMatch.direction;
}
let possibleActions = directions;
module.exports = function Next(views, sViews, body) {
const directions = ['up', 'down', 'right', 'left'];
const treatMatch = views.find(v => { return v == "treat"});
if (treatMatch) {
return treatMatch.direction;
}
let possibleActions = directions;
{
"config": {
"autoconnect": true,
"bot": "awesomo_bot",
"name": "#ccscanf",
"oauth": "oauth:xyz”,
"prefix": "\\",
"silent": false,
"standupReminder": true,
"windowState": {
@aalemayhu
aalemayhu / run_git_gc.py
Last active August 6, 2018 00:18
Run 'git gc' in directory of git repositores
#!/usr/bin/env python3
# Copyright 2018 Alexander Alemayhu https://alemayhu.com
import argparse
import os
import subprocess
def handle(directory):
for folder, subs, files in os.walk(directory):
@aalemayhu
aalemayhu / debuginfo.md
Created November 22, 2017 09:26
Testing debuginfo output

Cilium debug information

Cilium version

0.13.90 (648ab3b) linux/amd64

Kernel version

@aalemayhu
aalemayhu / blacklist_kern.bpf
Last active October 26, 2017 07:20
Simple blacklist
// vim: set filetype=c:
#include <bpf/api.h>
#include <linux/ip.h>
#include <lib/eth.h>
#include <lib/utils.h>
struct bpf_elf_map __section_maps blacklist_map = {
.type = BPF_MAP_TYPE_HASH,
.size_key = sizeof(uint32_t),
.size_value = sizeof(uint32_t),
@aalemayhu
aalemayhu / cilium
Created October 23, 2017 05:58
Docker wrapper script for Cilium
#!/bin/bash
# /usr/local/bin/cilium
docker exec -ti cilium cilium $@
@aalemayhu
aalemayhu / gist:fef9ba1036e947fd7ddda1b4d8176043
Created October 6, 2017 12:24
run ebpf-disasm on bpf_lxc
docker run -v ${PWD}:/tmp scanf/ebpf-disasm -s from-container /tmp/bpf_lxc.o|wc -l