Skip to content

Instantly share code, notes, and snippets.

View B-Stefan's full-sized avatar

Stefan Bieliauskas B-Stefan

View GitHub Profile
@B-Stefan
B-Stefan / dhcp_leases.sh
Created November 18, 2020 06:57
List mac DHCP Server leases
# Lists all leases of the mac build-in DHCP server
# Useful if would like to connect via ssh (e.g., to a Rasberry pi) and share the internet connection
cat /private/var/db/dhcpd_leases
@B-Stefan
B-Stefan / PlainObjectOf.ts
Created December 9, 2019 14:16
Typescript PlainObjectOf
type Primitive =
| string
| boolean
| number
| bigint
| symbol
| null
| undefined
| Date;
@B-Stefan
B-Stefan / Recipe.ts
Created July 30, 2019 20:48
Zapier-Platform-Typescript-Schema
enum RecipeStyle {
Italian = "italian",
Mexian = "mexican"
}
export default interface Recipe {
id: string;
directions: any;
authorId: string;
name: string;
style: RecipeStyle;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@B-Stefan
B-Stefan / .travis.yml
Created November 24, 2018 17:00
law-service-02
sudo: required
services:
- docker
stages:
- test
- build
jobs:
include:
@B-Stefan
B-Stefan / .travis.yml
Created November 22, 2018 18:37
law-service-01
language: python
sudo: required
services:
- docker
stages:
- test
- build
@B-Stefan
B-Stefan / docker-registry-clean.sh
Created August 17, 2018 14:53 — forked from qoomon/docker-registry-clean.sh
Docker Registry v2 / Remove orphan layers left by the "file" storage backend of the docker registry, heavily inspired by https://gist.github.com/shepmaster/53939af82a51e3aa0cd6
#!/bin/sh
base_dir=/var/lib/registry/docker/registry/v2
repository_dir=$base_dir/repositories
image_dir=$base_dir/blobs
output_dir=$(mktemp -d)
all_images=$output_dir/all
used_images=$output_dir/used
@B-Stefan
B-Stefan / plz.json
Created April 23, 2018 18:21
Geojson postleitzahlen
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@B-Stefan
B-Stefan / add_git_tag.sh
Created January 15, 2018 15:50
Add a git tag based on the git history.
#!/bin/sh
# This script will be executed after commit in placed in .git/hooks/post-commit
# Semantic Versioning 2.0.0 guideline
#
# Given a version number MAJOR.MINOR.PATCH, increment the:
# MAJOR version when you make incompatible API changes,
# MINOR version when you add functionality in a backwards-compatible manner, and
# PATCH version when you make backwards-compatible bug fixes.
@B-Stefan
B-Stefan / docker-check-tag-exists.sh
Created January 3, 2018 12:56
Docker check if tag exists
export DOCKER_TAG=test
if [[ $( docker pull hello-world:$DOCKER_TAG 2>&1 | head -1 ) == *"not found"* ]] ;
then
echo "Create image for hello world repro"
docker pull hello-world:develop
docker tag hello-world:develop hello-world:$DOCKER_TAG
docker push hello-world:$DOCKER_TAG
else
echo "Image already exists"