Skip to content

Instantly share code, notes, and snippets.

View mciverza's full-sized avatar

Andrew Mac mciverza

View GitHub Profile
@mciverza
mciverza / DI.m3u
Created December 6, 2016 12:19 — forked from sim642/DI.m3u
Digitally Imported premium streams
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
#EXTINF:-1,Digitally Imported - Breaks
http://pub1.diforfree.org:8000/di_breaks_hi

Keybase proof

I hereby claim:

  • I am mciverza on github.
  • I am maclsd (https://keybase.io/maclsd) on keybase.
  • I have a public key ASDZokDPdQ-CMuF0R0S8a7tJET7tFePTvS2NqnJ1LZJktgo

To claim this, I am signing this object:

@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
@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 / 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 / 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 / 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 / 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 / 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 / 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