Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / runwithpath.sh
Created March 19, 2019 22:38
run a sudo with path
sudo env "PATH=$PATH" <the commands>
@cicorias
cicorias / run-in-penv.ps1
Created March 19, 2019 20:35
run iot simulator in windows venv
docker build --rm -f "c:\g\cse\mqtt\app\mosquitto_authn\modules\sender\Dockerfile.amd64" -t localhost:5000/sender:0.0.1-amd64 "c:\g\cse\mqtt\app\mosquitto_authn\modules\sender" ; if ($?) { iotedgehubdev start -d "c:\g\cse\mqtt\app\mosquitto_authn\config\deployment.amd64.json" -v }
@cicorias
cicorias / az-iotedge-install.sh
Last active March 19, 2019 14:48
Azure IoT Runtime Install on Ubuntu
# Register Microsoft key and software repository feed
apt-get update
apt-get install curl gpg vim
curl https://packages.microsoft.com/config/ubuntu/$(awk -F= '$1=="DISTRIB_RELEASE" { print $2 ;}' /etc/lsb-release)/prod.list > ./microsoft-prod.list
cp ./microsoft-prod.list /etc/apt/sources.list.d/
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
cp ./microsoft.gpg /etc/apt/trusted.gpg.d/
@cicorias
cicorias / portainer.txt
Created March 18, 2019 20:12 — forked from SeanSobey/portainer.md
Portainer Setup on Windows 10
Setup
=====
Enable docker without TLS
-------------------------
Docker settings -> General -> Expose docker daemon on tcp://...
Create Looback Address
----------------------
@cicorias
cicorias / DockerNetworkHack.sh
Created March 13, 2019 18:09 — forked from ianphil/DockerNetworkHack.sh
I was in meetings all day and used that time to learn a little about Docker Networks.
#
# Learn About Docker Networks
# github/tripdubroot
# Docker version 1.12.0-rc2
# build 906eacd
# experimental
#
# https://docs.docker.com/engine/userguide/networking/dockernetworks/#docker-embedded-dns-server
# https://docs.docker.com/engine/userguide/networking/configure-dns/
# https://github.com/docker/libnetwork/blob/ed311d050fda7821f2e7c53a7e08a0205923aef5/resolver.go
@cicorias
cicorias / runRegistry.sh
Created March 5, 2019 03:04
run a docker registry local and use host volume
#!/usr/bin/env bash
cd registry
docker run -d -p 5000:5000 --restart=always --name registry -v $(pwd):/var/lib/registry registry:2
@cicorias
cicorias / color-test.sh
Created March 1, 2019 19:08
Color Test for wsltty and mintty
#!/usr/bin/env bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
# To use common configuration in %APPDATA%\mintty, simply remove this file
BoldAsFont=no
Transparency=low
OpaqueWhenFocused=no
ThemeFile=material-hyper.minttyrc
CursorType=block
Font=Hack
FontHeight=10
Locale=en_US
Scrollbar=none
@cicorias
cicorias / d.sh
Created February 26, 2019 21:51
docker logs sorted by time
docker service logs SERVICE -t 2>&1 | sort -k 1
docker-compose logs -t 2>&1 | sort -k 1
@cicorias
cicorias / crlf-git.md
Created February 26, 2019 20:03
getting LF everywhere....

The proper way to get LF endings in Windows is to first set core.autocrlf to false:

git config --global core.autocrlf false You need to do this if you are using msysgit, because it sets it to true in its system settings.

Now git won’t do any line ending normalization. If you want files you check in to be normalized, do this: Set text=auto in your .gitattributes for all files:

  • text=auto And set core.eol to lf: