Skip to content

Instantly share code, notes, and snippets.

View McShauno's full-sized avatar

Shaun McDonnell McShauno

View GitHub Profile
@ninjarobot
ninjarobot / strace-netcore.md
Last active May 24, 2022 19:22
Trace .NET Core Applications on Linux with `strace`

Trace .NET Core Applications on Linux with strace

Troubleshooting a running application can be difficult, usually it starts around checking log output and then following through the likely code paths to get an idea of where a failure may occur. In a development environment, you might attach a debugger a step through source, but troubleshooting isn't always that convenient. There are several helpful tools that can assist, but one that gives the most comprehensive view of a running application is strace. With strace you are able to see all of the system calls an application makes to get a detailed understanding of what is going on "under the hood" in order to troubleshoot an issue.

Take a simple "hello world" F# application, the kind you get from dotnet new console -lang F# -n strace-sample". Build it with dotnet build and then launch it with strace to get a trace of all the system calls in a file called trace.log(adjusting for your build output path if on a different framework vers

@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@jgsqware
jgsqware / kubeadm-install-offline.md
Last active March 7, 2024 05:48
Offline Kubeadm install

On master and nodes

Pull images form internet access laptop

docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-controller-manager-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-proxy-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-scheduler-amd64:v1.5.0
docker pull weaveworks/weave-npc:1.8.2
docker pull weaveworks/weave-kube:1.8.2
@chenrui333
chenrui333 / Dockerfile
Created January 5, 2017 15:17
Dockerize Pingfederate
FROM amazonlinux:latest
MAINTAINER rui.chen <rui.chen@harvardbusiness.org>
ADD pingfederate-8.3.0.zip /
RUN yum install -y unzip wget
RUN wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm" && \
yum install -y jdk-8u91-linux-x64.rpm
@t413
t413 / update.sh
Created July 23, 2016 00:11
manage a OpenWRT LetsEncrypt https instalation
#!/usr/bin/env sh
## update.sh - manage a OpenWRT LetsEncrypt https instalation
# HOWTO:
# - put update.sh in its own directory (like /root/.https)
# - run ./update.sh your.domain.com (that domain needs to point to your router)
# * this get an issued cert from letsencrypt.org using the webroot verification method
# * also installs curl and ca-certificates packages
# - use crontab -e; add the line `0 0 * * * "/root/.https/update.sh" >>/root/.https/log.txt 2>&`
# * this runs the update every day, logging everything to log.txt
#
@stevejenkins
stevejenkins / unifi_ssl_import.sh
Last active August 30, 2021 03:57
Import and use SSL certificates (including Let's Encrypt) with the Ubiquiti UniFi Controller on Unix/Linux Systems
# MOVED TO https://github.com/stevejenkins/unifi-linux-utils
@squarism
squarism / iterm2.md
Last active May 3, 2024 08:58
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@ryancurrah
ryancurrah / cloud-config-master.yaml
Last active July 13, 2019 20:54
CoreOS w/ Kubernetes Cloud Config
#cloud-config
#type: master
---
hostname: master01
users:
- name: core
passwd: $6$rounds=4096$qTfXAnCBjkQ326$zRFWfe45s3quKvxl2pax1Ml44PCPNQQYXcJ.r0FfkN5jwecdipepTLMNEQCsAcGJkH5NA6BCPr4VIGJNftBIe.
groups:
- sudo
@4Evergreen4
4Evergreen4 / gruvbox.theme
Created May 12, 2015 17:59
Gruvbox dark theme for xfce4-terminal (put this in ~/.xfce4/config/terminal/terminalrc)
ColorForeground=#f2f2e5e5bcbc
ColorBackground=#323230302f2f
ColorCursor=#d65bc4cd8ca1
ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#929283837474;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#b9b9a6a69393
@abyx
abyx / angular-error-handling.js
Last active February 4, 2022 19:19
AngularJS HTTP Error Handling Mechanism
var HEADER_NAME = 'MyApp-Handle-Errors-Generically';
var specificallyHandleInProgress = false;
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) {
return {
// --- The user's API for claiming responsiblity for requests ---
specificallyHandled: function(specificallyHandledBlock) {
specificallyHandleInProgress = true;
try {
return specificallyHandledBlock();