cat file.txt
grep '' file.txt
awk '/.*/ { print }' file.txt
dd status=none if=file.txt (GNU dd)
curl file://$PWD/file.txt
jq -rRs . file.txt
ffmpeg -v quiet -f data -i file.txt -map 0:0 -c text -f data -
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
def _chunk($size): | |
( range( | |
( (length / $size) | ceil | |
| if . == 0 then 1 end | |
) | |
) as $i | |
| .[$i * $size:($i + 1) * $size] | |
); |
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 cli | |
import ( | |
"log" | |
"os" | |
"runtime" | |
"runtime/pprof" | |
) | |
func maybeProfile() func() { |
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
https://github.com/docker-library/golang/blob/f300e60ca19c3b98cfcf01ca112af2ac10104320/1.17-rc/alpine3.14/Dockerfile#L30 | |
apkArch="$(apk --print-arch)"; \ | |
case "$apkArch" in \ | |
'x86_64') \ | |
export GOARCH='amd64' GOOS='linux'; \ | |
;; \ | |
'armhf') \ | |
export GOARCH='arm' GOARM='6' GOOS='linux'; \ | |
;; \ |
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 ( | |
"fmt" | |
"runtime" | |
) | |
func a(f func()) { | |
defer func() { | |
if rv := recover(); rv != nil { |
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
FROM debian:9.5 | |
# Update, and install basic packages | |
RUN apt-get update | |
RUN apt-get install -y build-essential curl git python | |
# install depot_tools http://www.chromium.org/developers/how-tos/install-depot-tools | |
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
ENV PATH /depot_tools:$PATH |
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
def csv: split(","); | |
def csv_kv: [csv[] | split("=") | {(.[0]): .[1]}] | add; | |
def obj_to_csv_kv: [to_entries[] | [.key, .value] | join("=")] | join(","); | |
# TODO: errors? | |
def csv_range_map: | |
# "0-2=a,1=b" -> ["a", "b", "a"] | |
[ csv[] | |
| split("=") | |
| .[1] as $c | |
| .[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
go run always exits with error code 1 https://github.com/golang/go/issues/13440 | |
probably the reason it print the error code | |
-coverpk=./... will load all packages, even non-imported ones, causing init() to run | |
Default behaviour of signals on linux: | |
https://github.com/golang/go/blob/master/src/runtime/sigtab_linux_generic.go |
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
docker run -ti --rm -v "$PWD:$PWD" -w "$PWD" -v /var/run/docker.sock:/var/run/docker.sock ubuntu | |
apt-get install cmake pkg-config libicu-dev docker.io ruby ruby-dev libz-dev build-essential libssl-dev | |
gem install bundler | |
script/bootstrap | |
script/add-grammar https://github.com/wader/linguist-language-jq | |
script/update-ids | |
bundle exec rake samples | |
bundle exec rake test |
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
# work fine for 9.4 to 13 | |
pg_dump -c -U postgres postgre > db.sql | |
psql -U postgres < db.sql |