Skip to content

Instantly share code, notes, and snippets.

@muka
muka / 99_restart_sound
Created February 13, 2023 19:08
restart sound after sleep
#!/bin/sh
case "$1" in
post)
for DEVICE_ID in `lspci -D |grep Audio|awk '{print $1}'`
do
echo 1 > /sys/bus/pci/devices/${DEVICE_ID}/remove
done
sleep 1
echo 1 > /sys/bus/pci/rescan
0xe6C7971b7255212511A5dFeFc92F8E18755F9c7C
k delete customresourcedefinitions.apiextensions.k8s.io authservices.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io consulresolvers.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io devportals.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io filterpolicies.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io filters.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io hosts.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io kubernetesendpointresolvers.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io kubernetesserviceresolvers.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io logservices.getambassador.io && \
k delete customresourcedefinitions.apiextensions.k8s.io mappings.getambassador.io && \
@muka
muka / setup.sh
Last active August 5, 2020 20:11
Setup Ambianic.ai on a PI or debian-like linux
sudo true
echo "Installing Ambianic.ai"
sudo apt update -q && sudo apt install wget -y -q
if ! type "docker" > /dev/null; then
echo "Installing docker"
wget -qO- https://get.docker.com/ | sh
#sudo usermod -aG docker ${USER}
fi
@muka
muka / docker-compose.yaml
Last active August 11, 2020 18:33 — forked from ivelin/docker-compose.yaml
Default docker compose configuration for Ambianic Edge
version: "3.7"
services:
ambianic-edge:
container_name: ambianic-edge
restart: unless-stopped
privileged: true
image: ambianic/ambianic-edge:latest
network_mode: "host"
devices:
- "/dev/video0:/dev/video0"
@muka
muka / config.yaml
Last active August 11, 2020 18:34
example config
######################################
# Ambianic main configuration file #
######################################
version: '1.2.4'
# path to the data directory
data_dir: ./data
# Set logging level to one of DEBUG, INFO, WARNING, ERROR
logging:

xfce

  • set gconftool-2 --type string --set /desktop/gnome/background/picture_filename /path/to/image.jpg
  • list xfconf-query --channel xfce4-desktop --list

lxde

  • set pcmanfm --set-wallpaper="/your/background/file"

kde

  • dbus (?)
@muka
muka / istio_httpbin.yml
Last active February 17, 2020 13:47
kubeflow 1.0RC / kubernetes v1.15 setup
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: httpbin-gateway
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
@muka
muka / b2match.js
Created January 22, 2020 14:01
extract a list of people from a b2match API call
const baseUrl = "https://aal-programme-info-day-2020.b2match.io/participants"
const data = require("./data.json")
const participantRow = (participant) => {
let {
id,
user,
organisation_name,
organisation_type,
@muka
muka / extract-ip.sh
Created October 16, 2018 04:51
Extract the ip from a docker-compose set of container
NET_NAME="project_default"
NAME="nats"
IP=docker network inspect $NET_NAME | grep $NAME -A 3 | grep "IP" | grep -Po "([0-9]+.[0-9]+.[0-9]+.[0-9])"
echo $IP