Skip to content

Instantly share code, notes, and snippets.

View tuxfight3r's full-sized avatar
:octocat:
Working from home

Mohan Balasundaram tuxfight3r

:octocat:
Working from home
View GitHub Profile
@tuxfight3r
tuxfight3r / mfa.md
Created July 15, 2020 01:42 — forked from res0nat0r/mfa.md
Enable MFA for s3 bucket
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 July 11, 2020 11:00
ruby diff 2 yaml files and awesome print
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 September 23, 2022 11:00
install stress on amazon linux 2
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 June 29, 2020 23:14 — forked from radiofrequency/aws_import.sh
Import lets encrypt cert to aws certificate manager in renew hook
#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 February 17, 2020 22:39
sample springboot application
//$ 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;
@tuxfight3r
tuxfight3r / decrypt_saml_response.py
Created February 11, 2020 23:56 — forked from orimanabu/decrypt_saml_response.py
SAML Response Decrypter
#!/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 January 29, 2020 22:55
arm cli dependency list
[-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 February 4, 2020 22:02
amory cli dinghyfile render notes

dinghyfile

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

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
javascript:!function(){var n,e,r,i;n=window,e=document.body,r=JSON.parse,i=JSON.stringify,n.isf||(e.innerHTML="<pre>"+i(r(e.innerText),null,4).replace(/\"(.*)[^\:]\:/g,'<span style="color:#9C3636">$1&colon;</span>')+"</pre>",n.isf=!0)}();
//usage:
//save as bookmark and click it whenever you open a json response in a browser tab/window