Skip to content

Instantly share code, notes, and snippets.

View mapattacker's full-sized avatar

Jake Teo mapattacker

View GitHub Profile
@icebob
icebob / k3s_helm_install.sh
Last active October 16, 2024 08:20
K3S + Helm installing
# Install K3S
curl -sfL https://get.k3s.io | sh -
# Copy k3s config
mkdir $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chmod 644 $HOME/.kube/config
# Check K3S
kubectl get pods -n kube-system
@pudquick
pudquick / battery.py
Last active April 20, 2023 06:06
Accessing battery details via python and pyobjc on macOS / OS X
import objc
from Foundation import NSBundle
IOKit = NSBundle.bundleWithIdentifier_('com.apple.framework.IOKit')
functions = [("IOServiceGetMatchingService", b"II@"),
("IOServiceMatching", b"@*"),
("IORegistryEntryCreateCFProperties", b"IIo^@@I"),
("IOPSCopyPowerSourcesByType", b"@I"),
("IOPSCopyPowerSourcesInfo", b"@"),
@raghothams
raghothams / demography_mapper.py
Last active September 19, 2017 03:01
Spark 2.X MongoDB
from pyspark.sql import SparkSession
spark = SparkSession \
.builder \
.appName("demography mapper") \
.getOrCreate()
df_user = spark.read.format("com.mongodb.spark.sql.DefaultSource")\
.option("spark.mongodb.input.uri", "mongodb://localhost:27017/raw.user").load()
@clhenrick
clhenrick / README.md
Last active September 25, 2024 08:26
PostgreSQL & PostGIS cheatsheet (a work in progress)
@emeeks
emeeks / edgelist.csv
Last active July 6, 2019 00:24
Adjacency Matrix from Node/Edge List
source target weight
sam tully 3
sam pat 8
sam kim 2
sam pris 1
roy pris 5
roy sam 1
tully sam 1
tully pris 5
tully kim 3
@jpwatts
jpwatts / mac-homebrew-pyexiv2.sh
Created February 10, 2011 00:33
In which I finally get pyexiv2 working on my Mac using Homebrew and a series of disgusting hacks
#!/bin/sh
brew install python boost exiv2
curl -O http://launchpadlibrarian.net/61465005/pyexiv2-0.3.0.tar.bz2
tar xjvf pyexiv2-0.3.0.tar.bz2
cd pyexiv2-0.3.0
# https://answers.launchpad.net/pyexiv2/+question/140742
echo "env['FRAMEWORKS'] += ['Python']" >> src/SConscript