Skip to content

Instantly share code, notes, and snippets.

@muka
muka / 99_restart_sound
Created February 13, 2023 19:08
restart sound after sleep
View 99_restart_sound
#!/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
View remove ambassador crd.sh
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 / config.yaml
Last active August 11, 2020 18:34
example config
View config.yaml
######################################
# 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:
@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
View docker-compose.yaml
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 / setup.sh
Last active August 5, 2020 20:11
Setup Ambianic.ai on a PI or debian-like linux
View setup.sh
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
View change linux background commands.md

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
View istio_httpbin.yml
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
View b2match.js
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 / dhcpd.conf
Last active November 21, 2019 07:25
Setup a dhcpd server using docker
View dhcpd.conf
ddns-update-style none;
option domain-name "thpi";
option domain-name-servers 208.67.222.222, 208.67.220.220;
default-lease-time 86400;
max-lease-time 604800;
authoritative;