Skip to content

Instantly share code, notes, and snippets.

View martinrusev's full-sized avatar
🌱
01010110

Martin Rusev martinrusev

🌱
01010110
  • Berlin, Germany
View GitHub Profile

Keybase proof

I hereby claim:

  • I am martinrusev on github.
  • I am martinrusev (https://keybase.io/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
martinrusev / commands.sh
Last active August 23, 2018 12:51
network_fixes_ubuntu.sh
sudo dpkg-reconfigure network-manager
sudo dhclient ens33
ip address show
@martinrusev
martinrusev / mint_to_ubuntu.sh
Created May 20, 2018 10:47
Replace Linux Mint references with Ubuntu
$ sudo vi /etc/linuxmint/mintSystem.conf
[global]
enabled = False
[restore]
lsb-release = False
etc-issue = False
$ sudo vi /etc/lsb-release
@martinrusev
martinrusev / abbreviated-unbound.conf
Created December 29, 2017 11:41 — forked from bryanjswift/abbreviated-unbound.conf
Unbound (http://unbound.net/) configuration for local network device testing.
# The server clause sets the main parameters.
server:
# Allow network connections outside of localhost
interface: 0.0.0.0
# 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 `192.168.0.0/16 allow`
access-control: 10.0.0.0/16 allow
# TODO: Change this to your username, or whatever user you want to run/own the `unbound` process
username: "bryanjswift"
@martinrusev
martinrusev / alb_example.tf
Created September 13, 2017 13:48
alb_example.tf
resource "aws_alb" "alb_grafana" {
name = "alb-energy-grafana"
internal = true
security_groups = ["${aws_security_group.sec_energy_grafana_elb.id}"]
subnets = ["${var.SUBNETS}"]
tags {
Name = "alb-energy-grafana"
Owner = "${var.OWNER}"
@martinrusev
martinrusev / shutdown.py
Last active September 29, 2019 06:29 — forked from smiller171/shutdown.py
Nightly EC2 shutdown
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection
ec2 = boto3.resource('ec2')
@martinrusev
martinrusev / docker_host_bridge.sh
Created June 1, 2017 13:26
Docker - Host bridge
# https://forums.docker.com/t/accessing-host-machine-from-within-docker-container/14248/5
docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 dockernet
# Now each container can connect to the host under the fixed IP 192.168.0.1.
@martinrusev
martinrusev / upload_certificate.sh
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.
sum=0;
$('.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;
}