Skip to content

Instantly share code, notes, and snippets.

View clarketm's full-sized avatar
🐍
Programming

Travis Clarke clarketm

🐍
Programming
View GitHub Profile

My notes for using k3d to run clusters locally with Tekton

Updated for working with k3d 3.x

Prereqs:

@clarketm
clarketm / WARNING.md
Created September 29, 2019 23:23 — forked from Ambroos/WARNING.md
Remove SentinelOne agent from Mac. Because honestly, it doesn't seem to do anything at all. Run as root, best is to do this from a recovery mode, single user mode with writeable filesystem, ...

USE AT OWN RISK

This was only tested on a partial SentinelOne installation on the High Sierra beta, where SentinelOne was never allowed to enable it's kernel extension.

@clarketm
clarketm / nginx.conf
Created January 27, 2019 00:04 — forked from weapp/nginx.conf
Return common errors as json in Nginx
error_page 500 /500.html;
location /500.html{
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
}
error_page 502 /502.html;
location /502.html{
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
}
@clarketm
clarketm / .gitignore
Created December 2, 2018 06:59 — forked from marsam/.gitignore
An IPython extension to pretty print python AST.
/build/
@mordr
mordr / note.md
Last active March 18, 2024 20:58
Set Visual Studio Code as default editor for kubectl

Set KUBE_EDITOR to Visual Studio Code, assumes 'code' is in PATH

export KUBE_EDITOR='code --wait'

Running k edit ... will open up the yaml using Visual Studio Code.

@luqmaan
luqmaan / generate-systemd-schedule.js
Last active May 26, 2020 08:10
Script from my blog post "Using systemd as a better cron." https://medium.com/horrible-hacks/using-systemd-as-a-better-cron-a4023eea996d. ⚠️ It may not actually work. 🤷‍♂️
const fs = require("fs");
const getTimerTemplate = (platform, importType, interval) => `
[Unit]
Description=Run ${platform}-${importType} every 15 minutes
Requires=${platform}-${importType}.service
[Timer]
Unit=${platform}-${importType}.service
OnUnitInactiveSec=${interval}
@clarketm
clarketm / import_csv_to_mongo
Created January 24, 2018 02:43 — forked from mprajwala/import_csv_to_mongo
Store CSV data into mongodb using python pandas
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)
@Ambroos
Ambroos / WARNING.md
Last active November 30, 2023 06:20
Remove SentinelOne agent from Mac. Because honestly, it doesn't seem to do anything at all. Run as root, best is to do this from a recovery mode, single user mode with writeable filesystem, ...

USE AT OWN RISK

This was only tested on a 'partial' SentinelOne installation on the High Sierra beta, where SentinelOne was never allowed to enable it's kernel extension. (Some things failed while I was messing around with OS betas.)

This script is most likely outdated.

A lot happens in 2+ years, at this point there's a good chance this script will do more harm than good. Read the comments before using!

@clarketm
clarketm / String.js
Created August 18, 2017 02:30
String.prototype.toTitleCase
String.prototype.toTitleCase = function () {
return this[0].toUpperCase() + this.substring(1).toLowerCase();
};
module.exports = String;
@ziluvatar
ziluvatar / token-generator.js
Last active April 11, 2024 07:10
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jsonwebtoken');