Skip to content

Instantly share code, notes, and snippets.

View asantos2000's full-sized avatar
🏠
Working from home

Anderson Santos asantos2000

🏠
Working from home
View GitHub Profile
@asantos2000
asantos2000 / generate-ssh-key.sh
Created November 14, 2018 16:31 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@asantos2000
asantos2000 / sshKeyGen.py
Created October 27, 2018 21:31 — forked from oliv2915/sshKeyGen.py
Python script that uses ssh-keygen and ssh-copy-id to create SSH keys
'''
Author: Brian Oliver II
Instagram: bolo_ne3
License:
MIT License
Copyright (c) 2016 Brian Oliver II
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

Supported built-in functions

  • abs(float) - Returns the absolute value of a given float. Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. See also the signum function.

  • basename(path) - Returns the last element of a path.

  • base64decode(string) - Given a base64-encoded string, decodes it and returns the original string.

@asantos2000
asantos2000 / .gitignore
Created October 11, 2018 18:02 — forked from olooney/.gitignore
worked examples of argparse and python logging
logs/
@asantos2000
asantos2000 / LC_TYPE.txt
Created October 11, 2018 13:07 — forked from felipekm/LC_TYPE.txt
Linux warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
# add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@asantos2000
asantos2000 / README.md
Created September 28, 2018 21:30 — forked from detiber/README.md
kubeadm v1.12 stacked control plane install

Kubeadm stacked control plane install v1.12

Warning: hardcoded values below will need to be modified for testing against different hostnames and/or IPs

Common Steps

Install Docker

apt-get update && \
@asantos2000
asantos2000 / converter-cli.js
Last active August 24, 2018 23:08 — forked from sorjef/converter-cli.js
Script to convert AWS Data Pipeline template to Cloudformation template with a sample Terraform module
const fs = require('fs');
const Converter = require('./converter.js');
const options = {
name: process.argv[3],
description: process.argv[4],
activate: process.argv[5],
};
const converter = new Converter(JSON.parse(fs.readFileSync(process.argv[2])), options);
@asantos2000
asantos2000 / drakov.sh
Created June 25, 2018 17:47
Run drakov mock on docker
#!/bin/bash
docker run --rm -it --name drakov-mock -v $PWD/doc:/tmp -p 5000:3000 adsantos/drakov drakov -f api.md --public --watch --discover
@asantos2000
asantos2000 / hook.js
Created June 25, 2018 17:13
Dredd hook sample - Adding apikey to each request
// Writing Dredd Hooks In Node.js
// Ref: http://dredd.org/en/latest/hooks-nodejs.html
var hooks = require('hooks');
hooks.beforeEach(function(transaction) {
hooks.log('before each');
// add query parameter to each transaction here
let paramToAdd = 'api-key=23456';
if (transaction.fullPath.indexOf('?') > -1)
@asantos2000
asantos2000 / dredd.sh
Created June 25, 2018 12:51
Run dredd image as a command line
#!/bin/bash
echo '***'
echo 'Root dir is /api'
export MYIP=`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`
echo 'Configure URL of tested API endpoint: http://api-srv::<enpoint-port>. Set api-srv to point to your server.'
echo 'This script will set api-srv to docker host machine - ' $MYIP
echo 'Optional. Save this script in your PATH and give it an alias:'
echo "alias dredd='bash ./scripts/dredd.sh'"
echo '***'