Fork me on GitHub

Profile of elimohl

Shared commands

Shared by elimohl 3 years ago

select all interval more than 3 days when there is no date

 $ cat huh.dmp | xargs -n 1 -I {} date --date={} +%s | awk '{if (prev != 0) if ($1 - prev > 3 * 24 * 60 * 60) {print "@" prev "\n" "@" $1}; prev = $1}' | xargs -n 1 -I {} date --date={} +%d.%m.%y | awk 'ORS=NR%2 ? "\t" : "\n"'
Shared by elimohl 3 years ago

count length of string

 $ echo -n string | wc -m
Shared by elimohl 3 years ago

built docker image

 $ docker build -t image_name directory
Shared by elimohl 3 years ago

run docker container

 $ docker run -it --rm image command
Shared by elimohl 3 years ago

Restore datababase from dump file

 $ pg_restore -d mydb dumpfile