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
# place this at /etc/apt/apt.conf.d/99bootcode | |
DPkg::Post-Invoke { '/usr/local/sbin/bootcode-backup.sh'; }; |
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
@echo off | |
setlocal | |
@REM network adapter name to search by `ipconfig` command | |
set "VETH_SUFFIX=vEthernet (WSL)" | |
@REM IPv4 last octet using on WSL | |
set OCTET4=10 | |
@REM target network device on WSL | |
set "DEV_NAME=eth0" |
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
#!/usr/bin/python3 | |
__author__ = "kow08absty <kow080816@gmail.com>" | |
__version__ = "1.0" | |
__date__ = "17 July 2020" | |
from RPi import GPIO | |
import time | |
import os | |
import argparse |
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 | |
if [ "$(whoami)" != 'root' ]; then | |
echo "required root" | |
exit 1 | |
fi | |
usage() { | |
cat<<EOL | |
Usage: ${0} (start|stop|status|restart) |
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 Write-BranchName { | |
$branch = git rev-parse --abbrev-ref HEAD | |
$can_parse_rev = $? | |
git remote -v > $null | |
if($?){ | |
if(!$can_parse_rev){ | |
# we'll end up here if we're in a newly initiated git repo | |
Write-Host "(new repo) " -NoNewline -ForegroundColor Cyan |
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
/** | |
* to load this script | |
* below android{} closure | |
apply from: '../publisher.gradle' | |
*/ | |
import java.nio.file.Paths | |
import java.util.regex.Matcher | |
import java.util.regex.Pattern |
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 | |
# sudo apt install bash-completion | |
# sudo cp etc-bash_completion.d-wol.bash /etc/bash_completion.d/wol.bash | |
_wol() { | |
local _cur="${COMP_WORDS[COMP_CWORD]}" | |
COMPREPLY=( $(compgen -W "$(wol --list)" -- "$_cur") ) | |
} |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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 | |
if [ $(whoami) != 'root' ]; then | |
echo Requires root. | |
exit 1; | |
fi | |
if ls /sys/block/md[0-9]*/md/sync_action &> /dev/null; then | |
for path in /sys/block/md[0-9]*/md/sync_action; do | |
if [ $(cat "$path") = 'idle' ]; then |
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 | |
TARGET='/etc/fstab' | |
DESCRIPTOR='<#--#>' | |
if [ $(whoami) != 'root' ]; then | |
echo 'Required root.' | |
exit 1 | |
fi |