Skip to content

Instantly share code, notes, and snippets.

TsT tst2005

  • OpenPGP: 64785B92BBDD215F
  • Earth, ǝɔuɐɹɟ
Block or report user

Report or block tst2005

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View factorio-release-check.txt
KO: 0.17.32 ; base/info.json is 0.17.33
KO: 0.17.31 ; base/info.json is 0.17.32
KO: 0.17.30 ; base/info.json is 0.17.31
KO: 0.17.29 ; base/info.json is 0.17.30
KO: 0.17.28 ; base/info.json is 0.17.29
KO: 0.17.27 ; base/info.json is 0.17.28
KO: 0.17.26 ; base/info.json is 0.17.27
KO: 0.17.25 ; base/info.json is 0.17.26
KO: 0.17.24 ; base/info.json is 0.17.25
KO: 0.17.23 ; base/info.json is 0.17.24
@tst2005
tst2005 / jq-object-to-array
Last active Jun 1, 2018
how to convert json object to array
View jq-object-to-array
# wanted result:
# [
# [ "foo", "bar", "buz", "xx" ],
# [ "a1", "b1", "c1", null ],
# [ "a2", "b2", "c2", null ],
# [ "a3", "b3", "c3", null ],
# [ "a4", "b4", "c4", "undef" ]
# ]
printf '[
View jq-select
getrawdata() {
printf '[
{ "id": "bar", "info": "A babab" },
{ "id": "buz", "info": "B ububu" },
{ "id": "foo", "info": "A fofof" }
]';
}
rawdata_to_db() {
jq '{db: .}';
}
View my-firefox-201805.md
  • "uBlock Origin"
  • "uMatrix"
  • "Decentraleyes"
  • "Session Boss" / "Tab Session Manager"
  • "Stylus"
  • "Auto Tab discard"
  • "New Tab Override"
  • "Open Tabs Next to Current"

En test:

@tst2005
tst2005 / filters.sh
Created Apr 17, 2018
chained grep with friendly syntax
View filters.sh
#!/bin/sh
filters() {
if [ $# -le 1 ]; then
local grepopt=''
case "$1" in
('no '?*) set -- "${1#no }"; grepopt='-v' ;;
esac
case "$1" in
(*'=ANY')
grep $grepopt -- '\<'"${1%=*}"'=ANY\>'; return $?
@tst2005
tst2005 / deadlink.sh
Last active Apr 12, 2018
shell script to search about deadlink
View deadlink.sh
@tst2005
tst2005 / pipesum.sh
Last active Apr 4, 2018
curl URL | ./pipesum.sh hashvalue | bash
View pipesum.sh
#!/bin/sh
sumfile="$(mktemp)"
tmpfile="$(mktemp)"
trap "rm -f -- '$tmpfile' '$sumfile'" EXIT
verbose=false
cmd='auto'
hashvalue=''
while [ $# -gt 0 ]; do
case "$1" in
('-v') verbose=true;;
View li.lua
-- inline=false
local cfgl =
{ indent='' -- like parentindent
, prefixindent="" -- use indent
, prefix="{\n"
, suffixindent=nil -- use indent
, suffix="}\n"
, itemindent='\\t ' -- use indent
, itemprefix=""
, itemsuffix=",\n"
@tst2005
tst2005 / longcomment.lua.txt
Created Feb 21, 2018
lua long comments ...
View longcomment.lua.txt
--[[ print("a")
print("b")
]]-- print("c")
print("D") --[[
print("e")
print("f") ]]--
--[[-- print("a")
print("b")
--]]-- print("c") --[[--
@tst2005
tst2005 / c_info
Last active Feb 19, 2018
openssl 1.1.x remove the /usr/lib/ssl/misc/c_info and change the issuer/subject text output format
View c_info
#!/bin/sh
# source: https://gist.github.com/tst2005/797af97fd263677da9e3eede873887ac
for i in $*
do
echo "$i"
openssl x509 -subject -issuer -enddate -noout -in $i \
| sed -e 's#, \([^ ]\+\) = #/\1=#g' -e 's,^\(subject\|issuer\)=\([^ ]\+\) = ,\1= /\2=,g'
echo "--------"
You can’t perform that action at this time.