Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / m.md
Last active September 16, 2019 23:20
use existing vm vnet

from https://www.insidethemicrosoftcloud.com/create-new-vm-on-existing-subnet-with-azure-cli/

If you want to attach a VM to an existing subnet, you need to pass the subnet ID to the –subnet parameter. Begin by retrieving the ID of the existing subnet and assign to a variable.

In this sample, the subnet is named ‘default’, and represented by the –name parameter, and SUBNETID is the name of the variable.

export SUBNETID=$(az network vnet subnet show /
--resource-group 'MyRG' --name default /
--vnet-name 'Existing-VNET' --query id -o tsv)
@cicorias
cicorias / pipinstall.py
Created September 15, 2019 01:36
coderunner tips
import os
myCmd = 'pip install numpy pandas'
os.system(myCmd)
@cicorias
cicorias / response.md
Created September 14, 2019 03:12
creating wildcard on letsencrypt

$ ./runCertBot.sh Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator manual, Installer None Obtaining a new certificate Performing the following challenges: dns-01 challenge for tyrellcsenyc.com


NOTE: The IP of this machine will be publicly logged as having requested this certificate. If you're running certbot in manual mode on a machine that is not

@cicorias
cicorias / Dockerfile
Created September 12, 2019 15:25
running docker remotely on a docker for desktop host
FROM alpine
RUN apk update && apk add socat
EXPOSE 2375
CMD socat TCP-LISTEN:2375,reuseaddr,fork UNIX-CLIENT:/var/run/docker.sock
@cicorias
cicorias / README.md
Created September 4, 2019 13:14 — forked from Remiii/README.md
How to delete Vault (AWS Glacier)

How to delete Vault (AWS Glacier)

This Gist give some tips in order to remove AWS Glacier Vault with AWS CLI (ie. https://aws.amazon.com/en/cli/).

Step 1 / Retrive inventory

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --vault-name YOUR_VAULT_NAME --account-id YOUR_ACCOUNT_ID --region YOUR_REGION
@cicorias
cicorias / suppressit.py
Created August 12, 2019 15:43
supressing FutureWarning in Python Jupyter and Tensorflow / Keras
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore",category=FutureWarning)
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.preprocessing.text import Tokenizer
print('ready')
@cicorias
cicorias / java-alias.sh
Created August 3, 2019 14:52
switch java versions
alias j9="export JAVA_HOME=`/usr/libexec/java_home -v 9`; java -version"
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version"
alias j7="export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; java -version"
@cicorias
cicorias / vscodeext.md
Created July 28, 2019 16:13
List and install s code extensions

Manual - By script

In machine A,

UNIX:

code --list-extensions | xargs -L 1 echo code --install-extension Windows (PowerShell, e. g. using VSCode's integrated Terminal): code --list-extensions | % { "code --install-extension $_" } copy and paste the echo output to machine B

@cicorias
cicorias / fix.sh
Created July 16, 2019 14:48
doccano and Error: pg_config executable not found.
/Applications/Postgres.app/Contents/Versions/latest/bin
@cicorias
cicorias / run-tf-container.sh
Created July 5, 2019 23:45
run the TF container from Google
docker run -d -p 8080:8080 -v $(pwd):/home gcr.io/deeplearning-platform-release/tf-cpu.1-13