Skip to content

Instantly share code, notes, and snippets.

View bombsimon's full-sized avatar
🐒

Simon Sawert bombsimon

🐒
View GitHub Profile
@bombsimon
bombsimon / plot_circle.py
Created July 5, 2019 08:53
Plot a circle with matplot
#!/usr/bin/env python
""" Plot a circle with """
import math
import matplotlib.pyplot as plt
def main():
""" Plot """
radius = 120
@bombsimon
bombsimon / Vagrantfile
Created July 1, 2019 20:46
docker-compose in Vagrant with containers from ECS
require "yaml"
# This Vagrantfile was made to run docker-compose inside Vagrant with AWS
# access via `awscli` and support to fetch docker containers from AWS ECR.
# Because of this the personal aws credentials on the host machine will be
# copied upon provisioning. The provisioning also assumes that there's a `.env`
# file used for some variables set in docker-compose.
#
# During the provisioning all ports exposed in the docker-compose file will be
# fetcehd and forwarded to the host from the guest to allow access on that port.
@bombsimon
bombsimon / cfssl.md
Created June 27, 2019 12:40
Notes and information about CFSSL + OCSP

CFSSL Summary

Notes and useful commands and configuration for a minimal setup of CFSSL using root CA issued by mkcert.

Setup DB schema

Main article

@bombsimon
bombsimon / thread.pl
Created May 8, 2019 07:54
Perl thread example
#!/usr/bin/env perl
use warnings;
use strict;
use feature qw( say );
use threads;
use threads::shared;
my $is_running :shared: = 1;
@bombsimon
bombsimon / sync-clipboard
Created May 8, 2019 07:04
Keep X clipboard and cutbuffer in sync
#!/usr/bin/bash
autocutsel -fork &
autocutsel -selection PRIMARY -fork &
@bombsimon
bombsimon / i3-postswitch
Created May 8, 2019 07:02
Postswitch to move workspace 1-5 to primary output
#!/bin/bash
set -eu
for ws in {1..5}; do
i3-msg workspace $ws
i3-msg move workspace to output primary
done
# Mark #1 as active
@bombsimon
bombsimon / set-resolution.sh
Created May 8, 2019 07:00
Set login reolution with xrandr
#!/bin/bash
LVDS="eDP-1"
PRIMARY="DP-2-1"
function get_displays() {
xrandr -q | grep connected | awk '{print $1}'
}
function get_resolution() {
@bombsimon
bombsimon / clean-roms.md
Last active March 26, 2019 16:22
Cleanup roms

Cleanup ROM duplicates

Some rom packs includ duplicates where I'm only interested in keeping the version suffixed with [!]. This oneliner will fix that.

find . -name "* \[!]*" -exec bash -c 'rm -f ${0/ \[!]/}' {} \;.

→ tree
.
@bombsimon
bombsimon / certificates.go
Last active April 25, 2019 13:55
Working with certificates in Go
package main
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/pem"
@bombsimon
bombsimon / anagram
Created March 5, 2019 11:57
Just another Perl hacker and other obfuscations
$_ = "wftedskaebjgdpjgidbsmnjgc";
tr/a-z/oh, turtleneck Phrase Jar!/; print;