Skip to content

Instantly share code, notes, and snippets.

View ddelange's full-sized avatar
💥
["translatio", "imitatio", "aemulatio"]

ddelange ddelange

💥
["translatio", "imitatio", "aemulatio"]
View GitHub Profile
@WilliamDenniss
WilliamDenniss / install-knative.sh
Last active December 7, 2022 07:43
Installation of Knative on a GKE Autopilot cluster
# Install Knative
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.0.0/serving-crds.yaml
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.0.0/serving-core.yaml
# Autopilot Mod: Remove annotation
kubectl patch -n knative-serving deployment activator --type=json -p='[{"op":"remove","path":"/spec/template/metadata/annotations/cluster-autoscaler.kubernetes.io~1safe-to-evict"}]'
kubectl patch -n knative-serving deployment autoscaler --type=json -p='[{"op":"remove","path":"/spec/template/metadata/annotations/cluster-autoscaler.kubernetes.io~1safe-to-evict"}]'
kubectl patch -n knative-serving deployment domainmapping-webhook --type=json -p='[{"op":"remove","path":"/spec/template/metadata/annotations/cluster-autoscaler.kubernetes.io~1safe-to-evict"}]'
kubectl patch -n knative-serving deployment webhook --type=json -p='[{"op":"remove","path":"/spec/template/metadata/annotations/cluster-autoscaler.kubernetes.io~1safe-to-evict"}]'
@jdvala
jdvala / killed.md
Created April 22, 2021 11:19
what killed my process

dmesg -T| grep -E -i -B100 'killed process'

@jdvala
jdvala / show_mem.md
Created April 22, 2021 11:18
who is using resources
#!/bin/bash

stats=””
echo "%   user"
echo "============"

# collect the data
for user in `ps aux | grep -v COMMAND | awk '{print $1}' | sort -u`
do
@rcoup
rcoup / conftest.py
Created June 27, 2019 15:02
Click CliRunner with PDB working better under pytest
import contextlib
import io
import warnings
import pytest
from click.testing import CliRunner
"""
In your tests:
@wasi0013
wasi0013 / optimized_image_check.py
Created March 23, 2019 10:51
Find un-optimized images of a webpage using requests_html python
import requests_html
def unoptimized_images(url):
"""
find unoptimized images in a webpage
:param url: webpage_url
:return : tuple of image_count in int, images list of dict
"""
session = requests_html.HTMLSession()
response = session.get(url)
images = []
@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

# install_certifi.py
#
# sample script to install or update a set of default Root Certificates
# for the ssl module. Uses the certificates provided by the certifi package:
# https://pypi.python.org/pypi/certifi
import os
import os.path
import ssl
import stat
@txomon
txomon / test.py
Created August 4, 2018 04:54
Python 3.7 ContextVar example in asyncio
from contextvars import ContextVar
import asyncio
import random
cv = ContextVar('cv')
async def waiting_func(name):
print(f'{name} Before sleep: {cv.get() == name}')
@dikiaap
dikiaap / git-io-custom-url.md
Last active June 19, 2024 01:26
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
Neo4j install OS X
$ brew install neo4j
To have launchd start neo4j now and restart at login:
brew services start neo4j
Or, if you don't want/need a background service you can just run:
neo4j start
DB Folder