Skip to content

Instantly share code, notes, and snippets.

View antonfisher's full-sized avatar

Anton Fisher antonfisher

View GitHub Profile
@antonfisher
antonfisher / stripes.go
Last active April 18, 2024 06:47
Utility to add transparent horizontal stripes to an image.
//
// Add transparent horizontal stripes to an image.
//
// Usage:
// go run stripes.go image.png 6 12 420
// | | | |
// | | | `- top and bottom padding
// | | `---- space between stripes
// | `------ stripes width
// `---------------- original file name or path
@antonfisher
antonfisher / allow-privileged-for-microk8s.md
Last active September 24, 2021 09:53
MicroK8s add --allow-privileged=true flag

Add --allow-privileged=true to:

# kubelet config
sudo vim /var/snap/microk8s/current/args/kubelet

#kube-apiserver config
sudo vim /var/snap/microk8s/current/args/kube-apiserver

Restart services:

@antonfisher
antonfisher / install-nexentastor-csi-driver-to-microk8s.md
Last active June 1, 2021 14:03
Install NexentaStor CSI Driver to MicroK8s

Install NexentaStor CSI Driver to MicroK8s

Requirements

  • Ubuntu 18.04
  • root user access

Steps

  1. Install dependencies:
@antonfisher
antonfisher / rpi-zero-headless-setup.sh
Last active December 6, 2020 03:25
Raspberry Pi Headless Setup
# on host:
# write an os image to the sd card:
# https://www.raspberrypi.org/documentation/installation/installing-images/README.md
# setup wifi (in boot):
# https://www.raspberrypi.org/documentation/configuration/wireless/headless.md
vim wpa_supplicant.conf
#ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
#update_config=1
@antonfisher
antonfisher / rpi-zero-motioneyeos-setup.sh
Created November 23, 2020 23:10
Install motioneyeos on Raspberry Pi Zero
# on host
# follow https://github.com/ccrisan/motioneyeos/wiki/Installation
# download "motioneyeos-raspberrypi-20200606.img.xz" release from:
# https://github.com/ccrisan/motioneyeos/releases
# setup script
wget https://raw.githubusercontent.com/ccrisan/motioneyeos/master/writeimage.sh
chmod +x writeimage.sh
@antonfisher
antonfisher / resize-and-compress-images.sh
Last active August 29, 2020 23:51
Resize (PNG, JPG) and compress (PNG) images recursively in the run folder if greater than MAX_WIDTH
#!/usr/bin/env bash
#
# Requirements:
# apt install imagemagick pngquant
#
# Usage:
# resize-and-compress-images.sh MAX_WIDTH
#
@antonfisher
antonfisher / resize-images-greater-then-width.sh
Created July 10, 2020 06:18
Resize all found images greater then some width
#!/usr/bin/env bash
MAX_WIDTH=800
echo "Looking for images..."
find . -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" |
while read name; do
width=$(identify -format "%w" "$name")
if [ "$width" -gt "$MAX_WIDTH" ]; then
@antonfisher
antonfisher / material-ui-flexible-fixed-header-table.js
Last active March 16, 2020 23:22
React.js Material-UI Table component with flexible height and fixed header
/*
* React.js Material-UI Table and TableRow components with flexible height and fixed header
* - fixes "jumping" scrolling bar in WebKit browsers
* - shows permanent scrolling bar for other browsers
*
* Usage: import this Table and TableRow component instead of
* 'material-ui/Table' and 'material-ui/TableRow' component
*/
import React, {PropTypes} from 'react';
@antonfisher
antonfisher / run-all-mint-tests.sh
Last active March 16, 2020 12:56
Run all minio/mint tests and do not fail on first failed test case
# by defailt mint tests fail on the first failed test case, to change it follow these steps:
git clone git@github.com:minio/minio.git
cd minio/mint
vim mint.sh +194 # comment "break" on string 194 to run all the tests and don't stop on the first fail
docker build --no-cache -t minio/mint:local . -f Dockerfile.dev
docker run \
--name mint \
--rm \
-it \
-e SERVER_ENDPOINT=10.3.199.254:9000 \
@antonfisher
antonfisher / add-test-options.diff
Last active March 16, 2020 12:56
Add BAIL and TEST_ONLY options to minio/mint tests runner
diff --git a/mint/mint.sh b/mint/mint.sh
index 5d9e997..952dc16 100755
--- a/mint/mint.sh
+++ b/mint/mint.sh
@@ -139,6 +139,7 @@ function main()
export ENABLE_VIRTUAL_STYLE
export GO111MODULE
export GOPROXY
+ export BAIL