Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Mohan Balasundaram tuxfight3r

🏠
Working from home
View GitHub Profile
@tuxfight3r
tuxfight3r / nginx.conf
Created Aug 19, 2020 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
View nginx.conf
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@tuxfight3r
tuxfight3r / mfa.md
Created Jul 15, 2020 — forked from res0nat0r/mfa.md
Enable MFA for s3 bucket
View mfa.md
aws s3api put-bucket-versioning \
	--bucket bucket \
	--versioning-configuration '{"MFADelete":"Enabled","Status":"Enabled"}' \
	--mfa 'arn:aws:iam::aws_account_id:mfa/root-account-mfa-device passcode'
aws s3api get-bucket-versioning --bucket bucket
@tuxfight3r
tuxfight3r / script.sh
Created Jul 11, 2020
ruby diff 2 yaml files and awesome print
View script.sh
ruby -rhashdiff -rawesome_print -ryaml \
-e "ap HashDiff.diff(*ARGV.map{|f| YAML.load_file(f)})" template.yaml processed.yml
@tuxfight3r
tuxfight3r / notes.sh
Last active Jun 30, 2020
install stress on amazon linux 2
View notes.sh
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
#Run stress for 5mins
sudo stress --cpu 1 --timeout 320
@tuxfight3r
tuxfight3r / aws_import.sh
Created Jun 29, 2020 — forked from radiofrequency/aws_import.sh
Import lets encrypt cert to aws certificate manager in renew hook
View aws_import.sh
#place in /etc/letsencrypt/renewal-hooks/post
export AWS_ACCESS_KEY_ID=XXX
export AWS_SECRET_ACCESS_KEY=XXX
#certs must be in us-east-1 to use with cloudfront
export AWS_DEFAULT_REGION=us-east-1
#run without --certificate-arn first time then specify arn for updates
aws acm import-certificate --certificate file:///etc/letsencrypt/live/site.com/cert.pem --private-key file:///etc/letsencrypt/live/site.com/privkey.pem --certificate-chain file:///etc/letsencrypt/live/site.com/chain.pem --certificate-arn specifyarnforupdate
@tuxfight3r
tuxfight3r / sprinboot.java
Created Feb 17, 2020
sample springboot application
View sprinboot.java
//$ cat Application.java
package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.boot.context.embedded.LocalServerPort;
import java.net.InetAddress;
import java.net.UnknownHostException;
View decrypt_saml_response.py
#!/usr/bin/env python
# Prereq: PyCrypto
# Validation: https://www.samltool.com/decrypt.php
# Usage: ./decrypt_saml_response.py --key PRIVATE_KEY --pretty-print RESPONSE_XML
import sys
import optparse
import base64
@tuxfight3r
tuxfight3r / notes.md
Created Jan 29, 2020
arm cli dependency list
View notes.md
[-0-(mohan@xpsbox) ~/arm (⎈ |minikube:default)|(master)]
$ go list -f '{{ join .Deps "\n" }}'
bufio
bytes
compress/flate
compress/gzip
compress/lzw
container/list
context
@tuxfight3r
tuxfight3r / notes.md
Last active Feb 4, 2020
amory cli dinghyfile render notes
View notes.md

dinghyfile

#$ cat dinghyfile 
{
  "application": "yourspinnakerapplicationname",
  "pipelines": [
    {
      "application": "yourspinnakerapplicationname",
      "keepWaitingPipelines": false,
@tuxfight3r
tuxfight3r / readme.md
Created Dec 4, 2019
curl as an ldap client
View readme.md

Use curl as an LDAP client

curl "ldap://localhost:1389/dc=example,dc=com?homephone?sub?cn=*amar" \

     -u "cn=directory manager"
Enter host password for user 'cn=directory manager':
DN: uid=mathieu,ou=People,dc=example,dc=com
    homephone: +1 225 216 5900
You can’t perform that action at this time.