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
with_entries(if .key == "Version" then . + {value: (.value | tonumber)} else . end) |
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
var textAreasCount = 0; | |
var linesCount = 0; | |
var linesReplaced = 0; | |
var linesSkipped = 0; | |
var start = performance.now(); | |
function formatMilliseconds(ms) { | |
return Number.parseFloat(ms.toFixed(3)) |
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
fetch_with_curl() { | |
local url=$1 | |
local timeout=${2:-10} | |
url="$url?q=$(date +'%s')" | |
curl -s -w "%{http_code} %{speed_download} %{size_download} %{time_namelookup} %{time_connect} %{time_total}\n" \ | |
-H "Pragma: no-cache" -H "Cache-Control: no-cache" -H "Expires: 0" \ | |
-o /dev/null --connect-timeout $timeout $url | |
} |
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
ARG go_version=1.11.3 | |
ARG alpine_version=latest | |
FROM golang:${go_version}-alpine AS builder | |
ENV GOPATH /build | |
ENV GOOS linux | |
ENV GOARCH amd64 | |
ENV CGO_ENABLED 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
retry() { | |
local n=1 | |
local max=5 | |
local delay=15 | |
while true; do | |
"$@" && break || { | |
if [ $n -lt $max ]; then | |
n=$((n+1)) | |
# No output on failure to allow redirecting output | |
sleep $delay; |
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 | |
set -u | |
set -o pipefail | |
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
CIDR=${CIDR-} | |
GATEWAY=${GATEWAY-} | |
DEVICE=${DEVICE:-'eth0'} |
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 -eu | |
export PATH=${PATH}:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
_string_to_lower() { | |
echo "$*" | tr '[:upper:]' '[:lower:]' | |
} | |
_sanitize_platform() { | |
case "$1" in |
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 | |
# To make it work, set the following: | |
# $ echo 'DPkg::Pre-Install-Pkgs { "xargs -r bash /home/vagrant/strip-deb.sh"; }' > /etc/apt/apt.conf.d/00strip-deb | |
set -e | |
set -u | |
set -o pipefail | |
generate_ldconfig_script() { |
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
ARG go_version=1.17 | |
ARG alpine_version=latest | |
FROM golang:${go_version}-alpine AS builder | |
ARG GOOS=linux | |
ARG GOARCH=amd64 | |
ENV GOOS=${GOOS} | |
ENV GOARCH=${GOARCH} |
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
#include <stdio.h> | |
int main (int argc, char **argv) | |
{ | |
unsigned int eax, ebx, ecx, edx; | |
asm( | |
"xchg{l}\t{%%}ebx, %1\n\t" \ | |
"cpuid\n\t" \ | |
"xchg{l}\t{%%}ebx, %1\n\t" \ |