• Stars
    star
    115
  • Rank 295,225 (Top 6 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A zero dependency shell script that makes it really simple to manage your text notes.

Notes CI

A zero dependency POSIX compliant shell script that makes it really simple to manage your text notes.

Instead of trying to impose a whole bunch of rules and syntax requirements, this tool does its best to get out of your way.

It tries to do everything possible so that if you're working in a terminal, you can save whatever text you want into a file. This could come from typing a sentence out, pasting something from your clipboard or saving the output of a program.

Demo Video

Demo video

Updates to the notes script since this video

  • v0.2.0 scopes the notes files per month instead of per day. This differs from what's in the video at the 4:00 mark.
  • v0.1.0 matches exactly what's in this video.

Design Goals and Philosophy

I've been keeping track of my notes in plain text files since 2001. I always felt like when it comes to jotting down notes it was always best to do everything possible to keep friction low.

That means not worrying about specific file types, formatting, tagging, check boxes, syntax rules and a bunch of other things that delay you from getting something out of your head and into a document.

Text is amazing for notes because:

  • You can use grep and friends to search through it later
  • Even with notes dating back from 2001, I'm only using 1.5mb of disk space
  • It's really easy to back up and sync to other devices using Drop Box or similar tools

Since it's unstructured text you can use this tool for whatever type of note taking you want. You can keep track of general thoughts, create a diary or make plan files similar to what John Carmack did for a number of years.

I personally use it as a scattered brain dump. Even with things being very unstructured (and even untagged) I can usually grep out anything I want within a few seconds.

Your notes are organized by auto-dated files

Let's say it's December 25th, 2019. If you were to run notes hello world it would create a 2019-12.txt file in your NOTES_DIRECTORY (this is something you can configure). It would then append hello world to the end of the file.

If you run notes something else on the next day it will still append to the same file and continue appending to that file until the next months hits. For example, on January 1st 2020 any notes commands will append to a 2020-01.txt file.

There's other things you can do such as piping input to it, or running the script without any arguments to open the file in your configured EDITOR but let's first go over installing it before we get to that.

What is this script not good for?

Depending on how you work, it's probably not ideal for grouping up a bunch of extended thoughts about a specific topic.

For example, if you were planning to write a book and you spent 3 months gathering info about what you're writing about then you would end up with a bunch of isolated date formatted files that was mixed in with everything else.

In those cases, I recommend you make a new script called book which basically does what this script does except it always dumps everything to 1 specific file of your choosing which isn't dated. That's what I do to help plan my video courses.

Installation

Copy / paste the line below, or if you don't like this pattern of installing scripts then feel free to run things manually.

1 liner to get notes downloaded to /usr/local/bin:

sudo curl \
  -L https://raw.githubusercontent.com/nickjj/notes/master/notes \
  -o /usr/local/bin/notes && sudo chmod +x /usr/local/bin/notes

You can also choose to replace master with a specific release tag if you want to grab a specific version.

There's no fancy git clone instructions because you may end up modifying at least 1 line of the script. Plus since the script is so simple, this repo is likely not going to change and if it does you will be able to diff it without any issues.

Configuration

By default it will use ${HOME}/notes as your notes directory and if that directory doesn't exist beforehand, this script will allow you to create it with a y/n prompt when you first run the program.

You can also customize your notes path in 1 of 2 ways:

  1. Put export NOTES_DIRECTORY="/tmp/foo" in your ~/.profile or equivalent file (/tmp/foo would be your notes path)
  2. Directly edit the notes script and replace ${HOME}/notes with /tmp/foo in the NOTES_DIRECTORY variable

Also, if you want this script to open your notes in your code editor you'll want to make sure you have your EDITOR defined in your ~/.profile too. This is a Unix standard. For example, mine looks like export EDITOR="vim".

If you change your ~/.profile, don't forget to log out / login.

Usage Examples

There's 3 ways of using this script:

  • notes something you want to jot down

    • Appends whatever arguments you add as text into the dated file
  • xclip -o | notes

    • Pipes and appends anything (in this case your clipboard's contents) into the dated file
  • notes

    • Opens the dated file in your configured EDITOR

That's really all there is to it. With the above 3 ways of adding notes you'll find yourself adding all sorts of different types of notes with very little friction. I encourage you to check out just how short the source code is.

If you wanted to go all out, you could even create custom key binds in your code editor that would take the selected text and append it to your notes by running one of the above commands. Since everything is text you have a lot of flexibility!

Also, you have the power of the command line at your finger tips to manipulate these files however you see fit. For example you can run cat 2019-*.txt > 2019.txt to create a yearly file.

About the Author

I'm a self taught developer and have been freelancing for the last ~20 years. You can read about everything I've learned along the way on my site at https://nickjanetakis.com. There's hundreds of blog posts and a couple of video courses on web development and deployment topics. I also have a podcast where I talk to folks about running web apps in production.

More Repositories

1

docker-django-example

A production ready example Django app that's using Docker and Docker Compose.
Python
1,071
star
2

build-a-saas-app-with-flask

Learn how to build a production ready web app with Flask and Docker.
HTML
918
star
3

dotfiles

Settings for various tools I use.
CSS
910
star
4

docker-rails-example

A production ready example Rails app that's using Docker and Docker Compose.
Ruby
856
star
5

ansible-docker

Install / Configure Docker and Docker Compose using Ansible.
Python
730
star
6

orats

Opinionated rails application templates.
Ruby
669
star
7

docker-flask-example

A production ready example Flask app that's using Docker and Docker Compose.
Python
513
star
8

ansigenome

A tool to help you gather information and manage your Ansible roles.
Python
444
star
9

flask-webpack

A Flask extension to manage assets with Webpack.
Python
338
star
10

rolespec

A test library for testing Ansible roles
Shell
232
star
11

docker-web-framework-examples

Example apps that demonstate how to use Docker with your favorite web frameworks.
Elixir
216
star
12

docker-node-example

An example Node / Express app that's using Docker and Docker Compose.
Shell
194
star
13

docker-phoenix-example

A production ready example Phoenix app that's using Docker and Docker Compose.
Elixir
192
star
14

flask-static-digest

Flask extension to help make your static files production ready by md5 tagging and gzipping them.
Python
150
star
15

manifest-revision-webpack-plugin

Write out a manifest file containing your versioned webpack chunks and assets.
JavaScript
124
star
16

ansible-nginx

Install and configure nginx (SSL A+ by default) with Ansible.
Jinja
73
star
17

flask-db

A Flask CLI extension to help migrate and manage your SQL database.
Python
73
star
18

ansible-acme-sh

Install and auto-renew SSL certificates with Let's Encrypt using acme.sh.
64
star
19

wait-until

A zero dependency Bash script that waits until a command of your choosing has run successfully.
Shell
55
star
20

ansible-user

Create and configure a user for SSH key based logins and passwordless sudo.
48
star
21

webserver

A zero dependency Python 3 web server to echo back an HTTP request's headers and data.
Python
48
star
22

dockercon21-docker-best-practices

Reference links for my live demo talk from DockerCon 21.
47
star
23

ansible-fail2ban

Install and configure fail2ban using ansible.
46
star
24

runninginproduction.com

The website for the Running in Production podcast.
HTML
41
star
25

esbuild-copy-static-files

An esbuild plugin to copy static files that changed from a source directory to a destination directory.
Shell
34
star
26

flask-pg-extras

A Flask extension to obtain useful information from your PostgreSQL database.
Python
33
star
27

ansible-swapfile

Create and configure a swap file with Ansible.
32
star
28

ansible-letsencrypt

Install and auto-renew SSL certificates with Let's Encrypt and Ansible.
Python
29
star
29

nyhackr-cli-dev-env

Reference notes for the Creating a Command Line Driven Development Environment talk.
18
star
30

ansible-playbooks

A collection of ansible playbooks with end to end examples.
Shell
18
star
31

ansible-rails

Deploy a rails application using git with ansible.
Ruby
18
star
32

invoice

Calculate a billable amount, hours and days logged for 1 or more projects.
Shell
17
star
33

gowatcher

Reload a specified go program automatically by monitoring a directory.
Shell
16
star
34

docker-community-all-hands

Reference links to every talk I've given for the Docker Community All-Hands events.
15
star
35

deploy-web-apps-with-docker

Rescue yourself from the complexity of DevOps
Dockerfile
15
star
36

sublime-text-3-packages

A list of my Sublime Text 3 packages along with their settings.
Python
14
star
37

verdiff

A CLI tool to diff 2 versions of a Phoenix, Rails, Django or Laravel generated project.
Python
13
star
38

title-case-converter

A CLI tool to capitalize words based on industry standard style guides.
Python
13
star
39

flask-secrets

A Flask CLI extension to generate random secret tokens.
Python
13
star
40

ansible-sshd

Install and configure openssh-server using Ansible.
13
star
41

ansible-security

Configure ssh and ufw as well as install fail2ban with ansible.
12
star
42

gemshine

Recursively compare a ruby project's gem versions to their latest versions.
Ruby
12
star
43

ansible-iptables

Configure iptables using Ansible.
12
star
44

lcurl

Visit a site every X seconds in a loop to help detect downtime while testing deployment strategies.
Shell
11
star
45

latest-releases

A command line tool that lets you keep tabs on the latest releases of your favorite tools and libraries.
Shell
11
star
46

demo-for-chattanooga-python-user-group

A demo app for a talk I gave at the Chattanooga python user group.
JavaScript
10
star
47

ansible-monit

Install monit and configure as many processes as you want with ansible.
8
star
48

passify

A small utility to create a password and wrap bcrypt.
JavaScript
8
star
49

pick-random-youtube-comments

Get a list of top level comments from a YouTube video and then pick N amount of unique comment authors by choosing them randomly.
Python
8
star
50

ansible-bootstrap

Configure a server to run Ansible and install essential packages.
6
star
51

ansible-postgres

Install a bare bones version of postgres with ansible.
5
star
52

ansible-pumacorn

Manage a puma or unicorn rails process with init.d using ansible.
Ruby
5
star
53

docker-faye

A docker image for running a secure Faye (websocket) server.
JavaScript
5
star
54

ansible-ferm

Manage iptables with ferm using ansible.
4
star
55

ansible-nodejs

Install the latest stable version of nodejs with ansible.
4
star
56

ansible-mariadb

Install and configure MariaDB using Ansible.
4
star
57

ansible-sendy

Copy and configure Sendy with Ansible.
C
3
star
58

ansible-locale

Install and configure your system's locale using ansible
3
star
59

ansible-phpfpm

Install and configure php-fpm using Ansible.
2
star
60

ansible-dnsmasq

Install and configure dnsmasq to map a TLD to localhost using ansible.
2
star
61

docker-play-example

A production ready example Play app that's using Docker and Docker Compose.
1
star