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 -e | |
src="${1?:No src/file specified}" | |
dst="${2?:No dst/disk specified}" | |
bs=1m | |
diskutil unmountDisk "${dst}" | |
diskutil zeroDisk short "${dst}" | |
if [[ "${src}" == *.lz ]] | |
then | |
lzip -dcvv "${src}" | dd of="${dst}" bs=$bs | |
elif [[ "${src}" == *.xz ]] |
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
// easily create html form select/option with default selection (selected) and disabled | |
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
func selOpt(s string, f ...struct{ v, n string }) string { | |
var o []string |
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 -xe | |
# overcomplicated method of downloading .deb for signal-desktop | |
docker rmi -f getsignal | |
cat <<EOF | docker build -t getsignal -f- . | |
FROM ubuntu | |
RUN apt update | |
RUN apt install -y wget sudo gnupg | |
RUN wget -O- https://updates.signal.org/desktop/apt/keys.asc | apt-key add - | |
RUN echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" >> /etc/apt/sources.list.d/signal-xenial.list | |
RUN apt update |
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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"strconv" | |
"strings" |
NewerOlder