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
// this is original | |
// https://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg | |
digraph G { | |
graph [ | |
bgcolor=grey90; | |
splines=true; | |
dpi=200; | |
rankdir=TB; | |
pad=1; |
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
set some {a {x 1 y 2 z 3} b { x 4 y 5 z 6} c { a {x 7 y 8 z 9}}} | |
proc d {param} { | |
set varname [lindex [split $param .] 0] | |
set params [lrange [split $param .] 1 end] | |
upvar $varname object | |
return [dict get $object {*}[join $params { }]] | |
} | |
puts "default: [dict get $some a x]" |
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
rename unknown _unknown | |
proc unknown {args} { | |
puts stderr "Hey, wrong method: $args" | |
} |
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 require ncgi | |
set line "ссылка" | |
puts "SRC: $line" | |
set encoded [ncgi::encode [encoding convertto utf-8 $line]] | |
puts "ENCODED: $encoded" | |
set decoded [ncgi::decode $encoded] | |
puts "DECODE $decoded" |
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
uplevel 0 [package unknown] x | |
puts "[package names]" |
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
# one command line | |
export LINE=200000 LWORD=31 FNAME="dict.json" && printf "[" > "$FNAME" && cat /dev/random | tr -dc 'a-zA-Z' | fold -w $LWORD | head -n $LINE | sed 's/^/"/; s/$/",/' >> "$FNAME" && sed -i '$s/",/"]/' "$FNAME" | |
# | |
export \ | |
LINE=200000 \ | |
LWORD=31 \ | |
FNAME="dict.json" && \ | |
printf "[" > "$FNAME" && \ | |
cat /dev/random | tr -dc 'a-zA-Z' | fold -w $LWORD | head -n $LINE | sed 's/^/"/; s/$/",/' >> "$FNAME" && \ |
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
set -gx TERM "xterm-256color" | |
set -gx EDITOR "vim" | |
set c_off "\e[0m" | |
set c_bold_on "\e[1m" | |
set c_light_on "\e[2m" | |
set c_underscore "\e[4m" | |
set c_blink_on "\e[5m" | |
set c_reverse "\e[7m" | |
set c_concealed_on "\e[8m" |
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
export TERM="xterm-256color" | |
export EDITOR="vim" | |
# source link: | |
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh | |
# | |
# download link: | |
# https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh | |
PATHTOGITPROMPT="$HOME/git-prompt.sh" | |
[[ -s "$PATHTOGITPROMPT" ]] && source "$PATHTOGITPROMPT" |
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
# |
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
pg_restore -h 127.0.0.1 -p 5432 -U horse -d horse -v late | |
# | |
psql -U username -d basename < command.sql | |
psql -U username -d basename -t < command.sql |
NewerOlder