Skip to content

Instantly share code, notes, and snippets.

@marty0678
marty0678 / example_usage.py
Created March 8, 2024 21:57
Django Rest Framework Base Model CRUD Class
# Views
class UserProfileViewSet(BaseModelViewSet):
"""View set for the UserProfile."""
ENABLE_LIST = True
ENABLE_RETRIEVE = True
ENABLE_PARTIAL_UPDATE = True
ENABLE_PAGINATION = True
LIST_CACHE_KEY = "users:user-profiles-list"
@haridhayal11
haridhayal11 / exynos2100_gcam_guide.md
Last active April 2, 2024 01:36
Google Camera for Galaxy S21 Series

Google Camera for Galaxy S21 Series

  • Tested on
    • OneUI 4.x/5.x based Stock/Custom ROMs.
    • GSI with OneUI 4.x/5.x stock firmware.
    • Front Camera Does not work.

S21, S21 FE & S21 Plus

  • 0.5x, 1x and 3x lenses work.

Instructions

@ktprograms
ktprograms / README.md
Last active April 1, 2022 10:17
Swift program that connects to the QEMU Guest Agent on a localhost TCP socket and runs guest-set-time to re-sync the Guest Time after the Host wakes from sleep.

How to use this

Steps before launching the VM

  1. Open the VM Configuration
  2. Go to the QEMU tab and scroll to the bottom.
  3. Click on the text box with the grey text New...
  4. Paste these two lines into it:
-chardev socket,port=4321,host=127.0.0.1,server,nowait,id=qga0
-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0
@paralin
paralin / make-multiarch.bash
Created October 23, 2021 21:21
Create a multi-arch docker image from arch tags
#!/bin/bash
set -eo pipefail
pull_image() {
if ! docker inspect $1 ; then
docker pull $1
fi
docker inspect $1
}
@sgvj
sgvj / Asakuki.yaml
Last active November 6, 2023 06:29
My Asakuki Esphome Configuration file
# This fits my needs, some logic could/should be added so let me know if you figure it out
# I deliberarly de-coupled lights and mist
# Most of my useage comes from automations that trigger actions, I have a single mist on/off switch in HomeAssistant UI
substitutions:
devicename: asakuki
esphome:
name: $devicename
platform: ESP8266
@e-minguez
e-minguez / README.md
Last active May 16, 2023 21:43
docker on lxc on turris omnia

Turris

opkg install kmod-veth
opkg install kmod-ipt-extra
opkg install iptables-mod-extra
  • Install a new container (I created an arch linux container)
  • Open up the /srv/lxc/containername/config file for editing:
@FreddieOliveira
FreddieOliveira / docker.md
Last active April 30, 2024 10:31
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@Jonty
Jonty / extract_code_from_doxygen.py
Created December 28, 2020 19:11
Extract all code from a set of Doxygen generated documentation, for use when recovering code that has otherwise been lost
# This extracts all the code from a set of Doxygen generated documentation
# where the code is embedded and highlighted. You really only need to use this
# when attempting to recover lost code and you still have the docs.
# Writes all code out into the original directory structure relative to where
# the script is executed.
# Run: `python extract_code_from_doxygen.py URL_TO_DOXYGEN_FILES_PAGE`
# e.g. `python extract_code_from_doxygen.py http://swf2svg.sourceforge.net/azar/doc/files.html`
@Paulchen-Panther
Paulchen-Panther / libreelec.sh
Last active November 10, 2023 06:54
Hyperion.NG on LibreELEC installation script
#!/bin/sh
# Script for installing Hyperion.NG release on LibreElec
# Examples of usage:
# Download and install latest Hyperion.NG release: libreelec.sh
# Download an specific Hyperion.NG release: libreelec.sh 2.0.0-alpha.6
# Install an specific Hyperion.NG release tar.gz file: libreelec.sh /storage/deploy/Hyperion-2.0.0-alpha.7-Linux-armv7l.tar.gz
#Set welcome message
echo '*******************************************************************************'
echo 'This script will install Hyperion.NG on LibreELEC'
@BeerOnBeard
BeerOnBeard / install-kubernetes-on-buster.sh
Created January 24, 2020 15:51
Set up a single-node Kubernetes system on Debian 10 (Bustomer). Use Flannel as the network fabric. Install the Kubernetes dashboard.
#!/bin/bash
set -e;
# Set up a single-node Kubernetes system on Debian 10 (Buster).
# Use Flannel as the network fabric. Install the Kubernetes
# dashboard.
# disable swap
swapoff -a;