Skip to content

Instantly share code, notes, and snippets.

View potter0815's full-sized avatar

Christoph Schmitter potter0815

View GitHub Profile
@potter0815
potter0815 / add-hypothesis-webclient-every-site.user.js
Last active March 20, 2024 09:37
Hypothes.is everywhere - Tampermonkey / greasemonkey script to enable Hypothes.is web client on all pages
// ==UserScript==
// @name Hypothes.is everywhere
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Enable Hypothesis scriptlet on all pages
// @author https://github.com/potter0815
// @match http://*/*
// @include http://*
// @include https://*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
@potter0815
potter0815 / raspberry_pi_script_as_service.md
Created September 23, 2020 15:22 — forked from emxsys/raspberry_pi_script_as_service.md
How to run a python script as a service in Raspberry Pi - Raspbian Jessie

How to Run a Script as a Service in Raspberry Pi - Raspbian Jessie

By: Diego Acuña

Original Article: http://www.diegoacuna.me/how-to-run-a-script-as-a-service-in-raspberry-pi-raspbian-jessie/

A pretty common task when using this device, is to run some script (for example a python script) as a service in the operating system so it can start on boot, stop and restart using systemctl and more. In this post I'm going to explain how to set a little script as a service using Raspbian Jessie in a Raspberry Pi.

Example Python Script

@potter0815
potter0815 / shutdown_sagemaker.sh
Created November 25, 2019 13:55
shutdown a sagemaker notebook instance from within a Jupyter notebook
# in a code block
%%sh
NOTEBOOK_NAME=$(jq '.ResourceName' /opt/ml/metadata/resource-metadata.json --raw-output)
aws sagemaker stop-notebook-instance --notebook-instance-name $NOTEBOOK_NAME
@potter0815
potter0815 / lambda-concurrency-to-cloudwatch.py
Created July 25, 2018 09:22 — forked from innovia/lambda-concurrency-to-cloudwatch.py
Lambda concurrent execution custom metric on CloudWatch
#!/usr/bin/env python
import boto3
import datetime
import time
ENABLED_REGIONS = [
"us-east-1",
"us-west-2",
"eu-west-1",
"eu-central-1",
@potter0815
potter0815 / aws_lambda.py
Last active August 29, 2015 14:25 — forked from maruks/aws_lambda.py
AWS gateway / lambda function invocation
# AWS Version 4 signing example
# This version makes a POST request and passes request parameters
# in the body (payload) of the request. Auth information is passed in
# an Authorization header.
import sys, os, base64, datetime, hashlib, hmac
import requests # pip install requests
method = 'POST'
service = 'execute-api'
@potter0815
potter0815 / cloneall.sh
Last active January 30, 2024 13:07
clone all private repos of an organization
#!/bin/bash
#requires jq -> http://stedolan.github.io/jq/
#optional change working_dir
working_dir=${1-$(pwd)}
cd $working_dir
user="github_username"
token="application token"
organization="Organization_Name"
##
## This nginx.conf servers as the main config file for webflow reverse proxy
##
## RCS:
## https://gist.github.com/sansmischevia/5617402
##
## Hardening tips:
## http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html
##
@potter0815
potter0815 / README.md
Last active August 29, 2015 14:14 — forked from s0enke/README.md

This is an adjusted version of EC2 CloudWatch stats for Dashing which is not bound to EC2 metrics but a generic widget for cloudwatch graphs. Visualization is done by Rickshawgraph as in the original example.

@potter0815
potter0815 / README.md
Last active August 29, 2015 14:14 — forked from s0enke/README.md

This is an adjusted version of EC2 CloudWatch stats for Dashing which is not bound to EC2 metrics but a generic widget for cloudwatch graphs. Visualization is done by Rickshawgraph as in the original example.

### Keybase proof
I hereby claim:
* I am potter0815 on github.
* I am potter0815 (https://keybase.io/potter0815) on keybase.
* I have a public key whose fingerprint is 0020 10B2 2E6A 3B66 C103 1645 2B51 D97D BDFF 06E4
To claim this, I am signing this object: