This file contains 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 | |
function process_directory { | |
for file in "$1"/*; do | |
if [ -d "$file" ]; then | |
process_directory "$file" | |
elif [ -f "$file" ]; then | |
/bin/cat << EOF | |
${file}: |
This file contains 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
async function scrollToBottom() { | |
console.log("Starting to scroll... But let me sing for you while you wait!"); | |
const lyrics = [ | |
"We're no strangers to love", | |
"You know the rules and so do I", | |
"A full commitment's what I'm thinking of", | |
"You wouldn't get this from any other AI", | |
"I just want to tell you how I'm scrolling", | |
"Gotta make you understand", |
This file contains 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
let rows = document.querySelectorAll('.base1 tbody tr'); | |
let domains = []; | |
for (let row of rows) { | |
let domain = row.querySelector('.field_domain a').textContent; | |
domains.push(domain); | |
} | |
console.log(domains.join('\n')); |
This file contains 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 |
This file contains 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 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 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 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 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 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) |
OlderNewer