Skip to content

Instantly share code, notes, and snippets.

View martinrusev's full-sized avatar

Martin Rusev martinrusev

  • Berlin, Germany
View GitHub Profile

Keybase proof

I hereby claim:

  • I am martinrusev on github.
  • I am martinrusev ( on keybase.
  • I have a public key whose fingerprint is 5AFB 23AF F7DF 7EEB 6122 CB69 E6DE 2A5E B208 05C1

To claim this, I am signing this object:

martinrusev /
Last active August 23, 2018 12:51
sudo dpkg-reconfigure network-manager
sudo dhclient ens33
ip address show
martinrusev /
Created May 20, 2018 10:47
Replace Linux Mint references with Ubuntu
$ sudo vi /etc/linuxmint/mintSystem.conf
enabled = False
lsb-release = False
etc-issue = False
$ sudo vi /etc/lsb-release
martinrusev / abbreviated-unbound.conf
Created December 29, 2017 11:41 — forked from bryanjswift/abbreviated-unbound.conf
Unbound ( configuration for local network device testing.
# The server clause sets the main parameters.
# Allow network connections outside of localhost
# Don't automatically run in the background because I want to be able to kill it without hunting a pid
do-daemonize: no
# TODO: Change this to your network range, like ` allow`
access-control: allow
# TODO: Change this to your username, or whatever user you want to run/own the `unbound` process
username: "bryanjswift"
martinrusev /
Created September 13, 2017 13:48
resource "aws_alb" "alb_grafana" {
name = "alb-energy-grafana"
internal = true
security_groups = ["${}"]
subnets = ["${var.SUBNETS}"]
tags {
Name = "alb-energy-grafana"
Owner = "${var.OWNER}"
martinrusev /
Last active September 29, 2019 06:29 — forked from smiller171/
Nightly EC2 shutdown
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
#define the connection
ec2 = boto3.resource('ec2')
martinrusev /
Created June 1, 2017 13:26
Docker - Host bridge
docker network create -d bridge --subnet --gateway dockernet
# Now each container can connect to the host under the fixed IP
martinrusev /
Created January 7, 2017 10:24
Upload Certificate to AWS IAM for use in Cloudfront
aws iam upload-server-certificate --server-certificate-name star_amon_cx --certificate-body file://star_amon_cx_body.cer --private-key file://star_amon_cx.key --certificate-chain file://star_amon_cx_chain.cer --profile personal --path /cloudfront/
import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
class AESCipher(object):
A classical AES Cipher. Can use any size of data and any size of password thanks to padding.
Also ensure the coherence and the type of the data with a unicode to byte converter.
$('.tabellebg .tarifiert').each(function() {
val = $(this).html();
formatted_val = val.replace(".", "").replace(" kB", "").replace(" ", "");
val_to_int = parseInt(formatted_val);
if(!isNaN(val_to_int)) {
sum +=val_to_int;