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
# HiKey970 grub config enabling "grub-reboot 'Experimental kernel'" to one-time boot testing kernels. | |
if [ -s $prefix/grubenv ]; then | |
set have_grubenv=true | |
load_env | |
fi | |
if [ "${next_entry}" ] ; then | |
set default="${next_entry}" | |
set next_entry= | |
save_env next_entry |
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
function compile++ { | |
local outfn="${1%.*}" | |
ionice -c 3 \ | |
nice -n 19 \ | |
g++ \ | |
-std=gnu++17 \ | |
-pipe \ | |
-march=haswell \ | |
-mtune=skylake \ | |
-O3 \ |
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
# Print a black and white PNG file on the first available Brother label printer | |
# Requires https://github.com/pklaus/brother_ql | |
# Source (.) this file to set bash completion and add the print function. | |
function print-png-label() { | |
if [ -f "$1" ]; then | |
# Change these to match your printer: | |
local LBLPMODEL="QL-720NW" | |
local LBLPSIZE="62" |
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 | |
# piplay - Raspberry Pi Omxplayer wrapper script. | |
# Required packages on Debian: omxplayer youtube-dl attr | |
# TODO / future plans: Use the D-Bus interface to store media playback position and resume from there. | |
REQUIREMENTS=(omxplayer youtube-dl find sort getfattr setfattr nice ionice) | |
# Subtitle languages, in order of preferences. Format: movie.mkv & movie.en.srt => en | |
SUBTITLELANGUAGES=( nl nld dut en eng ) |
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 -e | |
echo "WARNING: Read and edit this before you run! Needs root privileges." | |
exit 1 | |
apt install debootstrap hdparm sdparm | |
SD=/dev/sdb | |
BASEDIR="." | |
TARGETDIR="rpi-img" |
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
// Any flat object with enumerable properties | |
var properties = { | |
id: "myid", | |
value: "myvalue" | |
}; | |
// This prepends a space to each key. If you only need separators between add them in the join. | |
// ↓ ↓ | |
var string = Object.keys(properties).map(function(n){return ` ${n}="${properties[n]}"`;}).join(""); | |
// ' id="myid" value="myvalue"' |
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 -e | |
# gist - GitHub Gist tool. | |
# Created by Stefan Hamminga <[email protected]>. Use any of these licenses: MIT, | |
# GPL v2.0 or higher, LGPL v2 or higher, or CC BY-4.0. | |
# Repository: https://gist.github.com/44233d48eeff4c510829.git | |
usage() { | |
echo -e " | |
\e[1mgist\e[0m - Wrapper script for GitHub Gist repositories. Allows keeping multiple |
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 | |
MOUNTS=`cat /proc/mounts | cut -d ' ' -f 2 | sort | uniq | tr '/' '\\/'` | |
IFS=$'\n' | |
what_fs() { | |
for MOUNT in ${MOUNTS}; do | |
readlink -f $1 | grep -o "^${MOUNT}" | |
# echo -e "$1" | |
# echo -e "${MOUNT}" |
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 -e | |
if [ $# -lt 1 ]; then | |
echo -e " | |
Connection and host availability test | |
Usage:\n$0 'My network name' [ip_or_hostname] && command_to_run_when_available | |
The network name needs to be quoted and as Network Manager reports it. Try | |
'nmcli c show'. |
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
export RSYNC_SKIP_COMPRESS=3g2/3gp/3gpp/3mf/7z/aac/ace/amr/apk/appx/appxbundle/arc/arj/asf/avi/br/bz2/cab/crypt5/crypt7/crypt8/deb/dmg/drc/ear/gz/flac/flv/gpg/h264/h265/heif/iso/jar/jp2/jpg/jpeg/lz/lz4/lzma/lzo/m4a/m4p/m4v/mkv/msi/mov/mp3/mp4/mpeg/mpg/mpv/oga/ogg/ogv/opus/pack/png/qt/rar/rpm/rzip/s7z/sfx/svgz/tbz/tgz/tlz/txz/vob/webm/webp/wim/wma/wmv/xz/z/zip/zst |