Skip to content

Instantly share code, notes, and snippets.

View lichti's full-sized avatar
👨‍💻
🏊🏻🚴🏻🏃🏻

Gustavo Lichti lichti

👨‍💻
🏊🏻🚴🏻🏃🏻
View GitHub Profile
@lichti
lichti / attack.sh
Created May 13, 2015 18:58
Massive Test on HTTP or HTTPS
#!/bin/bash
ADDR=${1:-FAIL}
C=${2:-10}
N=${3:-100}
xN=0
xPROC=0
RND=$RANDOM
touch /tmp/attack_${RND}_0.pid
@lichti
lichti / json-to-yml.sh
Last active September 11, 2015 19:03
Convert json to yaml
ruby -r json -r yaml -e "json = JSON.parse(File.read('./file.json')); print YAML::dump(json)" > file.yml
@lichti
lichti / yml-to-json.sh
Created September 11, 2015 19:04
Convert yaml to json
ruby -r json -r yaml -e "yaml = YAML.load(File.read('./cloud-formation.yml')); print yaml.to_json" > cloud-formation_yml.json
@lichti
lichti / keybase.md
Last active September 21, 2015 18:37

Keybase proof

I hereby claim:

  • I am lichti on github.
  • I am lichti (https://keybase.io/lichti) on keybase.
  • I have a public key whose fingerprint is B13B 1B3E A19D E6F8 5AE5 AF55 E274 E9C4 4D79 E0EB

To claim this, I am signing this object:

@lichti
lichti / create-gpg.md
Last active September 22, 2015 03:51

Create a RSA keypair

gpg --gen-key

Generate a revocation certificate

gpg --gen-revoke [KEY_ID] > ~/.gnupg/revocation-[KEY_ID].crt

Get target key [KEY_ID_2]

gpg --keyserver pgp.mit.edu --recv-keys [KEY_ID_2]

Print key

gpg --fingerprint [KEY_ID_2]
@lichti
lichti / import-gpg.md
Last active September 22, 2015 03:50

Import a public key:

gpg --import public.key

Import a private key:

gpg --allow-secret-key-import --import private.key
@lichti
lichti / yml2json.sh
Last active April 20, 2020 06:46
Script to convert yml to json
#!/bin/bash
BYellow='\033[1;33m'
BGreen='\033[1;32m'
Color_Off='\033[0m'
LOCALPATH=$PWD
OUTPUT=$LOCALPATH/OUTPUT
if [ ! -d $OUTPUT ]; then
@lichti
lichti / mysql_optimize_ng.sh
Created October 29, 2015 03:53
mysql_optimize_ng.sh
#!/bin/bash
MYSQL_LOGIN='-uroot --password=neOfByon'
while read line
do
# SIZE | DATABASE | TABLE | FLAG
SIZE=$( echo "$line" | cut -d\| -f 1)
DATABASE=$( echo "$line" | cut -d\| -f 2)
TABLE=$( echo "$line" | cut -d\| -f 3)
@lichti
lichti / Docker-NewRelic
Created October 29, 2015 03:55
Docker-NewRelic
docker run -d \
--privileged=true --name nrsysmond \
--pid=host \
--net=host \
-v /sys:/sys \
-v /dev:/dev \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/log:/var/log:rw \
-e NRSYSMOND_license_key=xxxxxxx \
-e NRSYSMOND_logfile=/var/log/nrsysmond.log \