Skip to content

Instantly share code, notes, and snippets.

View nilayparikh's full-sized avatar

Nilay Parikh nilayparikh

View GitHub Profile
@alonisser
alonisser / Dockerfile
Last active June 28, 2022 02:26
Dockerfile for spacy prodigy for cloud setup using remote postgresql including changing instructions file and overriding index.html - and the leanest I've got
FROM python:3.6-alpine
# Opted for alpine to get a lean docker image as possible
RUN apk add --no-cache openssl
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
# Python deps for alpine
@napramirez
napramirez / ConvertLetsPemToPfx.sh
Created December 18, 2017 04:43
Convert LetsEncrypt Certificates to PFX
#!/bin/sh
#
# Copy of https://gist.githubusercontent.com/arichika/b1a1413b554734ae964f/raw/e657ad2dc4ddab60750d26e87add61f9b988d887/ConvertLetsPemToPfx.sh
#
pemsdir='/etc/letsencrypt/archive' # default search PEMs
pfxspath='/share/letsencrypt/archive' # dest of the PFXs
passfile='/share/letsencrypt/pass.txt' # password to be applied to the PFX file
for cnvifull in `find "${pemsdir}" -name 'cert*.pem' -o -name '*chain*.pem'`
@codersquid
codersquid / another_example.py
Last active June 25, 2024 00:56
a learning example for using a pushgateway with prometheus
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@chssch
chssch / Dockerfile
Last active April 18, 2022 02:08
explosion.ai prodi.gy Dockerfile
# Dockerfile for prodigy, just place your linux-wheel (prodigy-0.1.0-cp36-cp36m-linux_x86_64.whl) in same directoty as
# this dockerfile and:
# > docker build . -t prodigy
# > docker run -it -p 8080:8080 -v ${PWD}:/work prodigy bash
FROM python:3.6
RUN mkdir /prodigy
WORKDIR /prodigy
COPY ./prodigy-0.1.0-cp36-cp36m-linux_x86_64.whl /prodigy
RUN pip install prodigy-0.1.0-cp36-cp36m-linux_x86_64.whl
@rosscdh
rosscdh / json_field.py
Last active June 23, 2025 16:44
PeeWee JSONField
import peewee as pw
class JSONField(pw.TextField):
"""
Class to "fake" a JSON field with a text field. Not efficient but works nicely
"""
def db_value(self, value):
"""Convert the python value for storage in the database."""
return value if value is None else json.dumps(value)
@tamas-molnar
tamas-molnar / kubectl-shortcuts.sh
Last active October 9, 2025 01:43
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@indrayam
indrayam / create-jwt-using-unix-commands-on-mac.md
Last active October 27, 2025 17:12
Create JWT Token Header Using Unix Command line tools ONLY!

Pseudocode:

Y = Base64URLEncode(Header) + ‘.’ + Base64URLEncode(Payload)
JWT = Y + ‘.’ + Base64URLEncode(HMACSHA256(Y))

The steps called out here should work on a Mac as well. The only thing that might be different is the sed command used below. Instead of using -E, you will have to use -r to run sed with extended regular expression support

Use data from this tutorial:

scotch.io

@jeffhollan
jeffhollan / PullAllLocalBranches.ps1
Last active January 6, 2022 05:30
PowerShell script to pull all local branches
function PullAllBranches() {
$branches = git branch
foreach($branch in $branches){
$fixedBranch = $branch.Substring(2, $branch.Length - 2)
$trackedExpression = "branch." + $fixedBranch + ".merge"
$trackedBranch = git config --get $trackedExpression
# Write-Host($trackedBranch)
if(![string]::IsNullOrEmpty($trackedBranch))
{
Write-Host('Pulling branch: ' + $fixedBranch)
@howtomakeaturn
howtomakeaturn / gist:290057120966900fb21a11a48b4c7e93
Last active March 2, 2017 17:42
Align Facebook Like, Twitter Tweet and Google +1 buttons for 2016
/* This gets Google to fall into place */
.social {
font-size: 1px;
}
/* This gets Facebook to fall into place */
.social iframe {
vertical-align: bottom;
}
@p3t3r67x0
p3t3r67x0 / openssl_commands.md
Last active May 15, 2025 17:31
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl