"man getty
" to see option in file
sudo install -m 0755 /etc/issue.d
cat <<EOF | sudo tee /etc/issue.d/details.issue
\n.\o (\s \m \r) \t [\4]
EOF
@FOR /F %%t IN ('cscript //nologo //b %~dp0reset-env.vbs') DO @( | |
@CALL "%%t" | |
@DEL /F /Q "%%t" | |
) |
#!/bin/bash | |
set -eu | |
# DVD images | |
URLS=( | |
"https://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-dvd/SHA256SUMS" | |
"https://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-dvd/SHA256SUMS.sign" | |
"https://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-dvd/debian-testing-amd64-DVD-1.iso" | |
) |
*.bat eol=crlf | |
*.ps1 eol=crlf |
@busybox sh -c "dd if=/dev/urandom| tr -d -c 'a-zA-Z0-9' | head -c 18 | awk '{print substr($1,1,6)"""-"""substr($1,7,6)"""-"""substr($1,13,6)}'" |
//+build mage | |
// https://magefile.org | |
package main | |
import ( | |
"fmt" | |
"github.com/magefile/mage/sh" | |
"os" | |
"regexp" |
#!/usr/bin/env python3 | |
# Based on this (incorrect) response <https://stackoverflow.com/a/43750422> | |
# Changed to always round up size and always display up to 3 decimals. | |
# Shall also work with now retired python 2 language. | |
import math | |
def pp_size(bytes, units=[' bytes','KB','MB','GB','TB', 'PB', 'EB', 'ZB', 'YB'], base=1000.0): | |
""" Returns a human readable string representation of bytes (decimal unit)""" |
0<0# : ^ | |
""" | |
:: Keep a python script inside a bat file | |
:: Source https://stackoverflow.com/a/41651933 | |
@SETLOCAL ENABLEEXTENSIONS | |
@py -3 -x -B "%~f0" %* | |
@SET ERR=%ERRORLEVEL% | |
@:: Pause if not interactive | |
@ECHO %cmdcmdline% | FIND /i "%~0" >NUL | |
@IF NOT ERRORLEVEL 1 PAUSE |
BasedOnStyle: Google | |
Standard: Cpp11 | |
AccessModifierOffset: -2 | |
AllowShortFunctionsOnASingleLine: Inline | |
ColumnLimit: 100 | |
CommentPragmas: NOLINT:.* | |
DerivePointerAlignment: false | |
IncludeBlocks: Preserve | |
IndentWidth: 4 | |
ContinuationIndentWidth: 8 |
#!/bin/sed -rf | |
# Requires GNU sed | |
# | |
# Based on this response: https://stackoverflow.com/a/28269556 | |
# ANSI Sequences: https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797 | |
# Remove BEL and BACKSPACE from command line inputs | |
:again | |
s/\x07+//g | |
s/[^\x08]\x08(\x1b\[K)?// |