Skip to content

Instantly share code, notes, and snippets.

@singh1469
singh1469 / pyodbc-unixODBC-lambda-layer
Last active June 10, 2021 11:13 — forked from diriver63/pyodbc-unixODBC-lambda-layer
pyodbc and unixODBC for MSSQL as a lambda layer
# use https://github.com/lambci/docker-lambda to simulate a lambda environment
docker run -it --rm --entrypoint bash -e ODBCINI=/opt/odbc.ini -e ODBCSYSINI=/opt/ lambci/lambda:build-python3.7
# download and install unixODBC
# http://www.unixodbc.org/download.html
curl ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.7.tar.gz -O
tar xzvf unixODBC-2.3.7.tar.gz
cd unixODBC-2.3.7
./configure --sysconfdir=/opt --disable-gui --disable-drivers --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE --prefix=/opt
@singh1469
singh1469 / delete_all_object_versions.sh
Created December 21, 2020 12:59 — forked from weavenet/delete_all_object_versions.sh
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
@singh1469
singh1469 / README.md
Created April 6, 2020 10:12 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


2020/03/13 11:08:04 [INFO] Terraform version: 0.12.23
2020/03/13 11:08:04 [INFO] Go runtime version: go1.12.13
2020/03/13 11:08:04 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/1.0.2/versions/0.12.23/terraform", "plan"}
2020/03/13 11:08:04 [DEBUG] Attempting to open CLI config file: /Users/*masked*/.terraformrc
2020/03/13 11:08:04 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/03/13 11:08:04 [INFO] CLI command args: []string{"plan"}
2020/03/13 11:08:04 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/03/13 11:08:04 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/03/13 11:08:04 [DEBUG] New state was assigned lineage "4323f233-083c-2517-71c2-cf2bc0bbf7e7"
2020/03/13 11:08:04 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
@singh1469
singh1469 / domain.sh
Created April 12, 2017 13:39 — forked from leanderjanssen/domain.sh
Create Registry Server certificate
#!/bin/bash
# Retrieve public and private ip of instance
PUBLIC_HOSTNAME=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
# Generate openssl config for self-signed certificate with SANs
cat << EOF > ~/domain.cnf
[ ca ]
@singh1469
singh1469 / cert.sh
Created April 12, 2017 10:12 — forked from leanderjanssen/cert.sh
Create Docker certificates
#!/bin/bash
# Retrieve public and private ip of instance
PUBLIC_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
PRIVATE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
mkdir ~/docker-ca
chmod 0700 ~/docker-ca
cd ~/docker-ca || exit 1
@singh1469
singh1469 / docker-labels.md
Created April 12, 2017 08:47 — forked from leanderjanssen/docker-labels.md
Example of a Dockerfile with LABEL and ARG

Example of using LABEL and ARG in a Dockerfile

Dockerfile

FROM ubuntu:14.04
RUN apt-get -y update
RUN apt-get -y install vim
RUN apt-get -y install curl
ARG GIT_COMMIT=unknown
LABEL git-commit=$GIT_COMMIT
//<Buto embed code here>
<script>
var embedElement = document.getElementById('buto_<video_id>');
embedElement.addEventListener('playerReady',function(readyEvent){
//create variable referencing the Buto player
var player = Akita.playerInstances[this.getAttribute('data-instance-id')];
//add event listener to play event
player.video.el.addEventListener('play',function(){
//<hide text code goes here>
@singh1469
singh1469 / gist:bff9332f31876259ff8f
Last active December 16, 2015 12:09
Node stuff
`node --perf_basic_prof_only_functions`
Provides CPU stack trace of running processs without affecting process
Then use Flame graphs to visualise and indentify issues
/**
* Simple userland heapdump generator using v8-profiler
* Usage: require('[path_to]/HeapDump').init('datadir')
*
* @module HeapDump
* @type {exports}
*/
var fs = require('fs');
var profiler = require('v8-profiler');