Skip to content

Instantly share code, notes, and snippets.

View luxus's full-sized avatar

luxus luxus

  • Infoguard AG
  • Switzerland
  • 11:24 (UTC +02:00)
  • X @luxus
View GitHub Profile
@mehalter
mehalter / .zshrc
Last active March 19, 2024 22:18
Sharable ZSH Configuration
# assumed commands:
# git (plugin management)
# wget (downloading preview script)
# bat (tab preview)
# delta (tab preview)
# w3m (tab preview)
# bsdtar (tab preview)
# jq (tab preview)
# mediainfo (tab preview)
# odt2txt (tab preview)
@L3afMe
L3afMe / .zshrc
Created October 7, 2021 16:52
ZSH Config
# Setup directories
__BASE_DIR="$HOME/Public"
## Config directory
export XDG_CONFIG_HOME="$__BASE_DIR/Config"
## Misc directories
__MISC_BASE_DIR="$__BASE_DIR/Etc"
export POWERCORD_DIR="$__BASE_DIR/Programs/powercord"
export GOPATH="$__MISC_BASE_DIR/Go"
@kaaquist
kaaquist / podman_macos.md
Last active May 4, 2024 22:37
Podman with docker-compose on MacOS.

Podman with docker-compose on MacOS.

Podman an alternative to Docker Desktop on MacOS

Getting podman installed and started is super easy.
Just use brew to install it.

> brew install podman

Now since podman uses a VM just like the Docker Client on MacOS we need to initialize that and start it.

@PanAeon
PanAeon / btrbk.nix
Last active December 16, 2022 22:44
Btrbk on nixos
{ config, pkgs, lib, ... }:
let
cfg = config.services.btrbk;
sshEnabled = cfg.sshAccess != [ ];
serviceEnabled = cfg.instances != { };
attr2Lines = attr:
let
pairs = lib.attrsets.mapAttrsToList (name: value: { inherit name value; }) attr;
isSubsection = value:
if builtins.isAttrs value then true
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
################################################################################
# System
@nepozs
nepozs / hassos-rpi-camera-howto.md
Last active June 26, 2023 14:12 — forked from enegaard/hassos-rpi-camera-howto.md
Getting the Raspberry Pi Camera to Work on HASSOS

Getting the Raspberry Pi Camera to Work on HASSOS

Enabling the Raspberry Pi camera on HASSOS installations is unfortunately not as simple as connecting the camera and configuring Home Assistant as described at https://www.home-assistant.io/integrations/rpi_camera.

For the camera to work at all, an alternate firmware needs to be loaded when the Raspberry Pi boots. On Raspberry Pi OS (and many others), the alternate firmware is included with the OS installation image, and switching to the alternate firmware is accomplished by running raspi-config and selecting "Enable Camera" from the menu. HASSOS does not include either the alternate firmware or the raspi-config program, so all of the steps need to be done manually.

The steps below attempt to describe the steps that need to be performed. They have worked for me on a Raspberry Pi 3B+ running HASSOS 4.11 through 4.15. If you have a different setup your mileage may vary (but hopefully you'll get enough hints from the below to get it working).

A Home Assista

@networkingcat
networkingcat / yet_another_motion_automation.yaml
Last active May 3, 2024 06:20 — forked from quallenbezwinger/motion_controlled_scenes_enhanced.yaml
Homeassistant blueprint for motion-activated light scene
blueprint:
name: Yet Another Motion Automation
description: >
# YAMA V10
Turn on lights or scenes when motion is detected.
Four different scenes can be defined depending on time of day.
@astutecat
astutecat / create-darwin-volume.sh
Last active November 1, 2021 21:45
Notes on setting up Nix on MacOS.
#!/bin/sh
set -e
root_disk() {
diskutil info -plist /
}
apfs_volumes_for() {
disk=$1
diskutil apfs list -plist "$disk"
@danbst
danbst / home-etc.nix
Created December 27, 2019 15:17
Manage your /etc from home-manager (install home-manager as root)
{ config, pkgs, lib, ... }: {
imports = [
(import <nixpkgs/nixos/modules/system/etc/etc.nix>)
];
options.system.build.etc = lib.mkOption { type = lib.types.package; };
options.system.activationScripts.etc =
lib.mkOption { type = lib.types.unspecified; };
config = {
#!/bin/sh
echo "# 24-bit (true-color)"
# based on: https://gist.github.com/XVilka/8346728
term_cols="$(tput cols || echo 80)"
cols=$(echo "2^((l($term_cols)/l(2))-1)" | bc -l 2> /dev/null)
rows=$(( cols / 2 ))
awk -v cols="$cols" -v rows="$rows" 'BEGIN{
s=" ";
m=cols+rows;