This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"sync" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ask for input with default | |
ask() { | |
local prompt default reply | |
prompt="$1" | |
default="$2" | |
while true; do | |
read -p "$prompt [$default]: " reply |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
import serial | |
import time | |
import subprocess | |
import re | |
@click.command() | |
@click.option('--brightness', default=50, prompt='Enter brightness', type=int) | |
@click.option('--temp_floor', default=40.0, prompt='Enter temperature floor', type=float) | |
@click.option('--temp_ceiling', default=80.0, prompt='Enter temperature ceiling', type=float) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int redPin = 9; | |
const int greenPin = 10; | |
const int bluePin = 11; | |
bool firstInputReceived = false; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(redPin, OUTPUT); | |
pinMode(greenPin, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click, RPi.GPIO as GPIO, time, subprocess, re | |
@click.command() | |
@click.option('--brightness', default=50, prompt='Enter brightness', type=int) | |
@click.option('--r_pin', default=32, prompt='Enter R pin', type=int) | |
@click.option('--g_pin', default=33, prompt='Enter G pin', type=int) | |
@click.option('--b_pin', default=12, prompt='Enter B pin', type=int) | |
@click.option('--temp_floor', default=40.0, prompt='Enter temperature floor', type=float) | |
@click.option('--temp_ceiling', default=80.0, prompt='Enter temperature ceiling', type=float) | |
def main(brightness, r_pin, g_pin, b_pin, temp_floor, temp_ceiling): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# Unlock a LUKS volume with a specified device and default mount path: | |
# ./luks.sh unlock /dev/sdx1 | |
# Unlock a LUKS volume with a specified device and custom mount path: | |
# ./luks.sh unlock /dev/sdx1 /mnt/custom_mount | |
# Lock a LUKS volume with the default mount path: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit on errors and unset variables | |
set -euo pipefail | |
# Function to detect package manager and install packages | |
install_packages() { | |
local debian_packages=(build-essential libncurses-dev bison flex libssl-dev libelf-dev dwarves) | |
local redhat_packages=(make gcc ncurses-devel bison flex openssl-devel elfutils-libelf-devel pahole) | |
local suse_packages=(make gcc ncurses-devel bison flex libopenssl-devel libelf-devel dwarves) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import click | |
import requests | |
from bs4 import BeautifulSoup | |
# Constants | |
KERNEL_ORG_URL = "https://www.kernel.org/" | |
VERSION_FILE = "latest_kernel_version.txt" | |
DOWNLOAD_DIR = "./downloads" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "instance_name" {} | |
variable "image_path" {} | |
variable "libvirt_uri" {} | |
variable "pci_devices" { | |
type = list(string) | |
default = [] | |
} | |
provider "libvirt" { | |
uri = var.libvirt_uri |
NewerOlder