Skip to content

Instantly share code, notes, and snippets.

View ebarault's full-sized avatar
💫

Eric Barault ebarault

💫
View GitHub Profile
@ebarault
ebarault / MySQL.md
Last active March 29, 2018 09:31 — forked from hofmannsven/README.md
A simple MySQL Command Line Cheatsheet

Commands

Access monitor: mysql -h [host] -u [username] -p (will prompt for password)

Access database: mysql -h [host] -u [username] -p [database] (will prompt for password)

Users functions

URL="http://stackoverflow.com/"
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL)
# extract the body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
# extract the status
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
import boto3
from boto3.session import Session
role_arn = os.environ.get('ASSUME_ROLE')
if roleArn:
client = boto3.client('sts')
assumed_role = client.assume_role(RoleArn=roleArn, RoleSessionName='test')
session = Session(aws_access_key_id=assumed_role['Credentials']['AccessKeyId'],
aws_secret_access_key=assumed_role['Credentials']['SecretAccessKey'],
@ebarault
ebarault / system.sh
Last active September 7, 2020 15:25
Which process uses a given port
sudo lsof -i:40025
@ebarault
ebarault / .gitconfig
Created January 8, 2021 15:51 — forked from Kovrinic/.gitconfig
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "git@github.com:"]
insteadOf = git://github