Skip to content

Instantly share code, notes, and snippets.

View lsjostro's full-sized avatar
:shipit:

Lars Sjöström lsjostro

:shipit:
View GitHub Profile
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: nvidia-gpu-device-plugin
namespace: kube-system
labels:
k8s-app: nvidia-gpu-device-plugin
addonmanager.kubernetes.io/mode: Reconcile
spec:
template:
@lsjostro
lsjostro / init-dotfiles.sh
Last active February 21, 2018 19:45
Init dotfiles
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
git clone git@github.com:lsjostro/dotfiles.git $HOME/.dot_git --bare && \
git --work-tree $HOME --git-dir $HOME/.dot_git checkout --force && \
mkdir -p $HOME/.dot_git/info && echo '*' > $HOME/.dot_git/info/exclude
brew bundle
pip3 install neovim neovim-remote Pygments pygments-style-solarized
nvim -c ":PlugInstall"
nvim -c ":GoInstallBinaries"
@lsjostro
lsjostro / google-auth.go
Created November 6, 2018 08:25
google-auth
package main
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"golang.org/x/oauth2/google"
)
package main
import (
"context"
"fmt"
api "github.com/example/pb"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/grpc"
@lsjostro
lsjostro / debpackage-content.txt
Created February 26, 2019 18:23
gke nvidia ubuntu deb filelist
drwxr-xr-x root/root 0 2018-12-10 08:33 ./
drwxr-xr-x root/root 0 2018-12-10 08:33 ./lib/
drwxr-xr-x root/root 0 2018-08-20 12:20 ./lib/modprobe.d/
-rw-r--r-- root/root 81 2018-08-20 12:20 ./lib/modprobe.d/nvidia-graphics-drivers.conf
drwxr-xr-x root/root 0 2018-12-10 08:33 ./lib/modules/
drwxr-xr-x root/root 0 2018-12-10 08:33 ./lib/modules/4.15.0-1026-gcp/
drwxr-xr-x root/root 0 2018-12-10 08:33 ./lib/modules/4.15.0-1026-gcp/nvidia-396/
drwxr-xr-x root/root 0 2018-12-10 08:33 ./lib/modules/4.15.0-1026-gcp/nvidia-396/bits/
-rw-r--r-- root/root 5904 2018-12-10 08:05 ./lib/modules/4.15.0-1026-gcp/nvidia-396/bits/BUILD
-rw-r--r-- root/root 328 2018-12-10 08:05 ./lib/modules/4.15.0-1026-gcp/nvidia-396/bits/CLEAN
@lsjostro
lsjostro / linux-dotfiles.sh
Last active January 14, 2020 13:19
init linux dotfiles
USERNAME=lsjostrom
pacman -S base-devel git wget iwd iw sudo zsh
useradd -m -s /bin/zsh -G wheel $USERNAME
passwd $USERNAME
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers
sudo -i -u $USERNAME /bin/bash << EOF
echo "--- Init dotfiles"
Apr 15 14:22:14 kean pipewire[45750]: 'CHECK_OUT_PORT(this, SPA_DIRECTION_OUTPUT, port_id)' failed at ../pipewire/src/modules/module-client-node/v0/client-node.c:796 impl_node_port_reuse_buffer()
Apr 15 14:22:14 kean pipewire[45750]: 'CHECK_OUT_PORT(this, SPA_DIRECTION_OUTPUT, port_id)' failed at ../pipewire/src/modules/module-client-node/v0/client-node.c:796 impl_node_port_reuse_buffer()
Apr 15 14:22:14 kean pipewire[45750]: 'CHECK_OUT_PORT(this, SPA_DIRECTION_OUTPUT, port_id)' failed at ../pipewire/src/modules/module-client-node/v0/client-node.c:796 impl_node_port_reuse_buffer()
Apr 15 14:22:14 kean pipewire[45750]: 'CHECK_OUT_PORT(this, SPA_DIRECTION_OUTPUT, port_id)' failed at ../pipewire/src/modules/module-client-node/v0/client-node.c:796 impl_node_port_reuse_buffer()
Apr 15 14:22:14 kean pipewire[45750]: 'CHECK_OUT_PORT(this, SPA_DIRECTION_OUTPUT, port_id)' failed at ../pipewire/src/modules/module-client-node/v0/client-node.c:796 impl_node_port_reuse_buffer()
Apr 15 14:22:14 kean pipewire[45750]: 'CHECK
@lsjostro
lsjostro / allow_google_ips_https.sh
Last active May 17, 2021 20:08
Allow GoogleIPs to access HTTPS through UGS
#!/bin/bash
run="/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper"
# Skapa först en tom grupp Unifi WebUI:et av typen ipv4 som heter GoogleIPs
real_list=$(grep -B1 GoogleIPs /config/config.boot | head -n 1| awk '{print $2}')
ipset_list='temporary-list'
sudo /sbin/ipset -! destroy $ipset_list
@lsjostro
lsjostro / config.gateway.json
Created May 18, 2021 19:07
Unifi custom gateway to allow google ip ranges through on https
{
"firewall": {
"group": {
"address-group": {
"google_ip_ranges": {
"description": "google ip ranges",
"address": [
"8.8.4.0/24",
"8.8.8.0/24",
"8.34.208.0/20",
@lsjostro
lsjostro / gcb-slack-notifty-cloud-function.go
Created December 8, 2021 08:30
Cloud function listening on a pubsub cloud-build pubsub topic for GCB run events and notify on slack
package main
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"strings"