forked from jstraub/homepage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
209 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
layout: single | ||
title: computer minimalism | ||
header: | ||
image: blog/minimalism.jpg | ||
--- | ||
|
||
Lately I have been thinking a lot about minimalism, how to incorporate | ||
more of it into my life and where it is already present. | ||
|
||
The way I use my computer has been trending towards more and more | ||
minimalistic ever since I started graduate school. My usage is tailored | ||
to coding, writing and editing text, email and research on the | ||
Internet. The corner stones of my minimalist computer usage are: | ||
|
||
* awesome wm desktop manager for linux | ||
* vim for all text editing (like really all of it - even email) | ||
* mutt for email | ||
* tmux for running and testing code (tmux-vim integration) | ||
* fzf fuzzy finder to eliminate the need for retyping commands or paths | ||
|
||
Currently I am using linux with the Awesome WM desktop environment. It | ||
is a minimalist automatically tiling desktop manager. That means I | ||
dont have to arrange windows to be visible. Ever. It automatically | ||
arranges windows to fill all available screen space according to some | ||
tiling scheme, that can easily be changed. | ||
This eliminates all the overhead of having to align, resize and make | ||
visible whatever window you are working on currently. It also always | ||
automatically means I am always using 100% of the available pixels of | ||
my monitor. This means I can productively and comfortably work on the | ||
12.1'' (!?? TODO) monitor of my beloved X220 Thinkpad or a single 24'' | ||
rotated screen at work. | ||
|
||
I love vim. It embodies minimalism for text editing and coding. Using | ||
plugins it can be adapted and extended to do anything you would want to | ||
do with text. I mostly use [YouCompleteMe](), vim-tmux integration, and | ||
[Run external command thing]. | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
layout: single | ||
title: stop retyping commands | ||
header: | ||
image: blog/fzf.png | ||
--- | ||
|
||
Stop retyping the same commands over and over again! Let's make our | ||
computers do some work for us and put some of those GBs of storage and | ||
compute power to good use. If, like me, you use the shell a lot this will | ||
literally save some chunk of your life. The setup I describe in the | ||
following now also serves as a kind of long term memory for how to use a | ||
certain command or program. I can just search back through all my | ||
previous commands and quickly refresh my memory if I forgot. | ||
|
||
You might already know the `Ctrl-R` command to search backward through | ||
the history of commands you have typed. If not try it. It is magical. | ||
The problem is that those searches have to exactly match parts of the command | ||
you are looking for and you can only see the latest command matching | ||
your search. In short the default `Ctrl-R` is not very user friendly. | ||
|
||
There are way better tools for searching through large text files such | ||
as your bash history. The one I personally use is | ||
[fzf](https://github.com/junegunn/fzf) since it is light weight and fast | ||
and integrates well with vim and tmux (more about that some other time). | ||
If you only ever use a single terminal at a time just install fzf and | ||
start using the new and amazing `Ctrl-R`: fzf performs [fuzzy | ||
matching](https://en.wikipedia.org/wiki/Approximate_string_matching) of | ||
the string you enter against your history or text file and it displays | ||
a sorted list of the best matching strings which is updated in real-time | ||
as you type your search. | ||
|
||
It gets more interesting if you have multiple terminals open at the | ||
same time (maybe via tmux). In that case the command history fragments | ||
and you cannot search a command you typed into one shell in another | ||
one. Additionally, commands are lost whenever you close a shell while | ||
another one still exists. | ||
|
||
To circumvent this we are going to log every command you enter. Simply | ||
add the following line to your `.bashrc`: | ||
``` | ||
export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log;' | ||
``` | ||
|
||
Bash executes the command in its `PROMPT_COMMAND` variable right after you hit | ||
enter to execute. The if statement makes sure | ||
you are not root, and then logs the time, folder and the command into a log | ||
file in your home directory `~/.logs/`. Make sure to create that directory. | ||
An additional advantage of using this command logging system is that | ||
you could easily share the commands between computers. | ||
|
||
Now we just need to configure fzf to search through all files in the | ||
`~/.logs` folder to find commands similar to whatever you are typing. | ||
To do replace all occurrences of the command `history` in your fzf config file | ||
`~/.fzf.bash` with: | ||
``` | ||
cat ~/.logs/* | cut -f 1,6- --delimiter=\" \" | ||
``` | ||
|
||
Now you should be able to use `Ctrl-R` with fzf across terminals and | ||
bash sessions. Enjoy! | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2"> | ||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | ||
<rdf:Description rdf:about="" | ||
xmlns:xmp="http://ns.adobe.com/xap/1.0/" | ||
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" | ||
xmlns:exif="http://ns.adobe.com/exif/1.0/" | ||
xmlns:darktable="http://darktable.sf.net/" | ||
xmp:Rating="1" | ||
xmpMM:DerivedFrom="minimalism.jpg" | ||
exif:GPSLongitude="71,6.012667W" | ||
exif:GPSLatitude="42,21.989833N" | ||
exif:GPSAltitudeRef="0" | ||
exif:GPSAltitude="37/10" | ||
darktable:xmp_version="1" | ||
darktable:raw_params="0" | ||
darktable:auto_presets_applied="1" | ||
darktable:history_end="4"> | ||
<darktable:mask_id> | ||
<rdf:Seq/> | ||
</darktable:mask_id> | ||
<darktable:mask_type> | ||
<rdf:Seq/> | ||
</darktable:mask_type> | ||
<darktable:mask_name> | ||
<rdf:Seq/> | ||
</darktable:mask_name> | ||
<darktable:mask_version> | ||
<rdf:Seq/> | ||
</darktable:mask_version> | ||
<darktable:mask> | ||
<rdf:Seq/> | ||
</darktable:mask> | ||
<darktable:mask_nb> | ||
<rdf:Seq/> | ||
</darktable:mask_nb> | ||
<darktable:mask_src> | ||
<rdf:Seq/> | ||
</darktable:mask_src> | ||
<darktable:history_modversion> | ||
<rdf:Seq> | ||
<rdf:li>2</rdf:li> | ||
<rdf:li>4</rdf:li> | ||
<rdf:li>1</rdf:li> | ||
<rdf:li>5</rdf:li> | ||
</rdf:Seq> | ||
</darktable:history_modversion> | ||
<darktable:history_enabled> | ||
<rdf:Seq> | ||
<rdf:li>1</rdf:li> | ||
<rdf:li>1</rdf:li> | ||
<rdf:li>1</rdf:li> | ||
<rdf:li>1</rdf:li> | ||
</rdf:Seq> | ||
</darktable:history_enabled> | ||
<darktable:history_operation> | ||
<rdf:Seq> | ||
<rdf:li>flip</rdf:li> | ||
<rdf:li>tonecurve</rdf:li> | ||
<rdf:li>colisa</rdf:li> | ||
<rdf:li>clipping</rdf:li> | ||
</rdf:Seq> | ||
</darktable:history_operation> | ||
<darktable:history_params> | ||
<rdf:Seq> | ||
<rdf:li>ffffffff</rdf:li> | ||
<rdf:li>gz08eJxjYICAYJ9YuyPldXZNxx/Zhf7ksj9TZG6fY5JsH3I/wZ6BoQELpjuwh+ABs58QGJTuYwNiZihmQsKMUHkQDQABNRPB</rdf:li> | ||
<rdf:li>000000000000000000000000</rdf:li> | ||
<rdf:li>0000000000000033144c753e0000803f0000803f0000000000000000cdcc4c3ecdcc4c3ecdcc4c3fcdcc4c3ecdcc4c3fcdcc4c3fcdcc4c3ecdcc4c3f000000000000000000000000010000000000000000000000</rdf:li> | ||
</rdf:Seq> | ||
</darktable:history_params> | ||
<darktable:blendop_params> | ||
<rdf:Seq> | ||
<rdf:li>gz12eJxjYGBgkGAAgRNODESDBnsIHll8ANNSGQM=</rdf:li> | ||
<rdf:li>gz12eJxjYGBgkGAAgRNODESDBnsIHll8ANNSGQM=</rdf:li> | ||
<rdf:li>gz12eJxjYGBgkGAAgRNODESDBnsIHll8ANNSGQM=</rdf:li> | ||
<rdf:li>gz12eJxjYGBgkGAAgRNODESDBnsIHll8ANNSGQM=</rdf:li> | ||
</rdf:Seq> | ||
</darktable:blendop_params> | ||
<darktable:blendop_version> | ||
<rdf:Seq> | ||
<rdf:li>7</rdf:li> | ||
<rdf:li>7</rdf:li> | ||
<rdf:li>7</rdf:li> | ||
<rdf:li>7</rdf:li> | ||
</rdf:Seq> | ||
</darktable:blendop_version> | ||
<darktable:multi_priority> | ||
<rdf:Seq> | ||
<rdf:li>0</rdf:li> | ||
<rdf:li>0</rdf:li> | ||
<rdf:li>0</rdf:li> | ||
<rdf:li>0</rdf:li> | ||
</rdf:Seq> | ||
</darktable:multi_priority> | ||
<darktable:multi_name> | ||
<rdf:Seq> | ||
<rdf:li/> | ||
<rdf:li/> | ||
<rdf:li/> | ||
<rdf:li/> | ||
</rdf:Seq> | ||
</darktable:multi_name> | ||
</rdf:Description> | ||
</rdf:RDF> | ||
</x:xmpmeta> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
jekyll build | ||
rsync -ruv _site/* lebkuchen.csail.mit.edu:~/public_html/ | ||
rsync -ruv _site/* flan.csail.mit.edu:~/public_html/ | ||
|