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
#!/usr/bin/python3 | |
import RPi.GPIO as GPIO | |
import time | |
# Disable warnings | |
GPIO.setwarnings(False) | |
# Define channels | |
switch = 18 | |
sensor = 17 |
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
minecraft@minecraft:~$ cat bin/getlatestminecraftsnapshot.bash | |
#!/bin/bash | |
# A quick and dirty script to fetch the latest minecraft snapshot for multicraft | |
cd ~/multicraft/jar | |
VERSION_URL="https://launchermeta.mojang.com/mc/game/version_manifest.json" | |
LATEST_VER=$(wget -qO - "${VERSION_URL}" | jq -r .latest.snapshot) | |
# Our CURRENT_VER is stored in current_ver and we don't need no stinking error messages | |
source current_snap > /dev/null 2>&1 |
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
# Save as ~/.config/systemd/user/weechat.service | |
# Remember that you need to allow background processes to keep running | |
# even when there are no interactive sessions: | |
# sudo loginctl enable-linger username | |
# And then: | |
# systemctl --user daemon-reload && systemctl --user --now enable weechat.service | |
[Unit] | |
Description=weechat session | |
After=bitlbee.service |
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
# This unit file is suitable for running as a normal user, as a user unit | |
# I.e. put the file in $HOME/.config/systemd/user and do systemctl --user daemon-reload | |
# Then start it with systemctl --user start minecraft.service | |
# Your user needs permission to run units while not logged in (linger): | |
# sudo systemctl enable-linger <your user> | |
[Unit] | |
Description=Minecraft Server | |
After=network.target |
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
iface eth0 inet6 static | |
address 2001:700:1d00:beef::13 | |
netmask 64 | |
gateway 2001:700:1d00:beef::1 | |
accept_ra 0 | |
privext 0 |
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 | |
export LC_ALL=en_US.utf-8 | |
Repo="username@remote:path" # Path to premade remote repo, preferably with encryption | |
Backupdir="/path/to/backup" # Same as exportdir in zcash.conf | |
Date="$(date +%Y-%m-%d)" | |
Options="--compression lz4 --chunker-params 19,23,21,4095" | |
zcash-cli z_exportwallet keysbackup | |
zcash-cli backupwallet walletbackup |
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
[Unit] | |
Description=Minecraft Server | |
[Service] | |
# Adjust these to your liking, the service assumes that minecraft_server.jar and eula.txt already | |
# exists in this directory, and that the User specified has write access to the WorkingDirectory | |
# | |
# To send commands to minecraft, do: | |
# echo "command" >> minecraft-input |
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
function makethumbnail() { | |
filename="$(basename ${1} .mp4)" | |
# Use the wadsworth constant to set the time when we want the thumbnail from | |
# http://knowyourmeme.com/memes/the-wadsworth-constant | |
wadsworth=$(echo "${2} * 0.3 / 1 * 60" | bc) | |
echo "INFO: Creating thumbnail for ${1} by skipping ${wadsworth} seconds ahead." | |
if [ ! -f ${filename}.jpg ]; then | |
${FFMPEGPATH}/ffmpeg -loglevel ${LOGLEVEL} -ss ${wadsworth} -i ${1} -vframes 1 -an ${filename}.jpg | |
if [ "${?}" -ne 0 ]; then | |
echo "ERROR: Creation of thumbnail for ${1} failed." |
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
################## | |
# Privacy Settings | |
################## | |
# Privacy: Let apps use my advertising ID: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 | |
# To Restore: | |
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1 | |
# Privacy: SmartScreen Filter for Store Apps: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0 |
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
# Explanation haiku: | |
# semi-random temp password | |
# easy to remember, type | |
# not very secure | |
function maketemppassword() { | |
part1="$(awk 'length==8' /usr/share/dict/words | grep -v '[^[:alpha:]]' | shuf -n 1 | tr '[:upper:]' '[:lower:]')" | |
part2="$(< /dev/urandom tr -dc 0-9 | head -c${1:-2};echo;)" | |
part3="$(< /dev/urandom tr -dc A-Z | head -c${1:-2};echo;)" | |
echo "${part1}-${part2}_${part3}" | |
} |
NewerOlder