Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

jrnl Presentation @ March 2015 GTALUG Meeting

255 views

Published on

This is the presentation I did at March 2015's GTALUG meeting on the Python command line journal application jrnl.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

jrnl Presentation @ March 2015 GTALUG Meeting

  1. 1. jrnlA journal in your command line. Myles Braithwaite | myles.coffee | me@myles.coffee 1
  2. 2. My ~programming~ notebooks are filled with random journal entries. It's all the same. I can look back on old ~programming~ notebooks, and know exactly what was going on in my ~professional~ life. -- Paraphrasing Sarah Silverman Myles Braithwaite | myles.coffee | me@myles.coffee 2
  3. 3. Dear diary: Today I was pompous and my sister was crazy. Today we were kidnapped by hill folk, never to be seen again. It was the best day ever. Myles Braithwaite | myles.coffee | me@myles.coffee 3
  4. 4. Myles Braithwaite | myles.coffee | me@myles.coffee 4
  5. 5. Who actually has time to write paragraphs of text? Myles Braithwaite | myles.coffee | me@myles.coffee 5
  6. 6. Myles Braithwaite | myles.coffee | me@myles.coffee 6
  7. 7. Calm down neckbeards The finger protocol's .project and .plan files predates Twitter. $ finger me@myles.coffee Login: myles Name: Myles Braithwaite Directory: /home/myles Shell: /bin/bash Office Phone +1 (647) 555-1234 On since Wed Mar 10 20:57 (EST) on pts/0 from batgirl.mylesbraithwaite.net 6 seconds idle No mail. Project: Troll the subreddit of /r/conspiracy. Plan: World domination. Office Hours: Monday 9am - 11am Tuesday 11am - 1pm Wednesday 1pm - 3pm Thursday 9am - 11am Friday 3pm - 5pm Myles Braithwaite | myles.coffee | me@myles.coffee 7
  8. 8. $ jrnl # Will launch in your $EDITOR. $ jrnl "I am doing a short talk at @GTALUG on jrnl." [Journal created at /home/myles/BTSync/Journal/journal.txt] [Entry added to default journal] $ cat $JOURNAL_FILE 2015-03-10 20:30 I am doing a short talk @GTALUG on jrnl. Myles Braithwaite | myles.coffee | me@myles.coffee 8
  9. 9. $ jrnl yesterday 1pm: "I started phase three of my @WorldDomination plan." [Entry added to default journal] $ cat $JOURNAL_FILE 2015-03-09 13:00 I started phase three of my @WorldDomination plan. 2015-03-10 20:30 I am doing a short talk @GTALUG on jrnl. Myles Braithwaite | myles.coffee | me@myles.coffee 9
  10. 10. $ jrnl yesterday 2pm: "Had some issue with phase three of @WorldDomination. Apperently the sharkes don't come pre-trained." [Entry added to default journal] —The yesterday 2pm will be interpreted as a time stamp —The first sentense (everything before .?!: marks) will be interpreted as the title. —The rest will be the body. Myles Braithwaite | myles.coffee | me@myles.coffee 10
  11. 11. $ jrnl < text-document.txt Myles Braithwaite | myles.coffee | me@myles.coffee 11
  12. 12. $ jrnl *: Phase three of the @WorldDomination plan has successed. We used dophones instead of sharkes. [Entry added to default journal] Myles Braithwaite | myles.coffee | me@myles.coffee 12
  13. 13. $ jrnl -starred 2015-03-10 14:32 Phase three of the @WorldDomination plan has successed. | We used dophones instead of sharkes. Myles Braithwaite | myles.coffee | me@myles.coffee 13
  14. 14. jrnl -1 --edit Myles Braithwaite | myles.coffee | me@myles.coffee 14
  15. 15. $ jrnl -n 3 2015-03-10 14:32 Phase three of the @WorldDomination plan has successed. | We used dophones instead of sharkes. 2015-03-10 16:00 Had my afternoon expresso @Coffee. 2015-03-10 20:30 I am doing a short talk @GTALUG on jrnl. Myles Braithwaite | myles.coffee | me@myles.coffee 15
  16. 16. $ jrnl -on 2015-02-25 2015-02-25 09:54 Started working on my @GTALUG presentation on jrnl. Myles Braithwaite | myles.coffee | me@myles.coffee 16
  17. 17. $ jrnl --tags @coffee : 4 @worlddomination : 3 @gtalug : 2 Myles Braithwaite | myles.coffee | me@myles.coffee 17
  18. 18. $ jrnl @gtalug 2015-02-25 09:54 Started working on my @GTALUG presentation on jrnl. 2015-03-10 20:30 I am doing a short talk @GTALUG on jrnl. Myles Braithwaite | myles.coffee | me@myles.coffee 18
  19. 19. $ jrnl @coffee -n 1 2015-03-10 16:00 Had my afternoon expresso @Coffee. Myles Braithwaite | myles.coffee | me@myles.coffee 19
  20. 20. { "journals": { "default": "~/BTSync/Journal/journal.txt", "work": { "journal": "~/BTSync/Journal/work.txt", "encrypt": true } } } Myles Braithwaite | myles.coffee | me@myles.coffee 20
  21. 21. $ jrnl work at 9am: Had a meeting with @Steve about that electric car project. Managment does not want to go though with it. $ jrnl work -n 3 Myles Braithwaite | myles.coffee | me@myles.coffee 21
  22. 22. Cross Platform Myles Braithwaite | myles.coffee | me@myles.coffee 22
  23. 23. SyncMyles Braithwaite | myles.coffee | me@myles.coffee 23
  24. 24. Encryption Myles Braithwaite | myles.coffee | me@myles.coffee 24
  25. 25. import hashlib, Crypto.Cipher key = hashlib.sha256(my_password).digest() with open("journal.txt", "r+") as f: cipher = f.read() crypto = AES.new(key, AES.MODE_CBC, iv=cipher[:16]) plain = crypto.decrypt(cipher[16:]) plain = plain.strip(plain[-1]) plain = plain.decode("utf-8") f.write(plain) f.truncate() Myles Braithwaite | myles.coffee | me@myles.coffee 25
  26. 26. If you're typing the letters A-E-S into your code, you're doing it wrong. —http://www.cs.berkeley.edu/~daw/teaching/ cs261-f12/misc/if.html Myles Braithwaite | myles.coffee | me@myles.coffee 26
  27. 27. How to install $ [sudo] aptitude install python-pip python-crypto $ [sudo] pip install jrnl Myles Braithwaite | myles.coffee | me@myles.coffee 27
  28. 28. Write your own #!/bin/bash DATE=`date +"%Y-%m-%d %H:%M"` read printf "$DATE $REPLYnn" >> "journal.txt" Myles Braithwaite | myles.coffee | me@myles.coffee 28
  29. 29. —Web: myles.coffee —Email: me@myles.coffee —Twitter: @mylesb Myles Braithwaite | myles.coffee | me@myles.coffee 29
  30. 30. To the extent possible under law, Myles Braithwaite has waived all copyright and related or neighboring rights to jrnl - A journal in your command line. This work is published from: Canada. Myles Braithwaite | myles.coffee | me@myles.coffee 30
  31. 31. You can view the source for this presentation at https://github.com/myles/2015-03-10-jrnl. Myles Braithwaite | myles.coffee | me@myles.coffee 31
  32. 32. Myles Braithwaite | myles.coffee | me@myles.coffee 32

×