Skip to content

Instantly share code, notes, and snippets.

View mciverza's full-sized avatar

Andrew Mac mciverza

View GitHub Profile
@mciverza
mciverza / message.txt
Created February 7, 2022 12:22
hike-message
On Saturday 12 Feb 2022, I will be leading a hike up to see the Disas on Table Mountain via the dams.
We will be meeting at 06h00, at the parking at the top of Constantia Neck, by the traffic circle.
and will begin the hike by 06h30 at the latest, hopefully earlier.
The hike is on mostly paved roadway used by the water services dept to inspect the dams (they drive their bakkies up there).
It is an easy walk, but not a short walk.
We will be stopping often to rest and catch our breath. It won't be a race.
@mciverza
mciverza / CSS for live.fiawec.com Timing Tweaks.md
Created September 20, 2020 10:46 — forked from joshvc/CSS for live.fiawec.com Timing Tweaks.md
More cars, less wasted space on WEC Timing

FIA WEC Timing Screen Tweaks

This is my data maximization CSS for the Stylish Chrome extension. I'm using it to Airplay two browsers side-by-side to a 39" TV (see comment below), so your application may need some tweaks.

To use, install the extension then visit live.fiawec.com. Click the Stylish icon, and choose "Write style for live.fiawec.com/this_URL". Then paste in the your preferred version of the css in the edit window (see photos of the two versions in the comments below), press save, and the page will automaticaly refresh.

The biggest change can be made just with the font size. You'll want to adjust that based on your screen and viewing distance.

If things are too crowded, adjust the padding inside the #classement td. 5px looks better, but space is precious.

@mciverza
mciverza / README.md
Created August 25, 2020 06:05 — forked from xandout/README.md
Kubernetes DaemonSet that enables a direct shell on each Node using SSH to localhost

Getting a shell on each node

I run several K8S cluster on EKS and by default do not setup inbound SSH to the nodes. Sometimes I need to get into each node to check things or run a one-off tool.

Rather than update my terraform, rebuild the launch templates and redeploy brand new nodes, I decided to use kubernetes to access each node directly.

Alternative option

https://github.com/alexei-led/nsenter

@mciverza
mciverza / postgres-cheatsheet.md
Created July 29, 2020 08:21 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@mciverza
mciverza / openconnect-7-ubuntu-build.md
Created September 21, 2018 13:22 — forked from darrenpmeyer/openconnect-7-ubuntu-build.md
Building OpenConnect 7 on Ubuntu 14 (trusty), 15 (vivid), and 16 (xenial)

Building OpenConnect 7 on Ubuntu 14 (trusty) and 15 (vivid)

The steps in this guide are available as an autobuild shell script

Why?

Because the OpenConnect package from Ubuntu is a bit outdated, and if you have a recent AnyConnect server, you need a newer OpenConnect to play with it.

Why this guide uses OpenSSL instead of GnuTLS

@mciverza
mciverza / ffmpeg.md
Created August 21, 2018 04:15 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@mciverza
mciverza / keycloak-fetch-token-postman-pre-request.js
Created June 26, 2018 11:43 — forked from abn/keycloak-fetch-token-postman-pre-request.js
A postman pre-request script to fetch a valid token from Red Hat SSO (Keycloak) and set it to a template variable to use in request headers.
// modify these configurations to work with your environment
var server = "https://sso.example.com";
var realm = "realm";
var resource = "client";
var username = "username";
var password = "url encoded password";
var url = `${server}/auth/realms/${realm}/protocol/openid-connect/token`;
var data = `grant_type=password&client_id=${resource}&username=${username}&password=${password}`;
@mciverza
mciverza / snx_install.sh
Created June 8, 2018 12:34 — forked from rkueny/snx_install.sh
Checkpoint SNX VPN client installation shell script
mkdir temp && cd temp
# for linux 'amd64' architecture install those packages:
sudo apt-get install libx11-6:i386 libpam0g:i386 libstdc++5:i386 lib32z1 lib32ncurses5 lib32bz2-1.0
wget https://vpnportal.aktifbank.com.tr/SNX/INSTALL/snx_install.sh
sudo ./snx_install.sh
cd .. && rm -rf temp/
@mciverza
mciverza / git_sparse_checkout.md
Last active May 26, 2017 08:31
Git sparse checkout

sparse checkout in git

Downloading only part of a git repo, e.g one subfolder, is called a sparse checkout, or sparse clone

The steps to do a sparse checkout are as follows:

  • Start with an empty git repository: git init <repo_name>
  • Enter that directory: cd <repo_name>
  • Configure the remote repo address: git remote add -f origin <url_of_remote_repo>
  • Configure git to enable sparse: git config core.sparsecheckout true
@mciverza
mciverza / list.sh
Created April 13, 2017 10:37 — forked from rwjblue/list.sh
List account and distribution list details in Zimbra
sudo su - zimbra
# list all accounts and print out account name and aliases
for i in `zmprov -l gaa` ; do zmprov ga $i zimbraMailAlias ; done
# list all distribution lists and any members and/or aliases
for i in `zmprov gadl` ; do zmprov gdl $i zimbraMailAlias zimbraMailForwardingAddress ; done