Skip to content

Instantly share code, notes, and snippets.

View gbraad's full-sized avatar
🇳🇱
Working from home

Gerard Braad gbraad

🇳🇱
Working from home
View GitHub Profile
@peterholak
peterholak / AutoScrollingTextarea.tsx
Last active June 3, 2022 09:04
React textarea component that scrolls to the bottom whenever its content changes
/*
Copyright 2017 Peter Holak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OT
@sjenning
sjenning / main.go
Created July 15, 2017 01:33
UWP Asset Generator
package main
import (
"fmt"
"gopkg.in/gographics/imagick.v2/imagick"
)
type asset struct {
size float32
#!/bin/bash
RELEASEVER=25
PACKAGES="bash dnf man passwd shadow-utils sudo vim-minimal iproute iputils bind-utils tar openssh-server openssh-clients procps-ng findutils"
set -euo pipefail
set -x
INSTALLROOT="$(mktemp -d)"
dnf -y --installroot "${INSTALLROOT}" --releasever "${RELEASEVER}" install ${PACKAGES}
@hydra1983
hydra1983 / docker_images.sh
Last active August 7, 2024 06:49
Save and load docker images in batch
#!/bin/bash
readonly DB_FILE="$(pwd)/images.db"
readonly IMG_DIR="$(pwd)/images"
save-images() {
echo "Create ${DB_FILE}"
echo "$(docker images|grep -v 'IMAGE ID'|awk '{printf("%s %s %s\n", $1, $2, $3)}'|column -t)" > "${DB_FILE}"
echo "Read ${DB_FILE}"
@runcom
runcom / Centos_7
Last active August 30, 2017 06:59
CRI-O + k8s
# Centos 7 VM, 8GB ram, 20+GB storage
# dnf update
# dnf install gpgme-devel libassuan-devel libseccomp-devel device-mapper-devel btrfs-progs-devel glibc-static glibc-devel glib2-devel iptables git golang
# export GOPATH=$HOME/go
# export PATH=$PATH:$GOPATH/bin
# go get -d github.com/opencontainers/runc
# go get -d github.com/kubernetes-incubator/cri-o
# go get -d k8s.io/kubernetes
# go get -d github.com/containernetworking/cni
@keithresar
keithresar / ocmysql
Last active January 4, 2017 18:45
Launch client to access MySQL service inside OpenShift project
#!/usr/bin/env bash
#
# Assumes the following environment variables are available in the project:
#
# MYSQL_USER, MYSQL_USER, MYSQL_DATABASE
#
# This script will discover the environment variables, open a port-forwarding request for
# MySQL, then will open the client using the project credentials.
#
@sjenning
sjenning / origin-gce-hosts.md
Created November 9, 2016 21:47
GCE openshift-ansible inventory
[OSEv3:children]
masters
nodes

[OSEv3:vars]
ansible_ssh_user=sjennings
ansible_become=yes

deployment_type=origin
@gbraad
gbraad / README.md
Last active August 22, 2016 09:15
Spin-up test Atomic Host with OpenStack

Atomic Host with OpenStack components

This describes in short how to spin-up an Atomic Host with the OpenStack RDO components. This is currently in testing.

This host will contain all the software as an overcloud node would contain. The current version of OpenStack is Liberty. The ostree itself is hosted on GitLab as a pages and pages:deploy CI runner. The base image is a standard Fedora 23, with the ostree and rpm-ostree tools. More about this can be found in the links above and in the project README.md.

@gbraad
gbraad / README.md
Last active August 30, 2017 08:21
Generate HTML directory index

Generate directory index

find public/ -type f | ./genindex.sh > public/index.html
ls public/ | ./genindex.sh > public/index.html