Skip to content

Instantly share code, notes, and snippets.

View sujaypillai's full-sized avatar
🐳
Getting contained!!!

Sujay Pillai sujaypillai

🐳
Getting contained!!!
View GitHub Profile
@sujaypillai
sujaypillai / dtmirroringapi
Last active March 6, 2019 17:37
DTR_Mirroring_API
$export TOKEN=52855d2f-13d6-44d8-aca3-8a89b8d63b71
//Create a repository named hub/golang in your DTR
$curl -u sujaypillai:$TOKEN -X POST "https://registry.sujaypillai.dev/api/v0/repositories/hub" \
-H "accept: application/json" \
-H "content-type: application/json" \
-d "{
"enableManifestLists": true,
"immutableTags": false,
"longDescription": "",
FROM alpine
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG BUILDPLATFORM
ARG BUILDOS
ARG BUILDARCH
ARG BUILDVARIANT
Nov 08 11:32:55 azuse2dckdtrc02 dockerd[21837]: time="2018-11-08T11:32:55.070214954-05:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Nov 08 11:32:55 azuse2dckdtrc02 dockerd[21837]: time="2018-11-08T11:32:55.070269855-05:00" level=info msg="parsed scheme: \"unix\"" module=grpc
Nov 08 11:32:55 azuse2dckdtrc02 dockerd[21837]: time="2018-11-08T11:32:55.070282855-05:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Nov 08 11:32:55 azuse2dckdtrc02 dockerd[21837]: time="2018-11-08T11:32:55.071566788-05:00" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0 <nil>}]"
Nov 08 11:32:55 azuse2dckdtrc02 dockerd[21837]: time="2018-11-08T11:32:55.071615389-05:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Nov 08 11:32:55 azuse2dckdtrc02 dockerd[21837]: time="2018-11-08T11:32:55.071663890-05:00" level=info msg="pickfirstBalancer: HandleSubConnStateC
$ packer build -force ubuntu_1604.json
azure-arm output will be in this color.
==> azure-arm: Running builder ...
azure-arm: Creating Azure Resource Manager (ARM) client ...
==> azure-arm: the managed image named docker-ubuntu1604 already exists, but deleting it due to -force flag
==> azure-arm: Creating resource group ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-6xcwkvy1j5'
==> azure-arm: -> Location : 'East US'
==> azure-arm: -> Tags :
@sujaypillai
sujaypillai / Dockerfile
Created August 27, 2018 16:55 — forked from orenitamar/Dockerfile
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
version: "3.6"
services:
alfresco:
image: alfresco/alfresco-content-repository:6.1.0-EA1
#mem_limit: 1500m
deploy:
resources:
limits:
memory: 1500M
@sujaypillai
sujaypillai / docker-for-mac.md
Created July 18, 2018 15:39 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@sujaypillai
sujaypillai / gist:364267c56aab1adca045e9bb7f0dd21b
Created March 18, 2018 10:30
list all tags for a image from repository
#!/bin/bash
if [ $# -lt 1 ]
then
cat << HELP
dockertags -- list all tags for a Docker image on a remote registry.
EXAMPLE:
- list all tags for ubuntu:
@sujaypillai
sujaypillai / gist:7b1c43fabc0c1486d1da573ecbb2b6f9
Created October 10, 2017 16:16
Find the database tables that are using the most space on disk
SELECT relname AS "tablename", reltuples AS "rows", relpages * 8 / 1024 AS "MB" FROM pg_class
WHERE relname like 'alf%'
OR relname like 'act%'
OR relname like 'avm%'
OR relname like 'jbpm%'
ORDER BY relpages DESC;
INSERT INTO ACT_HI_VARINST(
ID_,
PROC_INST_ID_,
EXECUTION_ID_,
TASK_ID_,
NAME_,
VAR_TYPE_,
REV_,
BYTEARRAY_ID_,
DOUBLE_,