Skip to content

Instantly share code, notes, and snippets.

View valo's full-sized avatar
👷‍♂️
buidling

Valentin Mihov valo

👷‍♂️
buidling
View GitHub Profile
@valo
valo / gist:49c1b07985c95953f94279329f50fa26
Last active March 5, 2023 18:16 — forked from krisnod/gist:56ff894f400cce7c742fb11fb2fde9cf
RancherOS on Hetzner using software RAID (RAID 1)
Install:
----------
* Activate Hetzner Rescue System (Debian)
* Connect to Hetzner Rescue System using SSH and live boot RancherOS
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/)
* apt-get update
* apt-get install kexec-tools aria2
@valo
valo / README.md
Last active May 30, 2018 06:59 — forked from skanev/README.md

Hacky syntax highlighting in git diff

Normally git diff would color additions green and deletions red. This is cool, but it would be even cooler if it adds syntax highlighting to those lines. This is a git pager that does so.

It parses the diff output and picks up the SHAs of files with additions and deletions. It uses [CodeRay][coderay] to highlight each file and then it extracts the lines that are shown in the diff. It then uses [term/ansicolor][color] to make a gradient from the CodeRay color and the diff color (red for deletion, green for addition) and uses it to replace the original.

I tried using rugged instead of shelling out to git show – it was faster overall, but it did incur a noticeable start up time.

Check out the image below for a demo.