alias notes='cat >> ~/notes'
(echo && date && cat) >> ~/notes.txt
C-d remains constant, but it's irritating that there's no way to consistently abort.
To deal with this our edit target needs to be a temporary file which we subsequently bless, append to the notes file and then trash.
Keeping notes open in an editor buffer that I can jump to easily, and manually:
From the command line gains me all the utility I need while using a modern machine and zsh.
Of course, if I time travel, the GP trick is useful on old ultrix machines.
I prefer it over echoing into a file because it has more advanced display features - such as by date - and topics (hashtags [don't forget to escape the hash!], or @tags)
Got the journal files stored in Dropbox so they're everywhere I am
Mainly because I figured would rather use GUI for notes on both desktop and mobile. Maybe one of these days I should give Standard Notes a try (https://standardnotes.org). It’s OSS and client side encrypted (afaik).
The way I have jrnl configured is that the "work" keyword makes it log to work.txt as opposed to my default log.txt
I also have a "todo" which I've configured as a relative path ./todo.txt so I can drop todos into the current directory/project
I have a feeling it's going to be my gateway into more heavy LaTeX usage for all manner of documents. The ability to evaluate code during document generation is a big deal to me.
echo "`date +%s`\t$1" >> ~/org/unsorted-notes.org
mkdir -p ~/Dropbox/scratch/$(date +"%Y-%m-%d")
vim ~/Dropbox/scratch/$(date +"%Y-%m-%d")/$(date +"%Y-%m-%d-%H-%M-%S")
What I've been doing (for the last 25 years or so) is simple. I always keep a window open, visible in all virtual desktops, on the bottom right of my screen, with: vi ~/notes/notes
For somewhat less than the last 25 years, ~/notes is an encrypted git repo. I have a cron that, minutely, adds, commits, pulls and pushes to a couple of my servers on the Internet.
I generally have one of these for each company I work for, and another one that I've used for all things personal.
For the encrypted git repo, I use this:
The cron points to a shell script:
git add -A .
git commit -am wip
So with that, I have the same directory, ~/notes/ syncd on all of my computers automatically, as long as I don't do conflicting edits within the space of a minute, which has never happened.
Does this get annoying if you want to commit something specific? Let's say you edit an old note and save the file. Then, in the time it takes for you to write a commit about this new edit, your cron script has added your change as a 'wip'.
Also, is there a nice way to set this up with a cron script so that you can use git via ssh (rather than https) but still keep a passphrase on the key? I seem to remember having problems with cron and git regarding ssh keys.
I never do manual commits here; every single commit is always 'wip'. I'm basically not using that feature of git. I'm just using it for (dumb) history/backup and distribution.
I always setup the git repos with ssh, not https. The central (for each environment) git repo is a bare checkout on my personal account on a linode or tektonic VPS.
In short, since I can ssh from my various client machines to these central servers with no password, the git pull/push just works.
just as fast and you can actually edit when needed.
$ ed ~/.todo
this is a new bloat
this is a new note
$ cat ~/.todo
this is a new note
$ ed ~/.todo
this is another note.
it goes across more lines.
I prefer other approach.
Everytime I get to know some new switch for a command, or new use for them, or even a new command, I create ~/man/command file with examples and commends inside, like ~/man/tar or ~/man/gstat or ~/man/xorg.conf.
This way its already organized and you can grep -r 'something' ~/man for the thing you need.
The extension just suggests to some tools that they should treat the text as markdown.
ls -lh ./*-2017-*.log
cat >> ~/notes
does the same thing.
But at least at $THE_OFFICE, I'm lucky that there's a trivial-to-recover ~/.snapshot/hourly.?/notes file. YMMV.
Would give you some rudimentary readline editing capability.
if [ "$1" == "" ]; then
echo $@ >> $HOME/notes.md
- 'notes' by itself views the file (interactive shell only)
- 'notes' with args, the args are appended to file (original function)
- 'notes' with heredoc (or any piped data) allows for multiline notes
if [ -n "$1" ]; then
echo $@ >> "$HOME/notes.md"
# detect if we're in a tty or a pipe
if [ -t 0 ]; then
cat - >> "$HOME/notes.md"
$ notes 1
$ notes 1 2 3
$ notes <<EOF
> this is a
> multiline note
$ uptime | notes
(opens less with the following content)
1 2 3
this is a
23:22:06 up 3 days, 11:41, 1 user, load average: 0.25, 0.15, 0.26
printf '%s\n' "$*"
notes -n is a bad flag to pass to some commands
Take a look at https://news.ycombinator.com/item?id=14126006
I also add a few aliases to make it even quicker:
alias mcr='mplan create'
alias msh='mplan show'
alias mrm='mplan remove'
alias mclear='mplan remove \*'
Direct link: https://github.com/jad-issa/mplan-sh. Why post a link to a 6-months years-old HN submission with no comments?
It allows the editing of notes for a given day, listing of all notes, and display of a note for a given day, defaulting to today if no date is provided.
I keep meaning to add support for RCS or some other form of basic version control, but it's never been that much of an issue.
I'm a small scale sysadmin, SSHing into multiple servers configured by my predecessors. I'd love to be able to some command | notes.txt or whatever.
And no, I don't have my home directory mounted at all locations the same way. I even need to login as different user for different machines.
The command factor is my Mac and Terminal.app
You could adjust it so that it uses a central notes store on one ssh host pretty easily with something like:
echo $1 | ssh user@remotehost "cat >> ~/notes.md"
ssh user@remotehost "cat ~/notes.md" | more
Kindly email me bugs, not pull requests.
You can read about my method here:
mkdir ~/.worklog || true
if [ -z "$1" ]; then
cat ~/.worklog/$(date +%w).md
echo "$(date): $*" >> ~/.worklog/$(date +%w).md
$ worklog "I did some stuff"
$ worklog [shows the output]
$ logger hello
$ logger <<EOF
> this is a multiline
> logging message
$ sudo journalctl -t vacri
-- Logs begin at Fri 2017-09-29 10:40:49 AEST, end at Mon 2017-10-02 23:44:13 AEDT
Oct 02 23:40:24 myhost vacri: hello
Oct 02 23:48:48 myhost vacri: this is a multiline
Oct 02 23:48:48 myhost vacri: logging message