Skip to content

Instantly share code, notes, and snippets.

@lopezpdvn
Last active May 26, 2016 23:09
Show Gist options
  • Save lopezpdvn/764defc7553969ab24fe to your computer and use it in GitHub Desktop.
Save lopezpdvn/764defc7553969ab24fe to your computer and use it in GitHub Desktop.
misc cheatsheet

Misc cheatsheet

youtube-dl to download videos and extract audio.

$ youtube-dl -x --audio-format mp3 --audio-quality 320k --embed-thumbnail -a uris.txt

Robocopy

set SRC=C:\Users\someuser\Documents
set DST=D:\someuser_Documents
robocopy %SRC% %DST% /E /Z /R:0 /TS /LOG+C:\Users\someuser\log.txt /TEE /XJ

YAML

Prefer array of maps to map of maps. That is, instead of having

key0:
    title: Title 0
    path: /tmp/title0
key1:
    title: Title 1
    path: /tmp/title1

use something like

- title: Title 0
  path: /tmp/title0
  key: key0
- title: Title 1
  path: /tmp/title1
  key: key1

QR encoding/decoding

$ qrencode -o $out -s 20 -m 0 -t PNG -c 'http://pedroivanlopez.com/pedro_ivan_lopez_vcard.vcf'

zip

Zip directories

zip -r $zipf name00* name01*

List zip file contents

unzip -l $zipf
vim $zipf
less $zipf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment