Skip to content

Instantly share code, notes, and snippets.

@tjovicic
tjovicic / rds-port-forward.txt
Created April 6, 2020 16:56
AWS EC2 - RDS port forwarding
1. Set "AllowTcpForwarding yes" in /etc/ssh/sshd_config on EC2 instance
2. sudo ssh -i "bastion.pem" -N -L 3307:mydatabase.abc123.eu-central-1.rds.amazonaws.com:3306 ec2-user@ec2-abc-123.eu-central-1.compute.amazonaws.com
import: dep
go build -ldflags="-s -w" -o bin/import cmd/import/main.go
.PHONY:
clean
dep:
dep ensure -v
format:
[[constraint]]
name = "github.com/test/core"
branch = "master"
[[constraint]]
name = "github.com/aws/aws-lambda-go"
version = "1.x"
@tjovicic
tjovicic / keybase.md
Created January 13, 2020 19:32
Keybase

Keybase proof

I hereby claim:

  • I am tjovicic on github.
  • I am tjovicic (https://keybase.io/tjovicic) on keybase.
  • I have a public key ASBgwUPFTUl1VpDNAV4cfH61PySGcwOT6RBFgmCYQajH7go

To claim this, I am signing this object:

@tjovicic
tjovicic / mongodb_ssl_with_letsencrypt.md
Last active July 9, 2019 13:58 — forked from dkimot/mongodb_ssl_with_letsencrypt.md
MongoDB 3.2.x SSL with Letsencrypt

MongoDB 3.2.x SSL with Letsencrypt

Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.

Set the hostname

We sould to set the hostname to match the name of the certificate we are going to optain.

sudo hostname mongo0.example.com

Then update the hostname file to set the server name permanently.

@tjovicic
tjovicic / rabbitmq_publisher.py
Created June 28, 2019 07:56
Simple RabbitMQ HTTP publisher
import argparse
import httplib
import base64
def main():
parser = argparse.ArgumentParser(description='RabbitMQ publisher')
parser.add_argument('url', help='AMQP host')
parser.add_argument('username', help='Client username')
parser.add_argument('password', help='Client password')