Skip to content

Instantly share code, notes, and snippets.

View drewwells's full-sized avatar

Drew Wells drewwells

View GitHub Profile
aws_creds() {
local profile="${1:-${AWS_PROFILE}}"
local account_id="$(aws configure get sso_account_id --profile "${profile}")" \
role_name="$(aws configure get sso_role_name --profile "${profile}")" \
region="$(aws configure get region --profile "${profile}")" \
start_url="$(aws configure get sso_start_url --profile "${profile}")"
if [ -z "$start_url" ] ; then
echo "did not find sso_start_url in profile ${profile}"
exit 1
@drewwells
drewwells / hijackhttps.go
Last active September 9, 2018 01:25 — forked from Soulou/hijackhttps.go
I was looking to do HTTPS socket hijacking, here is the way to do ! The link between client and server are completely encrpted.Keywords : HTTPS TCP Socket Hijacking Golang
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
@drewwells
drewwells / left.yaml
Created August 8, 2017 18:29
what's the difference
apiVersion: v1
data:
bmc.env: |-
REGION=us-phoenix-1
TENANCY_OCID=ocid1.tenancy.oc1..aaaa
USER_OCID=ocid.user.oc1..aaaa
kind: ConfigMap
[main] [ 2016-03-18 13:40:47.170 UTC ] [Host.<init>:1090] Begin tracing..
[main] [ 2016-03-18 13:40:47.224 UTC ] [OsUtilsBase.getBaseFromOrabase:659] oraBaseUtility /u01/app/oracle/product/12.1.0/xe/bin/orabase
[main] [ 2016-03-18 13:40:47.224 UTC ] [OsUtilsBase.getBaseFromOrabase:668] cmds: /u01/app/oracle/product/12.1.0/xe/bin/orabase
[main] [ 2016-03-18 13:40:47.225 UTC ] [OsUtilsBase.getBaseFromOrabase:672] envs: ORACLE_HOME=/u01/app/oracle/product/12.1.0/xe
[main] [ 2016-03-18 13:40:47.242 UTC ] [OsUtilsBase.getBaseFromOrabase:682] baseLocation from orabase
/u01/app/oracle
[main] [ 2016-03-18 13:40:47.242 UTC ] [OsUtilsBase.getBaseFromOrabase:707] orabaseLocation= /u01/app/oracle
[main] [ 2016-03-18 13:40:47.243 UTC ] [SilentHost.initialize:187] SilentHost-> initialize: m_tempLogFile = /u01/app/oracle/cfgtoollogs/dbca/silent.log_2016-03-18_01-40-47-PM
[main] [ 2016-03-18 13:40:47.248 UTC ] [Host.checkIfBigClusterAndHubNode:1710] Not a cluster environment: exiting BigCluster Check
[main] [ 2016-
@drewwells
drewwells / entrypoint.sh.patch
Created March 18, 2016 02:59
containerdatabase diff
diff --git a/entrypoint.sh b/entrypoint.sh
index 246457d..d3303aa 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -34,7 +34,7 @@ case "$1" in
echo "Starting tnslsnr"
su oracle -c "/u01/app/oracle/product/12.1.0/xe/bin/tnslsnr &"
#create DB for SID: xe
- su oracle -c "$ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname xe.oracle.docker -sid xe -responseFile NO_VALUE -characterSet AL32UTF8 -totalMemory $DBCA_TOTAL_MEMORY -emConfiguration LOCAL -pdbAdminPassword oracle -sysPassword oracle -systemPassword oracle"
+ su oracle -c "$ORACLE_HOME/bin/dbca -silent -createDatabase -createAsContainerDatabase true -templateName General_Purpose.dbc -gdbname xe.oracle.docker -sid xe -responseFile NO_VALUE -characterSet AL32UTF8 -totalMemory $DBCA_TOTAL_MEMORY -emConfiguration LOCAL -pdbAdminPassword oracle -sysPassword oracle -systemPassword oracle"
@drewwells
drewwells / SassMeister-input.scss
Created February 9, 2016 04:24
Generated by SassMeister.com.
// ----
// Sass (v4.0.0.alpha.1)
// ----
> e {
color: blue;
}
@drewwells
drewwells / SassMeister-input.scss
Created January 25, 2016 16:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.20)
// Compass (v1.0.3)
// ----
#010 {
color: #0000ff + #000001;
}
@drewwells
drewwells / mingwget.sh
Last active September 29, 2020 23:22
Cross compile windows on OS X with mingw
#!/bin/sh
# check_error my_cmd --param ...
check_error() {
$* # we execute everything
if [ $? -ne 0 ]; then
echo "check_error(): erreur avec la commande suivante:"
echo "check_error(): $*"
echo "check_error(): Continuer? o/n"
read a
@drewwells
drewwells / syncmap.go
Last active January 8, 2016 19:39
sync access to map of pointers
package syncmap
import (
"fmt"
"sync"
)
type S struct {
name string
}
@drewwells
drewwells / SassMeister-input.scss
Created January 8, 2016 16:51
Generated by SassMeister.com.
// ----
// Sass (v3.4.20)
// Compass (v1.0.3)
// ----
#010 {
color: #010;
}