Skip to content

Instantly share code, notes, and snippets.

@sontek
sontek / klustered.sh
Last active August 20, 2022 12:44
Zapier klustered setup script
mkdir bin/
echo "export PATH=$HOME/bin/:$PATH" >> ~/.bashrc
echo "export CONTAINER_RUNTIME_ENDPOINT=unix:///var/run/containerd/containerd.sock" >> ~/.bashrc
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bashrc
printf "Installing kubectl..."
curl --silent -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
mv ./kubectl ./bin/kubectl
printf "🔥\n"
@sontek
sontek / gitlab.yml
Created February 22, 2022 03:15
Using kaniko in gitlab
build:python:image:
extends:
- .only-main-and-merges
dependencies:
- version
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
stage: build
before_script:
@sontek
sontek / keybase.md
Created June 9, 2021 02:04
keybase.md

Keybase proof

I hereby claim:

  • I am sontek on github.
  • I am sontek (https://keybase.io/sontek) on keybase.
  • I have a public key ASDV97u1WYLtLLSCDyELwsEhd9Bg45Stl1-QlPM3ups_jAo

To claim this, I am signing this object:

@sontek
sontek / helloworld.c
Last active May 26, 2021 17:56
Good C code
#include <stdio.h>
int main() {
int year = 2007 ;
printf("Hello World!\n") ;
printf("CSSE 120 changed a lot in %d.\n", year) ;
return 0 ;
}
@sontek
sontek / migrate_from_gitlab_hosted_to_gitlab_saas.py
Created April 27, 2021 13:49
Selenium script as a work around for lack of API access to defining webhook secrets in GitLab for the GitHub integration
def import_repo_via_selenium(self, repo_name):
"""
Howto use:
1. Check your version of Chrome with about://
2. Download ChromeDriver that matches it:
https://chromedriver.chromium.org/downloads
3. Unzip and put it somewhere in $PATH, I recommend /usr/local/bin/
"""
api_url = 'https://gitlab.com/zapier/'
DEFAULT_WAIT_TIME = 15
@sontek
sontek / animals.py
Created April 10, 2021 04:08
Graham's (9 years old) first Python program - Classifying animals
"""
Required Attributes:
1. Vertabrate or Invertebrate
2. Fur or No Fur
3. Feathers or No Feathers
4. Gills or No gills
5. Scales or No Scales
"""
class Attributes:
@sontek
sontek / rendered_fonts.js
Created January 12, 2021 15:02
A way to get all rendered fonts on a page
/*
save this file as "rendered_fonts.js"
yarn add puppeteer
node rendered_fonts.js
*/
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
{
"object_types": "attendee",
"sort_by": [
{
"descending": false,
"expression": {
"element_id": "ATTENDEE_NAME",
"attribute_name": "last_name",
"object_type": "response"
}
{
"object_types": "attendee",
"sort_by": [
{
"descending": false,
"expression": {
"element_id": "ATTENDEE_NAME",
"attribute_name": "last_name",
"object_type": "response"
}
{
"fields": [
{
"expression": {
"attribute_name": "confirmation_number",
"object_type": "attendee"
},
"header": "Confirmation #"
},
{