Skip to content

Instantly share code, notes, and snippets.

@stenio123
stenio123 / 00.howto_install_phantomjs.md
Created December 14, 2015 03:00 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@stenio123
stenio123 / gitflow-breakdown.md
Created January 7, 2016 17:10 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@stenio123
stenio123 / console_1.sh
Last active October 28, 2016 20:27
Managing secrets using Hashicorp Vault
git clone https://github.com/stenio123/hashicorp-vault-token-auth-poc.git
cd hashicorp-vault-token-auth-poc
vagrant up

Keybase proof

I hereby claim:

  • I am stenio123 on github.
  • I am stenio (https://keybase.io/stenio) on keybase.
  • I have a public key whose fingerprint is D7DE 91E8 5591 1452 ADE3 673E 6271 BE3B E03E A420

To claim this, I am signing this object:

@stenio123
stenio123 / Consul client (Mongo) log
Last active December 29, 2016 05:02
This is the Consul log at DEBUG level on the client.
Dec 29 04:51:57 ip-10-228-0-59 consul[10367]: serf: EventMemberJoin: mongo-i-0889ee9c7bb38e8a1-stenio 10.228.0.59
Dec 29 04:51:57 ip-10-228-0-59 consul[10367]: agent: Joining cluster...
Dec 29 04:51:57 ip-10-228-0-59 consul[10367]: manager: No servers available
Dec 29 04:51:57 ip-10-228-0-59 consul[10367]: agent: failed to sync remote state: No known Consul servers
Dec 29 04:51:57 ip-10-228-0-59 consul[10367]: agent: No EC2 region provided, querying instance metadata endpoint...
Dec 29 04:51:58 ip-10-228-0-59 consul[10367]: agent: Discovered 6 servers from EC2...
Dec 29 04:51:58 ip-10-228-0-59 consul[10367]: agent: (LAN) joining: [10.228.35.76 10.228.32.92 10.228.5.245 10.228.0.93 10.228.0.59 10.228.34.182]
Dec 29 04:51:58 ip-10-228-0-59 consul[10367]: memberlist: Initiating push/pull sync with: 10.228.35.76:8301
Dec 29 04:51:58 ip-10-228-0-59 consul[10367]: serf: EventMemberJoin: mongo-i-061dcfd9ea976915b-stenio 10.228.0.93
Dec 29 04:51:58 ip-10-228-0-59 consul[10367]: serf: EventMemberJoin: consul-i-0e1020f
@stenio123
stenio123 / Consul server log
Last active December 29, 2016 04:58
This is the Consul log at DEBUG level on the server.
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: raft: Initial configuration (index=0): []
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: raft: Node at 10.228.32.92:8300 [Follower] entering Follower state (Leader: "")
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: serf: EventMemberJoin: consul-i-0ada6114c8d15aca7-stenio 10.228.32.92
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: serf: EventMemberJoin: consul-i-0ada6114c8d15aca7-stenio.dc1 10.228.32.92
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: consul: Adding LAN server consul-i-0ada6114c8d15aca7-stenio (Addr: tcp/10.228.32.92:8300) (DC: dc1)
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: consul: Adding WAN server consul-i-0ada6114c8d15aca7-stenio.dc1 (Addr: tcp/10.228.32.92:8300) (DC: dc1)
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: agent: Joining cluster...
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: agent: No EC2 region provided, querying instance metadata endpoint...
Dec 29 04:50:52 ip-10-228-32-92 consul[10098]: agent: Discovered 6 servers from EC
@stenio123
stenio123 / GitHub-Forking.md
Created October 18, 2017 13:42 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@stenio123
stenio123 / dk-clean.sh
Created October 23, 2017 19:31 — forked from zeg-io/dk-clean.sh
Clean all Docker images older than 4 weeks
oldContainers="$(docker ps -f "status=exited" | grep -E 'Exited \(.*\) [5-9] h|Exited \(.*\) \d\d h' | awk '{ print $1 }')"
echo -e -n "\nRemoving containers older than 4 hours"
if [ "$oldContainers" != "" ]; then
echo ""
docker rm $oldContainers
else
echo "...none found."
fi
@stenio123
stenio123 / stale_security_groups.py
Created November 10, 2017 15:50 — forked from astrikos/stale_security_groups.py
Script to detect stale AWS security groups
#!/usr/bin/env python
import boto3
import argparse
class StaleSGDetector(object):
"""
Class to hold the logic for detecting AWS security groups that are stale.
"""
def __init__(self, **kwargs):
@stenio123
stenio123 / Test.sh
Last active July 3, 2018 14:34
Showing max_ttl lease precedence behavior in vault: system | mount | config
# Mount database backend
vault mount database
# Configure MySQL connection
vault write database/config/mysql \
plugin_name=mysql-legacy-database-plugin \
connection_url="vaultadmin:vaultadminpassword@tcp(127.0.0.1:3306)/" \
allowed_roles="readonly"
# Create MySQL readonly role