#TIL : Zip compressing list of files

To specify a list of compressed files when using zip cli tool, you could use [email protected] [file_list] flag. And file_list is a file contains list of compressed file (new line separated)

Example

1
$ zip changed.zip [email protected] changed_files.txt

Or use stdin pipe

1
$ find . -mmin -60 -print | zip changed_1_hour_ago [email protected]

This will zip all changed files 1 hour ago

#TIL : Base 64 encode and decode builtin tool

Browsers have helpers function to encode and decode base64 :

  • btoa : base64 encode
  • atob : base64 decode
1
2
3
4
5
> btoa('Hello world')
"SGVsbG8gV29ybGQgIQ=="

> atob('SW4gR29kIFdlIFRydXN0ICE=')
"In God We Trust !"