├── src ├── assets │ ├── ouch.jpg │ ├── books.jpg │ ├── cover_cut.jpg │ ├── PinkPad_top.jpg │ ├── PinkPad_wide.jpg │ ├── arch_icing.jpg │ ├── customtheme.png │ ├── customtheme2.png │ ├── customtheme3.png │ ├── customtheme4.png │ ├── fuzix_pico.jpg │ ├── themecreator.png │ ├── keyboard_spray.jpg │ ├── pinkpad_middle.png │ ├── pinkpad_sloth.jpg │ ├── pinkpad_update.jpg │ ├── schlaub+�rchen.jpg │ ├── themecreator-2.png │ ├── linux_and_cookies.jpg │ ├── pinkpad_display.png │ ├── pinkpad_keyboard.jpg │ ├── pinkpad_keyboard.png │ ├── pinkpad_manicure.jpg │ ├── pinkpad_mutilated.jpg │ ├── pinkpad_neofetch.jpg │ ├── PinkPad_front_close.jpg │ ├── PinkPad_hail_satan.jpg │ ├── linux_cookies_close.jpg │ ├── linux_cookies_color.jpg │ ├── naked_linux_cookies.jpg │ ├── pinkpad_intestines.jpg │ ├── linux_cookie_cutters.jpg │ ├── linux_ready_for_baking.jpg │ ├── pinkpad_manicure_evolution.jpg │ └── vtech_lern_und_musik_laptop.jpg ├── index.org ├── disclaimer.org ├── archive.org ├── posts │ ├── favorite_books │ │ └── index.org │ ├── fuzix_on_pico │ │ └── index.org │ ├── first_post │ │ └── index.org │ ├── changes_in_blogging_setup │ │ └── index.org │ ├── emacs_themes │ │ └── index.org │ ├── linux_cookies │ │ └── index.org │ └── PinkPad │ │ └── index.org ├── about.org └── css │ └── style.css ├── website ├── assets │ ├── books.jpg │ ├── ouch.jpg │ ├── arch_icing.jpg │ ├── cover_cut.jpg │ ├── fuzix_pico.jpg │ ├── PinkPad_top.jpg │ ├── PinkPad_wide.jpg │ ├── customtheme.png │ ├── customtheme2.png │ ├── customtheme3.png │ ├── customtheme4.png │ ├── pinkpad_sloth.jpg │ ├── themecreator.png │ ├── keyboard_spray.jpg │ ├── pinkpad_display.png │ ├── pinkpad_middle.png │ ├── pinkpad_update.jpg │ ├── schlaub+�rchen.jpg │ ├── themecreator-2.png │ ├── PinkPad_hail_satan.jpg │ ├── linux_and_cookies.jpg │ ├── pinkpad_intestines.jpg │ ├── pinkpad_keyboard.jpg │ ├── pinkpad_keyboard.png │ ├── pinkpad_manicure.jpg │ ├── pinkpad_mutilated.jpg │ ├── pinkpad_neofetch.jpg │ ├── PinkPad_front_close.jpg │ ├── linux_cookie_cutters.jpg │ ├── linux_cookies_close.jpg │ ├── linux_cookies_color.jpg │ ├── naked_linux_cookies.jpg │ ├── linux_ready_for_baking.jpg │ ├── pinkpad_manicure_evolution.jpg │ └── vtech_lern_und_musik_laptop.jpg ├── index.html ├── disclaimer.html ├── archive.html ├── about.html ├── posts │ ├── favorite_books │ │ └── index.html │ ├── fuzix_on_pico │ │ └── index.html │ ├── first_post │ │ └── index.html │ ├── changes_in_blogging_setup │ │ └── index.html │ └── emacs_themes │ │ └── index.html └── css │ └── style.css └── blog.el /src/assets/ouch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/ouch.jpg -------------------------------------------------------------------------------- /src/assets/books.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/books.jpg -------------------------------------------------------------------------------- /src/assets/cover_cut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/cover_cut.jpg -------------------------------------------------------------------------------- /website/assets/books.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/books.jpg -------------------------------------------------------------------------------- /website/assets/ouch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/ouch.jpg -------------------------------------------------------------------------------- /src/assets/PinkPad_top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/PinkPad_top.jpg -------------------------------------------------------------------------------- /src/assets/PinkPad_wide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/PinkPad_wide.jpg -------------------------------------------------------------------------------- /src/assets/arch_icing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/arch_icing.jpg -------------------------------------------------------------------------------- /src/assets/customtheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/customtheme.png -------------------------------------------------------------------------------- /src/assets/customtheme2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/customtheme2.png -------------------------------------------------------------------------------- /src/assets/customtheme3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/customtheme3.png -------------------------------------------------------------------------------- /src/assets/customtheme4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/customtheme4.png -------------------------------------------------------------------------------- /src/assets/fuzix_pico.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/fuzix_pico.jpg -------------------------------------------------------------------------------- /src/assets/themecreator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/themecreator.png -------------------------------------------------------------------------------- /src/assets/keyboard_spray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/keyboard_spray.jpg -------------------------------------------------------------------------------- /src/assets/pinkpad_middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_middle.png -------------------------------------------------------------------------------- /src/assets/pinkpad_sloth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_sloth.jpg -------------------------------------------------------------------------------- /src/assets/pinkpad_update.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_update.jpg -------------------------------------------------------------------------------- /src/assets/schlaub+�rchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/schlaub+�rchen.jpg -------------------------------------------------------------------------------- /src/assets/themecreator-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/themecreator-2.png -------------------------------------------------------------------------------- /website/assets/arch_icing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/arch_icing.jpg -------------------------------------------------------------------------------- /website/assets/cover_cut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/cover_cut.jpg -------------------------------------------------------------------------------- /website/assets/fuzix_pico.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/fuzix_pico.jpg -------------------------------------------------------------------------------- /src/assets/linux_and_cookies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/linux_and_cookies.jpg -------------------------------------------------------------------------------- /src/assets/pinkpad_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_display.png -------------------------------------------------------------------------------- /src/assets/pinkpad_keyboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_keyboard.jpg -------------------------------------------------------------------------------- /src/assets/pinkpad_keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_keyboard.png -------------------------------------------------------------------------------- /src/assets/pinkpad_manicure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_manicure.jpg -------------------------------------------------------------------------------- /src/assets/pinkpad_mutilated.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_mutilated.jpg -------------------------------------------------------------------------------- /src/assets/pinkpad_neofetch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_neofetch.jpg -------------------------------------------------------------------------------- /website/assets/PinkPad_top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/PinkPad_top.jpg -------------------------------------------------------------------------------- /website/assets/PinkPad_wide.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/PinkPad_wide.jpg -------------------------------------------------------------------------------- /website/assets/customtheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/customtheme.png -------------------------------------------------------------------------------- /website/assets/customtheme2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/customtheme2.png -------------------------------------------------------------------------------- /website/assets/customtheme3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/customtheme3.png -------------------------------------------------------------------------------- /website/assets/customtheme4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/customtheme4.png -------------------------------------------------------------------------------- /website/assets/pinkpad_sloth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_sloth.jpg -------------------------------------------------------------------------------- /website/assets/themecreator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/themecreator.png -------------------------------------------------------------------------------- /src/assets/PinkPad_front_close.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/PinkPad_front_close.jpg -------------------------------------------------------------------------------- /src/assets/PinkPad_hail_satan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/PinkPad_hail_satan.jpg -------------------------------------------------------------------------------- /src/assets/linux_cookies_close.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/linux_cookies_close.jpg -------------------------------------------------------------------------------- /src/assets/linux_cookies_color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/linux_cookies_color.jpg -------------------------------------------------------------------------------- /src/assets/naked_linux_cookies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/naked_linux_cookies.jpg -------------------------------------------------------------------------------- /src/assets/pinkpad_intestines.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_intestines.jpg -------------------------------------------------------------------------------- /website/assets/keyboard_spray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/keyboard_spray.jpg -------------------------------------------------------------------------------- /website/assets/pinkpad_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_display.png -------------------------------------------------------------------------------- /website/assets/pinkpad_middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_middle.png -------------------------------------------------------------------------------- /website/assets/pinkpad_update.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_update.jpg -------------------------------------------------------------------------------- /website/assets/schlaub+�rchen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/schlaub+�rchen.jpg -------------------------------------------------------------------------------- /website/assets/themecreator-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/themecreator-2.png -------------------------------------------------------------------------------- /src/assets/linux_cookie_cutters.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/linux_cookie_cutters.jpg -------------------------------------------------------------------------------- /src/assets/linux_ready_for_baking.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/linux_ready_for_baking.jpg -------------------------------------------------------------------------------- /website/assets/PinkPad_hail_satan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/PinkPad_hail_satan.jpg -------------------------------------------------------------------------------- /website/assets/linux_and_cookies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/linux_and_cookies.jpg -------------------------------------------------------------------------------- /website/assets/pinkpad_intestines.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_intestines.jpg -------------------------------------------------------------------------------- /website/assets/pinkpad_keyboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_keyboard.jpg -------------------------------------------------------------------------------- /website/assets/pinkpad_keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_keyboard.png -------------------------------------------------------------------------------- /website/assets/pinkpad_manicure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_manicure.jpg -------------------------------------------------------------------------------- /website/assets/pinkpad_mutilated.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_mutilated.jpg -------------------------------------------------------------------------------- /website/assets/pinkpad_neofetch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_neofetch.jpg -------------------------------------------------------------------------------- /website/assets/PinkPad_front_close.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/PinkPad_front_close.jpg -------------------------------------------------------------------------------- /website/assets/linux_cookie_cutters.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/linux_cookie_cutters.jpg -------------------------------------------------------------------------------- /website/assets/linux_cookies_close.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/linux_cookies_close.jpg -------------------------------------------------------------------------------- /website/assets/linux_cookies_color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/linux_cookies_color.jpg -------------------------------------------------------------------------------- /website/assets/naked_linux_cookies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/naked_linux_cookies.jpg -------------------------------------------------------------------------------- /src/assets/pinkpad_manicure_evolution.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/pinkpad_manicure_evolution.jpg -------------------------------------------------------------------------------- /src/assets/vtech_lern_und_musik_laptop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/src/assets/vtech_lern_und_musik_laptop.jpg -------------------------------------------------------------------------------- /website/assets/linux_ready_for_baking.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/linux_ready_for_baking.jpg -------------------------------------------------------------------------------- /website/assets/pinkpad_manicure_evolution.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/pinkpad_manicure_evolution.jpg -------------------------------------------------------------------------------- /website/assets/vtech_lern_und_musik_laptop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ming1016/blog/main/website/assets/vtech_lern_und_musik_laptop.jpg -------------------------------------------------------------------------------- /src/index.org: -------------------------------------------------------------------------------- 1 | #+title: BitShiftCrazy 2 | 3 | 4 | * Hi and welcome to my blog :) 5 | 6 | 7 | I would tell you what kind of posts you can find here, but let's face it: 8 | I take pleasure in playing with and modifying my blogging setup 9 | (Emacs + org-mode ♥), but not so much in actually writing blog posts. 10 | 11 | So instead I'll tell you what I *plan* to write about here: 12 | 13 | - personal stuff: Linux on "unusual" devices, homemade mini laptops, 14 | blinky LED wearable stuff, terminal apps no one needs... 15 | 16 | - Emacs stuff 17 | 18 | - Linux stuff: reviews of linux distros I tried, window managers, terminal emulators... 19 | 20 | - random stuff I find on the internet and get excited about: basically the same list as "personal stuff" but 21 | made by others 22 | 23 | - cooking stuff: recipes, especially Club Mate recipes. Of course with Emacs and org-mode. 24 | 25 | - 3D printing stuff: it'll probably be something like "things you *really* shouldn't try" 26 | 27 | - Dungeons and Dragons stuff: of course with Emacs and org-mode 28 | 29 | 30 | 31 | You'll find all that stuff when you click on [[./archive.html][stuff]] (that is, *if* I can ever bring myself to write). 32 | 33 | 34 | 35 | @@html:
@@ 36 | 37 | 38 | 39 | 40 | ** Other places where you can find me 41 | 42 | *Github for this blog:* [[https://github.com/bitshiftcrazy][bitshiftcrazy]] 43 | 44 | I upload code I mention or post here there, the code for this website is also there. 45 | 46 | 47 | *BitShiftCrazy Telegram channel:* [[https://t.me/bitshiftcrazy][BitShiftCrazy]] 48 | 49 | Links I find interesting and announcement of new blog posts. 50 | If you want to add a comment to one of the posts you can do so in the Telegram 51 | group linked to the channel. 52 | 53 | 54 | *My Instagram page:* [[https://www.instagram.com/miss.molerat/][@miss.molerat]] 55 | 56 | Lots of random posts about coding, linux, Emacs with aesthetically pleasing Thinkpad pics. 57 | More personal (less interesting) stuff on my stories. 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/disclaimer.org: -------------------------------------------------------------------------------- 1 | #+title: Disclaimer 2 | 3 | * 4 | ** 5 | *** Disclaimer 6 | 7 | This disclaimer ("Disclaimer", "Agreement") is an agreement between bitshiftcrazy ("Website Operator", "us", "we" or "our") 8 | and you ("User", "you" or "your"). This Disclaimer sets forth the general guidelines, 9 | terms and conditions of your use of the bitshiftcrazy.com website and any of its products or services (collectively, "Website" or "Services"). 10 | 11 | *** Representation 12 | 13 | Any views or opinions represented in this Website are personal and belong solely to bitshiftcrazy and do not represent 14 | those of people, institutions or organizations that the owner may or may not be associated with in professional or personal 15 | capacity unless explicitly stated. Any views or opinions are not intended to malign any religion, ethnic group, club, organization, company, or individual. 16 | 17 | *** Content and postings 18 | 19 | You may print a copy of any part of this Website for your personal or non-commercial use. 20 | 21 | *** Indemnification and warranties 22 | 23 | While we have made every attempt to ensure that the information contained on the Website is correct, bitshiftcrazy is not responsible for any errors or omissions, 24 | or for the results obtained from the use of this information. All information on the Website is provided "as is", with no guarantee of completeness, accuracy, 25 | timeliness or of the results obtained from the use of this information, and without warranty of any kind, express or implied. 26 | In no event will bitshiftcrazy be liable to you or anyone else for any decision made or action taken in reliance on the information on the Website or 27 | for any consequential, special or similar damages, even if advised of the possibility of such damages. Information on the Website is for general information 28 | purposes only and is not intended to provide legal, financial, medical, or any other type of professional advice. Please seek professional assistance should you 29 | require it. Furthermore, information contained on the Website and any pages linked to and from it are subject to change at any time and without warning. 30 | 31 | We reserve the right to modify this Disclaimer relating to the Website or Services at any time, effective upon posting of an updated version 32 | of this Disclaimer on the Website. Continued use of the Website after 33 | any such changes shall constitute your consent to such changes. 34 | 35 | *** Acceptance of this disclaimer 36 | 37 | You acknowledge that you have read this Disclaimer and agree to all its terms and conditions. 38 | By accessing the Website you agree to be bound by this Disclaimer. If you do not agree to abide by the terms of this Disclaimer, 39 | you are not authorized to use or access the Website. 40 | 41 | Policy was created with https://www.WebsitePolicies.com 42 | 43 | This document was last updated on December 21, 2019 44 | -------------------------------------------------------------------------------- /website/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BitShiftCrazy 6 | 7 | 8 |
9 | 10 |

Hi and welcome to my blog :)

I would tell you what kind of posts you can find here, but let's face it: 11 | I take pleasure in playing with and modifying my blogging setup 12 | (Emacs + org-mode ♥), but not so much in actually writing blog posts. 13 |

14 | 15 |

So instead I'll tell you what I plan to write about here: 16 |

17 | 18 |
  • personal stuff: Linux on "unusual" devices, homemade mini laptops, 19 | blinky LED wearable stuff, terminal apps no one needs...
  • 20 | 21 |
  • Emacs stuff
  • 22 | 23 |
  • Linux stuff: reviews of linux distros I tried, window managers, terminal emulators...
  • 24 | 25 |
  • random stuff I find on the internet and get excited about: basically the same list as "personal stuff" but 26 | made by others
  • 27 | 28 |
  • cooking stuff: recipes, especially Club Mate recipes. Of course with Emacs and org-mode.
  • 29 | 30 |
  • 3D printing stuff: it'll probably be something like "things you really shouldn't try"
  • 31 | 32 |
  • Dungeons and Dragons stuff: of course with Emacs and org-mode
  • 33 |
34 | 35 | 36 | 37 |

You'll find all that stuff when you click on stuff (that is, if I can ever bring myself to write). 38 |

39 | 40 | 41 | 42 |


43 |

44 | 45 | 46 | 47 | 48 |

Other places where you can find me

Github for this blog: bitshiftcrazy 49 |

50 | 51 |

I upload code I mention or post here there, the code for this website is also there. 52 |

53 | 54 | 55 |

BitShiftCrazy Telegram channel: BitShiftCrazy 56 |

57 | 58 |

Links I find interesting and announcement of new blog posts. 59 | If you want to add a comment to one of the posts you can do so in the Telegram 60 | group linked to the channel. 61 |

62 | 63 | 64 |

My Instagram page: @miss.molerat 65 |

66 | 67 |

Lots of random posts about coding, linux, Emacs with aesthetically pleasing Thinkpad pics. 68 | More personal (less interesting) stuff on my stories. 69 |

70 |
Made with Emacs :) 71 |

Disclaimer 72 |

73 | 74 | -------------------------------------------------------------------------------- /src/archive.org: -------------------------------------------------------------------------------- 1 | #+TITLE: stuff 2 | 3 | #+ATTR_HTML: :class archive 4 | #+BEGIN_DIV 5 | @@html:
  • @@ @@html:@@ [22.10.2021, 10:00 CEST] @@html:@@ [[file:posts/favorite_books/index.org][My Favorite Books - Pt 1]]@@html:
    @@ On popular demand (aka 5 people asked for it) here's a list of my favorite programming books. This is part one. @@html:
    @@ @@html:
    @@ books, programming, Software Development @@html:
    @@ @@html:
    @@ @@html:
  • @@ 6 | @@html:
  • @@ @@html:@@ [21.03.2021, 12:00 CET] @@html:@@ [[file:posts/fuzix_on_pico/index.org][FUZIX on the Raspberry Pi Pico: Installing from Arch Linux]]@@html:
    @@ The Raspberry Pi Foundation recently released their first microntroller, the Pico. And while the Pico can't run Linux unfortunately, it can give you the pleasure of playing with an old-school UNIX-like system: FUZIX. @@html:
    @@ @@html:
    @@ Raspberry Pi, Raspberry Pi Pico, Arch Linux, FUZIX, UNIX @@html:
    @@ @@html:
    @@ @@html:
  • @@ 7 | @@html:
  • @@ @@html:@@ [20.12.2020, 20:00 CET] @@html:@@ [[file:posts/linux_cookies/index.org][Linux Cookies]]@@html:
    @@ I made 3D-printable models for Linux Cookie Cutters of 5 popular distros. Here are the (not entirely serious) installation instructions for the various distros as well as the cookie source code. @@html:
    @@ @@html:
    @@ linux, cookies, linux cookies, c programming, programming, ubuntu, debian, kali, arch, arch linux, gentoo, 3D printing @@html:
    @@ @@html:
    @@ @@html:
  • @@ 8 | @@html:
  • @@ @@html:@@ [18.11.2020, 20:00 CET] @@html:@@ [[file:posts/PinkPad/index.org][The PinkPad v1 2020 Lockdown Edition]]@@html:
    @@ I was always jealous about those hot little mini-laptops. So I built my own one with a Raspberry Pi and a toy laptop. @@html:
    @@ @@html:
    @@ raspberry pi, linux, arch linux, coding @@html:
    @@ @@html:
    @@ @@html:
  • @@ 9 | @@html:
  • @@ @@html:@@ [21.12.2019, 20:00 CET] @@html:@@ [[file:posts/emacs_themes/index.org][Emacs Themes]]@@html:
    @@ It's important to feel at home in your beloved editor, so this post is about creating custom themes in Emacs. @@html:
    @@ @@html:
    @@ emacs, beginner-friendly, themes @@html:
    @@ @@html:
    @@ @@html:
  • @@ 10 | @@html:
  • @@ @@html:@@ [18.11.2020, 20:00 CET] @@html:@@ [[file:posts/changes_in_blogging_setup/index.org][Changes in Blogging Setup]]@@html:
    @@ A few things bothered me in my blogging setup, here's what I changed @@html:
    @@ @@html:
    @@ emacs, org-mode, blogging, code @@html:
    @@ @@html:
    @@ @@html:
  • @@ 11 | @@html:
  • @@ @@html:@@ [27.11.2019, 20:00 CET] @@html:@@ [[file:posts/first_post/index.org][Bitshiftcrazy]]@@html:
    @@ So this is my very first attempt to write a blog. Ever. Find out why and what and how in this post. @@html:
    @@ @@html:
    @@ blog, org-mode, programming, instagram @@html:
    @@ @@html:
    @@ @@html:
  • @@ 12 | #+END_DIV 13 | -------------------------------------------------------------------------------- /website/disclaimer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Disclaimer 6 | 7 | 8 |
    9 |

    Disclaimer

    This disclaimer ("Disclaimer", "Agreement") is an agreement between bitshiftcrazy ("Website Operator", "us", "we" or "our") 10 | and you ("User", "you" or "your"). This Disclaimer sets forth the general guidelines, 11 | terms and conditions of your use of the bitshiftcrazy.com website and any of its products or services (collectively, "Website" or "Services"). 12 |

    13 | 14 |

    Representation

    Any views or opinions represented in this Website are personal and belong solely to bitshiftcrazy and do not represent 15 | those of people, institutions or organizations that the owner may or may not be associated with in professional or personal 16 | capacity unless explicitly stated. Any views or opinions are not intended to malign any religion, ethnic group, club, organization, company, or individual. 17 |

    18 | 19 |

    Content and postings

    You may print a copy of any part of this Website for your personal or non-commercial use. 20 |

    21 | 22 |

    Indemnification and warranties

    While we have made every attempt to ensure that the information contained on the Website is correct, bitshiftcrazy is not responsible for any errors or omissions, 23 | or for the results obtained from the use of this information. All information on the Website is provided "as is", with no guarantee of completeness, accuracy, 24 | timeliness or of the results obtained from the use of this information, and without warranty of any kind, express or implied. 25 | In no event will bitshiftcrazy be liable to you or anyone else for any decision made or action taken in reliance on the information on the Website or 26 | for any consequential, special or similar damages, even if advised of the possibility of such damages. Information on the Website is for general information 27 | purposes only and is not intended to provide legal, financial, medical, or any other type of professional advice. Please seek professional assistance should you 28 | require it. Furthermore, information contained on the Website and any pages linked to and from it are subject to change at any time and without warning. 29 |

    30 | 31 |

    We reserve the right to modify this Disclaimer relating to the Website or Services at any time, effective upon posting of an updated version 32 | of this Disclaimer on the Website. Continued use of the Website after 33 | any such changes shall constitute your consent to such changes. 34 |

    35 | 36 |

    Acceptance of this disclaimer

    You acknowledge that you have read this Disclaimer and agree to all its terms and conditions. 37 | By accessing the Website you agree to be bound by this Disclaimer. If you do not agree to abide by the terms of this Disclaimer, 38 | you are not authorized to use or access the Website. 39 |

    40 | 41 |

    Policy was created with //www.WebsitePolicies.com 42 |

    43 | 44 |

    This document was last updated on December 21, 2019 45 |

    46 |
    Made with Emacs :) 47 |

    Disclaimer 48 |

    49 | 50 | -------------------------------------------------------------------------------- /website/archive.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | stuff 6 | 7 | 8 |
  • [22.10.2021, 10:00 CEST] My Favorite Books - Pt 1
    On popular demand (aka 5 people asked for it) here's a list of my favorite programming books. This is part one.
    books, programming, Software Development
  • 9 |
  • [21.03.2021, 12:00 CET] FUZIX on the Raspberry Pi Pico: Installing from Arch Linux
    The Raspberry Pi Foundation recently released their first microntroller, the Pico. And while the Pico can't run Linux unfortunately, it can give you the pleasure of playing with an old-school UNIX-like system: FUZIX.
    Raspberry Pi, Raspberry Pi Pico, Arch Linux, FUZIX, UNIX
  • 10 |
  • [20.12.2020, 20:00 CET] Linux Cookies
    I made 3D-printable models for Linux Cookie Cutters of 5 popular distros. Here are the (not entirely serious) installation instructions for the various distros as well as the cookie source code.
    linux, cookies, linux cookies, c programming, programming, ubuntu, debian, kali, arch, arch linux, gentoo, 3D printing
  • 11 |
  • [18.11.2020, 20:00 CET] The PinkPad v1 2020 Lockdown Edition
    I was always jealous about those hot little mini-laptops. So I built my own one with a Raspberry Pi and a toy laptop.
    raspberry pi, linux, arch linux, coding
  • 12 |
  • [21.12.2019, 20:00 CET] Emacs Themes
    It's important to feel at home in your beloved editor, so this post is about creating custom themes in Emacs.
    emacs, beginner-friendly, themes
  • 13 |
  • [18.11.2020, 20:00 CET] Changes in Blogging Setup
    A few things bothered me in my blogging setup, here's what I changed
    emacs, org-mode, blogging, code
  • 14 |
  • [27.11.2019, 20:00 CET] Bitshiftcrazy
    So this is my very first attempt to write a blog. Ever. Find out why and what and how in this post.
    blog, org-mode, programming, instagram
  • 15 |
    16 |
    Made with Emacs :) 17 |

    Disclaimer 18 |

    19 | 20 | -------------------------------------------------------------------------------- /website/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | man kati 6 | 7 | 8 |
    9 |
    KATI(6)
    10 |
    Games Manual
    11 |
    KATI(6)
    12 |
    13 |

    NAME 14 |

    15 |
    kati - just kati... 16 | (I use Arch btw.) 17 |
    18 | 19 |

    SYNOPSIS 20 |

    21 |

    kati [OPTION]... [FILE]... 22 |

    23 | 24 | 25 |

    DESCRIPTION 26 |

    27 |
    kati is a teminal tool/game from the 90s available for Linux 28 | or BSD platforms, preferably Arch, Gentoo or OpenBSD. 29 | kati works best with Emacs, other editors cause unpredictable and 30 | most likely undesired behaviour. 31 | Although kati is device-independent best results are achieved on 32 | Thinkpads. 33 | kati can also be used outdoor, mainly to explore abandoned buildings 34 |
    35 |

    -asm 36 |

    37 |
    read or write x86, 8051 or arm Assembly code. 38 |
    39 |

    -b, --bash 40 |

    41 |
    read or write Bash scripts 42 |
    43 |

    -c, --club-mate 44 |

    45 |
    activates Club Mate mode: every task gets executed 3 times faster 46 | when kati gets at least 1 bottle of Club Mate as input 47 | (execution time can be further improved with the pizza or 48 | chocolate hack. 49 |
    50 |

    -C/C++ 51 |

    52 |
    read or write C/C++ code 53 |
    54 |

    -CSS/HTML- 55 |

    56 |
    use this option only in emergencies 57 | kati is not suitable for web development 58 | you'll get results but most likely not the ones you expected 59 |
    60 |

    -DnD 61 |

    62 |
    activate Dungeons & Dragons mode: an advanced AI generates exciting 63 | and absurd (and unnecessarily brutal) campagnes for a Massive Multiplayer 64 | Tabletop Roleplay Game 65 |
    66 |

    -h, --haskell 67 |

    68 |
    read or write Haskell code 69 | side effects: can result in lectures about why everyone should use 70 | xmonad as WM 71 |
    72 |

    -l, --lisp 73 |

    74 |
    read or write Lisp code 75 | warning: can cause overheating and unpredictable overreactions 76 |
    77 |

    -p, --python 78 |

    79 |
    read or write Python code 80 |
    81 |

    -3d 82 |

    83 |
    activate 3D-printing capability 84 |
    85 |
    (Note: execution of code with kati is still buggy. 86 | In some cases it doesn't work at all, in other cases kati 87 | just takes forever to finish execution) 88 |
    89 |

    BUGS 90 |

    91 |
    plenty 92 |
    93 |

    AUTHORS 94 |

    95 |
    kati's parents 96 |
    97 |

    COPYRIGHT 98 |

    99 |
    changes and redistribution of kati are prohibited by law 100 |
    101 | 102 | 103 |
    104 |
    KATI(6)
    105 |
    Games Manual
    106 |
    KATI(6)
    107 |
    108 |
    Made with Emacs :) 109 |

    Disclaimer 110 |

    111 | 112 | -------------------------------------------------------------------------------- /src/posts/favorite_books/index.org: -------------------------------------------------------------------------------- 1 | #+setupfile: ~/.emacs.d/org-templates/level1-slim.org 2 | #+title:My Favorite Programming Books - Pt 1 3 | #+date: "<2021-10-22 Fri 10:00>" 4 | #+keywords: books, programming, Software Development 5 | #+description: On popular demand (aka 5 people asked for it) here's a list of my favorite programming books. This is part one. 6 | 7 | * My Favorite Programming Books - Pt 1 8 | #+attr_html: :class tldr 9 | #+BEGIN_DIV 10 | [TL;DR] On popular demand (aka 5 people asked for it) here's a list of my favorite programming books. The list isn't ordered, I write it just as the books come to my mind. This is part one. 11 | #+END_DIV 12 | 13 | #+BEGIN_EXPORT html 14 |
    15 | My bookshelf 16 | 17 |
    Figure 1: My very tidy bookshelf
    18 |
    19 | #+END_EXPORT 20 | 21 | 22 | ** Hacker's Delight by Henry S. Warren, Jr 23 | I'm an avid collector of bit hacks and save every code snippet I can find. Hacker's delight is a whole book about fast bit-level and low-level algorithms. The chapters don't depend on each other so you don't have to read it from cover to cover but jump into it wherever you want. Since there are lots of formulas it helps when you're not totally allergic to maths. 24 | 25 | ** Land of Lisp by Conrad Barski 26 | Full title: *Land of Lisp: Learn to Program in Lisp, One Game at a Time!*. If you ask around programmers Lisp is definitely ranked as one of scarier languages. This book does a great job in showing that Lisp isn't as scary as its reputation. I really love the gamified approach. It's worth reading even if you're not interested in Lisp, simply to see how awesome textbooks could be if every author had Conrad Barski's style of writing. 27 | 28 | 29 | ** Clean Code by Robert C. Martin 30 | Full title: *Clean Code: A Handbook of Agile Software Craftmanship*. Guess this is the one you'll find on 90% of the lists on programming books. It is definitely a good book and worth reading: it teaches how to tell apart good and bad code, about good names, functions etc. But it is in parts very Java centered. Some people I've heard also complained that many of the things in the book are common sense. From my experience I can assure you they're not ;) 31 | 32 | ** The New Turing Omnibus by Alexander K. Dewdney 33 | A book about Computer Science theory and concepts. It's a very difficult book to recommend because: a) it is definitely not a beginners book as advertised and b) it's also not in depth enough for advanced readers. Why I still like it: for me it's a refresher of university knowledge. It's a good book if you already have some Computer Science knowledge, maybe already heard some lectures about it and just need a little reminder or a different way of approaching it. Since this narrows down the audience by a lot, be careful with buying this one. 34 | 35 | ** Learn You a Haskell for Great Good! by Miran Lipovača 36 | Another great example of how textbooks should be written. Haskell is one of the languages that are treaten unfairly during most lectures. Many professors seem to put great effort into presenting this wonderful functional programming language as cryptic and boring as possible. This illustrated guide does the opposite. It's a lot fun to read and presents Haskell the way it deserves. 37 | 38 | ** How Linux Works by Brian Ward 39 | Full title: *How Linux Works: What Every Superuser Should Know*. This is usually what I recommend when I'm asked about "a book about Linux". It's a great read if you're interested in underlying technologies. It goes beyond simply using Linux to explaining how your system boots, how the kernel works, networking and much more. 40 | 41 | ** Expert C Programming: Deep C Secrets by Peter van der Linden 42 | Most people's first C book is *The C Programming Language* by Kernighan and Ritchie. This book should be your second one. It's fun to read (I guess you'll get by now what style of writing I appreciate), comes with interesting puzzles, lots of stories and anecdotes. To be fair it is not the most modern book, some things are rather historically interesting. 43 | 44 | ** Automate The Boring Stuff with Python by Al Sweigart 45 | This is what I usually recommend to Python beginners. As the title suggests it explains how to automate boring every day tasks with Python. Since it has this hands-on approach for very relatable problems and shows how to solve them with code I'd say it's perfect for programming beginners in general. 46 | -------------------------------------------------------------------------------- /src/about.org: -------------------------------------------------------------------------------- 1 | #+title: man kati 2 | #+begin_export html 3 |
    4 |
    KATI(6)
    5 |
    Games Manual
    6 |
    KATI(6)
    7 |
    8 | #+end_export 9 | *NAME* 10 | #+attr_html: :class about-indented 11 | #+BEGIN_DIV 12 | kati - just kati... 13 | (I use Arch btw.) 14 | #+END_DIV 15 | 16 | *SYNOPSIS* 17 | #+attr_html: :class about-indented 18 | *kati* [OPTION]... [FILE]... 19 | 20 | 21 | *DESCRIPTION* 22 | #+attr_html: :class about-indented 23 | #+BEGIN_DIV 24 | *kati* is a teminal tool/game from the 90s available for Linux 25 | or BSD platforms, preferably Arch, Gentoo or OpenBSD. 26 | *kati* works best with Emacs, other editors cause unpredictable and 27 | most likely undesired behaviour. 28 | Although *kati* is device-independent best results are achieved on 29 | Thinkpads. 30 | *kati* can also be used outdoor, mainly to explore abandoned buildings 31 | #+END_DIV 32 | *-asm* 33 | #+attr_html: :class about-indented-deep 34 | #+BEGIN_DIV 35 | read or write x86, 8051 or arm Assembly code. 36 | #+END_DIV 37 | *-b*, *--bash* 38 | #+attr_html: :class about-indented-deep 39 | #+BEGIN_DIV 40 | read or write Bash scripts 41 | #+END_DIV 42 | *-c*, *--club-mate* 43 | #+attr_html: :class about-indented-deep 44 | #+BEGIN_DIV 45 | activates Club Mate mode: every task gets executed 3 times faster 46 | when *kati* gets at least 1 bottle of Club Mate as input 47 | (execution time can be further improved with the *pizza* or 48 | *chocolate* hack. 49 | #+END_DIV 50 | *-C/C++* 51 | #+attr_html: :class about-indented-deep 52 | #+BEGIN_DIV 53 | read or write C/C++ code 54 | #+END_DIV 55 | *-CSS/HTML-* 56 | #+attr_html: :class about-indented-deep 57 | #+BEGIN_DIV 58 | use this option *only in emergencies* 59 | *kati* is not suitable for web development 60 | you'll get results but most likely not the ones you expected 61 | #+END_DIV 62 | *-DnD* 63 | #+attr_html: :class about-indented-deep 64 | #+BEGIN_DIV 65 | activate Dungeons & Dragons mode: an advanced AI generates exciting 66 | and absurd (and unnecessarily brutal) campagnes for a Massive Multiplayer 67 | Tabletop Roleplay Game 68 | #+END_DIV 69 | *-h*, *--haskell* 70 | #+attr_html: :class about-indented-deep 71 | #+BEGIN_DIV 72 | read or write Haskell code 73 | side effects: can result in lectures about why everyone should use 74 | xmonad as WM 75 | #+END_DIV 76 | *-l*, *--lisp* 77 | #+attr_html: :class about-indented-deep 78 | #+BEGIN_DIV 79 | read or write Lisp code 80 | warning: can cause overheating and unpredictable overreactions 81 | #+END_DIV 82 | *-p*, *--python* 83 | #+attr_html: :class about-indented-deep 84 | #+BEGIN_DIV 85 | read or write Python code 86 | #+END_DIV 87 | *-3d* 88 | #+attr_html: :class about-indented-deep 89 | #+BEGIN_DIV 90 | activate 3D-printing capability 91 | #+END_DIV 92 | #+attr_html: :class about-indented 93 | #+BEGIN_DIV 94 | (Note: execution of code with *kati* is still buggy. 95 | In some cases it doesn't work at all, in other cases *kati* 96 | just takes forever to finish execution) 97 | #+END_DIV 98 | *BUGS* 99 | #+attr_html: :class about-indented 100 | #+BEGIN_DIV 101 | plenty 102 | #+END_DIV 103 | *AUTHORS* 104 | #+attr_html: :class about-indented 105 | #+BEGIN_DIV 106 | kati's parents 107 | #+END_DIV 108 | *COPYRIGHT* 109 | #+attr_html: :class about-indented 110 | #+BEGIN_DIV 111 | changes and redistribution of *kati* are prohibited by law 112 | #+END_DIV 113 | 114 | 115 | #+begin_export html 116 |
    117 |
    KATI(6)
    118 |
    Games Manual
    119 |
    KATI(6)
    120 |
    121 | #+end_export 122 | -------------------------------------------------------------------------------- /website/posts/favorite_books/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My Favorite Programming Books - Pt 1 6 | 7 | 8 |
    9 |

    My Favorite Programming Books - Pt 1

    [TL;DR] On popular demand (aka 5 people asked for it) here's a list of my favorite programming books. The list isn't ordered, I write it just as the books come to my mind. This is part one. 10 |
    11 | 12 |
    13 | My bookshelf 14 | 15 |
    Figure 1: My very tidy bookshelf
    16 |
    17 | 18 | 19 |

    Hacker's Delight by Henry S. Warren, Jr

    I'm an avid collector of bit hacks and save every code snippet I can find. Hacker's delight is a whole book about fast bit-level and low-level algorithms. The chapters don't depend on each other so you don't have to read it from cover to cover but jump into it wherever you want. Since there are lots of formulas it helps when you're not totally allergic to maths. 20 |

    21 | 22 |

    Land of Lisp by Conrad Barski

    Full title: Land of Lisp: Learn to Program in Lisp, One Game at a Time!. If you ask around programmers Lisp is definitely ranked as one of scarier languages. This book does a great job in showing that Lisp isn't as scary as its reputation. I really love the gamified approach. It's worth reading even if you're not interested in Lisp, simply to see how awesome textbooks could be if every author had Conrad Barski's style of writing. 23 |

    24 | 25 | 26 |

    Clean Code by Robert C. Martin

    Full title: Clean Code: A Handbook of Agile Software Craftmanship. Guess this is the one you'll find on 90% of the lists on programming books. It is definitely a good book and worth reading: it teaches how to tell apart good and bad code, about good names, functions etc. But it is in parts very Java centered. Some people I've heard also complained that many of the things in the book are common sense. From my experience I can assure you they're not ;) 27 |

    28 | 29 |

    The New Turing Omnibus by Alexander K. Dewdney

    A book about Computer Science theory and concepts. It's a very difficult book to recommend because: a) it is definitely not a beginners book as advertised and b) it's also not in depth enough for advanced readers. Why I still like it: for me it's a refresher of university knowledge. It's a good book if you already have some Computer Science knowledge, maybe already heard some lectures about it and just need a little reminder or a different way of approaching it. Since this narrows down the audience by a lot, be careful with buying this one. 30 |

    31 | 32 |

    Learn You a Haskell for Great Good! by Miran Lipovača

    Another great example of how textbooks should be written. Haskell is one of the languages that are treaten unfairly during most lectures. Many professors seem to put great effort into presenting this wonderful functional programming language as cryptic and boring as possible. This illustrated guide does the opposite. It's a lot fun to read and presents Haskell the way it deserves. 33 |

    34 | 35 |

    How Linux Works by Brian Ward

    Full title: How Linux Works: What Every Superuser Should Know. This is usually what I recommend when I'm asked about "a book about Linux". It's a great read if you're interested in underlying technologies. It goes beyond simply using Linux to explaining how your system boots, how the kernel works, networking and much more. 36 |

    37 | 38 |

    Expert C Programming: Deep C Secrets by Peter van der Linden

    Most people's first C book is The C Programming Language by Kernighan and Ritchie. This book should be your second one. It's fun to read (I guess you'll get by now what style of writing I appreciate), comes with interesting puzzles, lots of stories and anecdotes. To be fair it is not the most modern book, some things are rather historically interesting. 39 |

    40 | 41 |

    Automate The Boring Stuff with Python by Al Sweigart

    This is what I usually recommend to Python beginners. As the title suggests it explains how to automate boring every day tasks with Python. Since it has this hands-on approach for very relatable problems and shows how to solve them with code I'd say it's perfect for programming beginners in general. 42 |

    43 |
    Made with Emacs :) 44 |

    Disclaimer 45 |

    46 | 47 | -------------------------------------------------------------------------------- /blog.el: -------------------------------------------------------------------------------- 1 | (require 'org) 2 | (require 'ox-publish) 3 | (require 'ox-html) 4 | (require 'org-element) 5 | (require 'ox-slimhtml) 6 | 7 | (setq org-link-file-path-type 'relative) 8 | (setq org-html-htmlize-output-type 'css) 9 | 10 | (defvar my-org-blog-head 11 | (concat 12 | "" 13 | "" 14 | "")) 15 | 16 | (defvar my-org-preamble 17 | (concat 18 | "" 24 | "
    ")) 25 | 26 | (defvar my-org-postamble 27 | (concat 28 | "
    " 29 | "Made with Emacs :)\n" 30 | "

    " 31 | " Disclaimer \n" 32 | "

    " 33 | "
    ")) 34 | 35 | (defun my-ox-slimhtml-publish-to-html (plist filename pub-dir) 36 | "Publish a file to html. 37 | PLIST is the property list, FILENAME the name of 38 | the published file, PUB-DIR the publishing directory." 39 | (let ((file-path (ox-slimhtml-publish-to-html plist filename pub-dir))) 40 | (with-current-buffer (find-file-noselect file-path) 41 | (goto-char (point-min)) 42 | (search-forward "") 43 | (insert (mapconcat 'identity 44 | '("" 45 | "
    ") 46 | "\n")) 47 | (goto-char (point-max)) 48 | (search-backward "") 49 | (insert "
    ") 50 | (save-buffer) 51 | (kill-buffer)) 52 | file-path)) 53 | 54 | (defun my-org-publish-get-date-from-keyword (file project) 55 | "Get date keyword from FILE in PROJECT and parse it to internal format." 56 | (let ((date (org-publish-find-property file :date project))) 57 | (cond ((let ((ts (and (consp date) (assq 'timestamp date)))) 58 | (and ts 59 | (let ((value (org-element-interpret-data ts))) 60 | (and (org-string-nw-p value) 61 | (org-time-string-to-time value)))))) 62 | (t (error "No timestamp in file \"%s\"" file))))) 63 | 64 | (defun my-org-blog-sitemap-format-entry (entry _style project) 65 | "Return format string for each ENTRY in PROJECT." 66 | (if (and (s-starts-with? "posts/" entry) (not (equal "disclaimer.org" (file-name-nondirectory entry)))) 67 | (format "@@html:@@ %s @@html:@@ [[file:%s][%s]]@@html:
    @@ %s @@html:
    @@ @@html:
    @@ %s @@html:
    @@ @@html:
    @@" 68 | (format-time-string "[%d.%m.%Y, %R %Z]" 69 | (my-org-publish-get-date-from-keyword entry project)) 70 | entry 71 | (org-publish-find-title entry project) 72 | (org-publish-find-property entry :description project 'html) 73 | (org-publish-find-property entry :keywords project 'html)))) 74 | 75 | (defun my-org-blog-sitemap-function (title list) 76 | "Return sitemap using TITLE and LIST returned by `my-org-blog-sitemap-format-entry'." 77 | (concat "#+TITLE: " title "\n\n" 78 | "#+ATTR_HTML: :class archive\n" 79 | "#+BEGIN_DIV\n" 80 | (mapconcat (lambda (li) 81 | (format "@@html:
  • @@ %s @@html:
  • @@" (car li))) 82 | (seq-filter #'car (cdr list)) 83 | "\n") 84 | "\n#+END_DIV\n")) 85 | 86 | 87 | (setq org-publish-project-alist 88 | `(("pages" 89 | :base-directory "src/" 90 | :exclude ".*drafts/.*" 91 | :html-doctype "html5" 92 | :html-head ,my-org-blog-head 93 | :html-postamble ,my-org-postamble 94 | :html-preamble ,my-org-preamble 95 | :publishing-directory "website/" 96 | :publishing-function my-ox-slimhtml-publish-to-html 97 | :recursive t 98 | 99 | ;; sitemap 100 | :auto-sitemap t 101 | :sitemap-filename "archive.org" 102 | :sitemap-format-entry my-org-blog-sitemap-format-entry 103 | :sitemap-function my-org-blog-sitemap-function 104 | :sitemap-style list 105 | :sitemap-title "stuff" 106 | :sitemap-sort-files anti-chronologically) 107 | 108 | ("posts" 109 | :base-directory "src/posts/" 110 | :exclude ".*drafts/.*" 111 | :html-doctype "html5" 112 | :html-head ,my-org-blog-head 113 | :html-postamble ,my-org-postamble 114 | :html-preamble ,my-org-preamble 115 | :publishing-directory "website/posts" 116 | :publishing-function my-ox-slimhtml-publish-to-html 117 | :recursive t) 118 | 119 | ("assets" 120 | :base-directory "src/" 121 | :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf" 122 | :exclude ".*drafts/.*" 123 | :publishing-directory "website/" 124 | :publishing-function org-publish-attachment 125 | :recursive t) 126 | 127 | ("blog" :components ("pages" "posts" "assets")))) 128 | 129 | -------------------------------------------------------------------------------- /src/posts/fuzix_on_pico/index.org: -------------------------------------------------------------------------------- 1 | #+setupfile: ~/.emacs.d/org-templates/level1-slim.org 2 | #+title: FUZIX on the Raspberry Pi Pico: Installing from Arch Linux 3 | #+date: "<2021-03-21 Sun 12:00>" 4 | #+keywords: Raspberry Pi, Raspberry Pi Pico, Arch Linux, FUZIX, UNIX 5 | #+description: The Raspberry Pi Foundation recently released their first microntroller, the Pico. And while the Pico can't run Linux unfortunately, it can give you the pleasure of playing with an old-school UNIX-like system: FUZIX. 6 | 7 | * FUZIX on the Raspberry Pi Pico: Installing from Arch Linux 8 | #+attr_html: :class tldr 9 | #+BEGIN_DIV 10 | [TL;DR] The Raspberry Pi Foundation recently released their first microntroller, the Pico. 11 | And while the Pico can't run Linux unfortunately, it can give you the pleasure of playing with 12 | an old-school UNIX-like system: FUZIX. This post quickly summarizes how to get FUZIX onto the Pico from 13 | Arch Linux. 14 | #+END_DIV 15 | 16 | #+BEGIN_EXPORT html 17 |
    18 | FUZIX on the Pico 19 | 20 |
    Figure 1: FUZIX on the Pico together with some of the most important system tools
    21 |
    22 | #+END_EXPORT 23 | 24 | ** Why? 25 | 26 | If you're unsure why you would want to waste your precious time with installing an old-school UNIX-clone on 27 | a dual-core Cortex M0+ and 264KB RAM beast, let me convince you with my flawless reasoning: 28 | 29 | *1. Why not?* 30 | 31 | *2. Because we can.* 32 | 33 | *3. And as someone suffering from Obsessive Compulsive UNIX-itis: every device needs UNIX because it needs UNIX.* 34 | 35 | ** How? 36 | 37 | Shortly after the Pico's release, David Given ported FUZIX to it, you'll find details [[http://cowlark.com/2021-02-16-fuzix-pi-pico/][here]]. 38 | And Alasdair Allan wrote an excellent guide on getting FUZIX onto the Pico [[https://www.raspberrypi.org/blog/how-to-get-started-with-fuzix-on-raspberry-pi-pico/][here]]. 39 | 40 | So this blog post is just a quick summary of the necessary steps when installing from Arch Linux. 41 | 42 | /(= basically the steps that differ a bit from the guide/datasheet)/ 43 | 44 | You know, to save you the 15min you'd need to look for and read through the respective Arch Wiki entries yourself... 45 | 46 | *** 1. Set up the C/C++ SDK 47 | 48 | Assuming you build FUZIX from source, you'll need a working Pico toolchain. 49 | 50 | The first steps are identical to the description in the [[https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf][Pico Datasheet]] in section 2.: 51 | 52 | Create a folder for your Pico stuff, in that folder clone the [[https://github.com/raspberrypi/pico-sdk.git][Pico SDK repo]] and the [[https://github.com/raspberrypi/pico-examples.git][examples]]. 53 | 54 | Next install the toolchain: you'll need cmake as build system and the GNU 55 | Embedded Toolchain for arm. 56 | 57 | #+BEGIN_SRC shell 58 | sudo pacman -S cmake arm-none-eabi-gcc arm-none-eabi-newlib base-devel 59 | #+END_SRC 60 | 61 | /(Pretty sure you already have base-devel, but just in case ;))/ 62 | 63 | You can test whether or not everything is setup properly by building the 64 | Blink example (see [[https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf][Pico Datasheet]] for detailed build instructions). 65 | 66 | To load it onto the Pico from the command line: 67 | 68 | Connect your Pico to your computer via USB cable (hold the BOOTSEL button while doing so), 69 | get its file path for example with 70 | 71 | #+BEGIN_SRC shell 72 | lsblk 73 | #+END_SRC 74 | 75 | (and then identifying the Pico either by its size or by unplugging and re-plugging 76 | and comparing the output) 77 | 78 | or with 79 | 80 | #+BEGIN_SRC shell 81 | dmesg | tail 82 | #+END_SRC 83 | 84 | Create a mountpoint for the pico, mount it and copy blink.uf2 onto the Pico, 85 | unmount it when you're done: 86 | 87 | #+BEGIN_SRC shell 88 | sudo mkdir /mnt/pico 89 | sudo mount /dev/wherever_your_pico_is /mnt/pico 90 | sudo cp blink.uf2 /mnt/pico 91 | sudo sync 92 | sudo umount /mnt/pico 93 | #+END_SRC 94 | 95 | *** 2. Get FUZIX onto the Pico 96 | 97 | From now on you can happily follow the steps from [[https://www.raspberrypi.org/blog/how-to-get-started-with-fuzix-on-raspberry-pi-pico/][Alasdair Allan's blog post]], until 98 | you reach the /"connecting via UART"/ part: 99 | 100 | You can choose from a number of options to make a connection, I used /minicom/: 101 | 102 | #+BEGIN_SRC shell 103 | sudo pacman -S minicom 104 | #+END_SRC 105 | 106 | To be able to make a connection without being /root/ you'll have to add 107 | your user to the /uucp/ group: 108 | 109 | #+BEGIN_SRC shell 110 | sudo gpasswd -a your_username uucp 111 | #+END_SRC 112 | 113 | Plug in your Pico and your USB UART connector and find your Pico again as previously 114 | described with /dmesg | tail/. 115 | 116 | In my case it's /dev/ttyUSB0/, so fire up /minicom/ with baudrate 115200: 117 | 118 | #+BEGIN_SRC shell 119 | minicom -b 115200 -o -D /dev/ttyUSB0 120 | #+END_SRC 121 | 122 | /(Have a look at the [[https://wiki.archlinux.org/index.php/working_with_the_serial_console][Arch Linux wiki]] for more information)/ 123 | 124 | Unplug and plug your Pico to see the FUZIX startup message. 125 | 126 | Then type CTRL-A O to open the minicom settings, navigate to /Serial port setup/ and disable 127 | /Hardware Flow Control/. 128 | 129 | You're now able to type commands. Set the date and time, use /root/ without password to login 130 | and enjoy ;) 131 | 132 | /(The most important part of the system can be found under /usr/games)/ 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /website/posts/fuzix_on_pico/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FUZIX on the Raspberry Pi Pico: Installing from Arch Linux 6 | 7 | 8 |
    9 |

    FUZIX on the Raspberry Pi Pico: Installing from Arch Linux

    [TL;DR] The Raspberry Pi Foundation recently released their first microntroller, the Pico. 10 | And while the Pico can't run Linux unfortunately, it can give you the pleasure of playing with 11 | an old-school UNIX-like system: FUZIX. This post quickly summarizes how to get FUZIX onto the Pico from 12 | Arch Linux. 13 |
    14 | 15 |
    16 | FUZIX on the Pico 17 | 18 |
    Figure 1: FUZIX on the Pico together with some of the most important system tools
    19 |
    20 | 21 |

    Why?

    If you're unsure why you would want to waste your precious time with installing an old-school UNIX-clone on 22 | a dual-core Cortex M0+ and 264KB RAM beast, let me convince you with my flawless reasoning: 23 |

    24 | 25 |

    1. Why not? 26 |

    27 | 28 |

    2. Because we can. 29 |

    30 | 31 |

    3. And as someone suffering from Obsessive Compulsive UNIX-itis: every device needs UNIX because it needs UNIX. 32 |

    33 | 34 |

    How?

    Shortly after the Pico's release, David Given ported FUZIX to it, you'll find details here. 35 | And Alasdair Allan wrote an excellent guide on getting FUZIX onto the Pico here. 36 |

    37 | 38 |

    So this blog post is just a quick summary of the necessary steps when installing from Arch Linux. 39 |

    40 | 41 |

    (= basically the steps that differ a bit from the guide/datasheet) 42 |

    43 | 44 |

    You know, to save you the 15min you'd need to look for and read through the respective Arch Wiki entries yourself... 45 |

    46 | 47 |

    1. Set up the C/C++ SDK

    Assuming you build FUZIX from source, you'll need a working Pico toolchain. 48 |

    49 | 50 |

    The first steps are identical to the description in the Pico Datasheet in section 2.: 51 |

    52 | 53 |

    Create a folder for your Pico stuff, in that folder clone the Pico SDK repo and the examples. 54 |

    55 | 56 |

    Next install the toolchain: you'll need cmake as build system and the GNU 57 | Embedded Toolchain for arm. 58 |

    59 | 60 |
    sudo pacman -S cmake arm-none-eabi-gcc arm-none-eabi-newlib base-devel
     61 | 
    62 | 63 |

    (Pretty sure you already have base-devel, but just in case ;)) 64 |

    65 | 66 |

    You can test whether or not everything is setup properly eg. by building the 67 | Blink example (see Pico Datasheet for detailed build instructions). 68 |

    69 | 70 |

    To load it onto the Pico from the command line: 71 |

    72 | 73 |

    Connect your Pico to your computer via USB cable (hold the BOOTSEL button while doing so), 74 | get its file path for example with 75 |

    76 | 77 |
    lsblk
     78 | 
    79 | 80 |

    (and then identifying the Pico either by its size or by unplugging and re-plugging 81 | and comparing the output) 82 |

    83 | 84 |

    or with 85 |

    86 | 87 |
    dmesg | tail
     88 | 
    89 | 90 |

    Create a mountpoint for the pico, mount it and copy blink.uf2 onto the Pico, 91 | unmount it when you're done: 92 |

    93 | 94 |
    sudo mkdir /mnt/pico
     95 | sudo mount /dev/wherever_your_pico_is /mnt/pico
     96 | sudo cp blink.uf2 /mnt/pico
     97 | sudo sync
     98 | sudo umount /mnt/pico
     99 | 
    100 | 101 |

    2. Get FUZIX onto the Pico

    From now on you can happily follow the steps from Alasdair Allan's blog post, until 102 | you reach the "connecting via UART" part: 103 |

    104 | 105 |

    You can choose from a number of options to make a connection, I used minicom: 106 |

    107 | 108 |
    sudo pacman -S minicom
    109 | 
    110 | 111 |

    To be able to make a connection without being root you'll have to add 112 | your user to the uucp group: 113 |

    114 | 115 |
    sudo gpasswd -a your_username uucp
    116 | 
    117 | 118 |

    Plug in your Pico and your USB UART connector and find your Pico again as previously 119 | described with dmesg | tail. 120 |

    121 | 122 |

    In my case it's dev/ttyUSB0, so fire up minicom with baudrate 115200: 123 |

    124 | 125 |
    minicom -b 115200 -o -D /dev/ttyUSB0
    126 | 
    127 | 128 |

    (Have a look at the Arch Linux wiki for more information) 129 |

    130 | 131 |

    Unplug and plug your Pico to see the FUZIX startup message. 132 |

    133 | 134 |

    Then type CTRL-A O to open the minicom settings, navigate to Serial port setup and disable 135 | Hardware Flow Control. 136 |

    137 | 138 |

    You're now able to type commands. Set the date and time, use root without password to login 139 | and enjoy ;) 140 |

    141 | 142 |

    (The most important part of the system can be found under /usr/games) 143 |

    144 |
    Made with Emacs :) 145 |

    Disclaimer 146 |

    147 | 148 | -------------------------------------------------------------------------------- /src/css/style.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-family: Hack, Courier New, Courier, monospace; 3 | } 4 | 5 | html,body { 6 | width: 100%; 7 | height: 100%; 8 | margin: 0px; 9 | padding: 0px; 10 | overflow-x: hidden; 11 | } 12 | 13 | :root { 14 | /* Light mode */ 15 | --light-switch-text: "dark mode"; 16 | --light-text: #273136; 17 | --light-bg: #e3e5e6; 18 | 19 | /* navbar colors */ 20 | --light-navbar-bg: #8e989c; 21 | --light-navbar-text-color: #f0f2f5; 22 | 23 | /* heading colors */ 24 | --light-h1: #2f4761; 25 | --light-h2: #334961; 26 | --light-h3: #384c61; 27 | --light-h4: #3e4f61; 28 | 29 | /* tldr colors */ 30 | --light-tldr-bg: #c1c6c9; 31 | --light-tldr-text-color: #384247; 32 | 33 | /* keywords color */ 34 | --light-keyword-color: #a0a8ad; 35 | 36 | /* syntax highlighting */ 37 | --light-comment-color: #80888c; 38 | 39 | /* Dark mode */ 40 | --dark-switch-text: "light mode"; 41 | --dark-text: #95b1be; 42 | --dark-bg: #14191a; 43 | 44 | /* navbar colors */ 45 | --dark-navbar-bg: #555; 46 | --dark-navbar-text-color: #a5c2c1; 47 | 48 | /* heading colors */ 49 | --dark-h1: #42ada6; 50 | --dark-h2: #07b8ae; 51 | --dark-h3: #69ced4; 52 | --dark-h4: #48aeb6; 53 | 54 | /* tldr colors */ 55 | --dark-tldr-bg: #1d2426; 56 | --dark-tldr-text-color: #95d1be; 57 | 58 | /* keywords color */ 59 | --dark-keyword-color: #2d353a; 60 | 61 | /* syntax highlighting */ 62 | --dark-comment-color: #3f4a52; 63 | 64 | /* Default mode */ 65 | --switch-text: var(--dark-switch-text); 66 | --text-color: var(--dark-text); 67 | --bg-color: var(--dark-bg); 68 | --theme-color: var(--dark-theme); 69 | 70 | /* navbar colors */ 71 | --navbar-bg: var(--dark-navbar-bg); 72 | --navbar-text-color: var(--dark-navbar-text-color); 73 | 74 | /* heading colors */ 75 | --h1-color: var(--dark-h1); 76 | --h2-color: var(--dark-h2); 77 | --h3-color: var(--dark-h3); 78 | --h4-color: var(--dark-h4); 79 | 80 | /* tldr colors */ 81 | --tldr-bg: var(--dark-tldr-bg); 82 | --tldr-text-color: var(--dark-tldr-text-color); 83 | 84 | /* keywords color */ 85 | --keyword-color: var(--dark-keyword-color); 86 | 87 | /* syntax highlighting */ 88 | --comment-color: var(--dark-comment-color); 89 | } 90 | 91 | #page { 92 | margin: auto; 93 | background: var(--bg-color); 94 | color: var(--text-color); 95 | min-height: 100%; 96 | transition: color 0.2s, background-color 0.2s; 97 | } 98 | 99 | /* Switched mode */ 100 | .theme-switch:checked ~ #page { 101 | --switch-text: var(--light-switch-text); 102 | --text-color: var(--light-text); 103 | --bg-color: var(--light-bg); 104 | --theme-color: var(--light-theme); 105 | 106 | /* navbar colors */ 107 | --navbar-bg: var(--light-navbar-bg); 108 | --navbar-text-color: var(--light-navbar-text-color); 109 | 110 | /* heading colors */ 111 | --h1-color: var(--light-h1); 112 | --h2-color: var(--light-h2); 113 | --h3-color: var(--light-h3); 114 | --h4-color: var(--light-h4); 115 | 116 | /* tldr colors */ 117 | --tldr-bg: var(--light-tldr-bg); 118 | --tldr-text-color: var(--light-tldr-text-color); 119 | 120 | /* keywords color */ 121 | --keyword-color: var(--light-keyword-color); 122 | 123 | /* syntax highlighting */ 124 | --comment-color: var(--light-comment-color); 125 | } 126 | 127 | /* Theme switcher */ 128 | .theme-switch { /* Hides the checkbox */ 129 | clip: rect(1px, 1px, 1px, 1px); 130 | height: 1px; 131 | overflow: hidden; 132 | position: absolute !important; 133 | width: 1px; 134 | } 135 | 136 | .switch-label { 137 | cursor: pointer; 138 | } 139 | 140 | .switch-label::before { 141 | align-self: center; 142 | transition: text-shadow 0.2s; 143 | } 144 | 145 | .switch-label::after { 146 | align-self: center; 147 | content: var(--switch-text); 148 | opacity: 0; 149 | } 150 | 151 | .theme-switch:focus ~ #page .switch-label::before, 152 | .switch-label::before { 153 | text-shadow: 0 0 15px var(--switch-shadow-color); 154 | } 155 | 156 | .theme-switch:focus ~ #page .switch-label::after, 157 | .switch-label::after { 158 | opacity: 1; 159 | } 160 | 161 | /* Styling */ 162 | html, 163 | body { 164 | font-size: 14px; 165 | height: 100%; 166 | margin: 0; 167 | } 168 | 169 | a { 170 | color: var(--theme-color); 171 | } 172 | 173 | .navbar a { 174 | color: var(--navbar-text-color); 175 | font-size: 16px; 176 | padding: 2px 12px 2px 12px; 177 | text-align: center; 178 | text-decoration: none; 179 | } 180 | 181 | .navbar { 182 | background: var(--navbar-bg); 183 | overflow: hidden; 184 | position: sticky; 185 | text-align: center; 186 | top: 0; 187 | width: 100%; 188 | } 189 | 190 | #content { 191 | margin: auto; 192 | max-width: 80ch; 193 | padding: 2ch; 194 | } 195 | 196 | h1, 197 | h2 { 198 | margin-top: 2%; 199 | } 200 | 201 | h1 { 202 | color: var(--h1-color); 203 | font-size: 22px; 204 | } 205 | 206 | h2 { 207 | color: var(--h2-color); 208 | font-size: 18px; 209 | } 210 | 211 | h3, 212 | h4 { 213 | font-size: 16px; 214 | } 215 | 216 | h3 { 217 | margin-top: 1%; 218 | color: var(--h3-color); 219 | } 220 | 221 | h4 { 222 | color: var(--h4-color); 223 | } 224 | 225 | .tldr { 226 | background: var(--tldr-bg); 227 | color: var(--tldr-text-color); 228 | } 229 | 230 | .tldr, 231 | pre { 232 | font-size: 13px; 233 | margin: auto; 234 | max-width: 700px; 235 | padding: 3%; 236 | } 237 | 238 | pre { 239 | background: var(--tldr-bg); 240 | overflow: auto; 241 | word-wrap: normal; 242 | } 243 | 244 | .figure-number { 245 | display: none; 246 | } 247 | 248 | .archive { 249 | margin-top: 2%; 250 | } 251 | 252 | .keywords { 253 | color: var(--keyword-color); 254 | font-size: x-small; 255 | font-style: italic; 256 | } 257 | 258 | .description { 259 | color: var(--text-color); 260 | } 261 | 262 | .archive-date { 263 | color: var(--h1-color); 264 | margin: 0; 265 | } 266 | 267 | #postamble { 268 | color: var(--keyword-color); 269 | text-align: center; 270 | font-size: small; 271 | padding: 3%; 272 | } 273 | 274 | hr { 275 | border: 0; 276 | border-top: 1px solid var(--keyword-color); 277 | display: block; 278 | height: 1px; 279 | margin: 1em 0; 280 | } 281 | 282 | /* code syntax highlighting */ 283 | .org-keyword, 284 | .org-warning, 285 | .org-function-name, 286 | .org-css-selector { 287 | color: var(--h1-color); 288 | } 289 | 290 | .org-string, 291 | .org-constant, 292 | .org-variable-name { 293 | color: var(--text-color); 294 | } 295 | 296 | .org-builtin { 297 | color: var(--h2-color); 298 | } 299 | 300 | .org-comment-delimiter, 301 | .org-comment, 302 | .org-doc { 303 | color: var(--comment-color); 304 | } 305 | 306 | .about-indented { 307 | margin-left: 7%; 308 | } 309 | 310 | .about-indented-deep { 311 | margin-left: 10%; 312 | } 313 | 314 | 315 | .about-column { 316 | float: left; 317 | width: 33.3%; 318 | } 319 | 320 | /* Clear floats after the columns */ 321 | .about:after { 322 | content: ""; 323 | display: table; 324 | clear: both; 325 | } 326 | 327 | img { 328 | max-width: 100%; 329 | } 330 | -------------------------------------------------------------------------------- /website/css/style.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-family: Hack, Courier New, Courier, monospace; 3 | } 4 | 5 | html,body { 6 | width: 100%; 7 | height: 100%; 8 | margin: 0px; 9 | padding: 0px; 10 | overflow-x: hidden; 11 | } 12 | 13 | :root { 14 | /* Light mode */ 15 | --light-switch-text: "dark mode"; 16 | --light-text: #273136; 17 | --light-bg: #e3e5e6; 18 | 19 | /* navbar colors */ 20 | --light-navbar-bg: #8e989c; 21 | --light-navbar-text-color: #f0f2f5; 22 | 23 | /* heading colors */ 24 | --light-h1: #2f4761; 25 | --light-h2: #334961; 26 | --light-h3: #384c61; 27 | --light-h4: #3e4f61; 28 | 29 | /* tldr colors */ 30 | --light-tldr-bg: #c1c6c9; 31 | --light-tldr-text-color: #384247; 32 | 33 | /* keywords color */ 34 | --light-keyword-color: #a0a8ad; 35 | 36 | /* syntax highlighting */ 37 | --light-comment-color: #80888c; 38 | 39 | /* Dark mode */ 40 | --dark-switch-text: "light mode"; 41 | --dark-text: #95b1be; 42 | --dark-bg: #14191a; 43 | 44 | /* navbar colors */ 45 | --dark-navbar-bg: #555; 46 | --dark-navbar-text-color: #a5c2c1; 47 | 48 | /* heading colors */ 49 | --dark-h1: #42ada6; 50 | --dark-h2: #07b8ae; 51 | --dark-h3: #69ced4; 52 | --dark-h4: #48aeb6; 53 | 54 | /* tldr colors */ 55 | --dark-tldr-bg: #1d2426; 56 | --dark-tldr-text-color: #95d1be; 57 | 58 | /* keywords color */ 59 | --dark-keyword-color: #2d353a; 60 | 61 | /* syntax highlighting */ 62 | --dark-comment-color: #3f4a52; 63 | 64 | /* Default mode */ 65 | --switch-text: var(--dark-switch-text); 66 | --text-color: var(--dark-text); 67 | --bg-color: var(--dark-bg); 68 | --theme-color: var(--dark-theme); 69 | 70 | /* navbar colors */ 71 | --navbar-bg: var(--dark-navbar-bg); 72 | --navbar-text-color: var(--dark-navbar-text-color); 73 | 74 | /* heading colors */ 75 | --h1-color: var(--dark-h1); 76 | --h2-color: var(--dark-h2); 77 | --h3-color: var(--dark-h3); 78 | --h4-color: var(--dark-h4); 79 | 80 | /* tldr colors */ 81 | --tldr-bg: var(--dark-tldr-bg); 82 | --tldr-text-color: var(--dark-tldr-text-color); 83 | 84 | /* keywords color */ 85 | --keyword-color: var(--dark-keyword-color); 86 | 87 | /* syntax highlighting */ 88 | --comment-color: var(--dark-comment-color); 89 | } 90 | 91 | #page { 92 | margin: auto; 93 | background: var(--bg-color); 94 | color: var(--text-color); 95 | min-height: 100%; 96 | transition: color 0.2s, background-color 0.2s; 97 | } 98 | 99 | /* Switched mode */ 100 | .theme-switch:checked ~ #page { 101 | --switch-text: var(--light-switch-text); 102 | --text-color: var(--light-text); 103 | --bg-color: var(--light-bg); 104 | --theme-color: var(--light-theme); 105 | 106 | /* navbar colors */ 107 | --navbar-bg: var(--light-navbar-bg); 108 | --navbar-text-color: var(--light-navbar-text-color); 109 | 110 | /* heading colors */ 111 | --h1-color: var(--light-h1); 112 | --h2-color: var(--light-h2); 113 | --h3-color: var(--light-h3); 114 | --h4-color: var(--light-h4); 115 | 116 | /* tldr colors */ 117 | --tldr-bg: var(--light-tldr-bg); 118 | --tldr-text-color: var(--light-tldr-text-color); 119 | 120 | /* keywords color */ 121 | --keyword-color: var(--light-keyword-color); 122 | 123 | /* syntax highlighting */ 124 | --comment-color: var(--light-comment-color); 125 | } 126 | 127 | /* Theme switcher */ 128 | .theme-switch { /* Hides the checkbox */ 129 | clip: rect(1px, 1px, 1px, 1px); 130 | height: 1px; 131 | overflow: hidden; 132 | position: absolute !important; 133 | width: 1px; 134 | } 135 | 136 | .switch-label { 137 | cursor: pointer; 138 | } 139 | 140 | .switch-label::before { 141 | align-self: center; 142 | transition: text-shadow 0.2s; 143 | } 144 | 145 | .switch-label::after { 146 | align-self: center; 147 | content: var(--switch-text); 148 | opacity: 0; 149 | } 150 | 151 | .theme-switch:focus ~ #page .switch-label::before, 152 | .switch-label::before { 153 | text-shadow: 0 0 15px var(--switch-shadow-color); 154 | } 155 | 156 | .theme-switch:focus ~ #page .switch-label::after, 157 | .switch-label::after { 158 | opacity: 1; 159 | } 160 | 161 | /* Styling */ 162 | html, 163 | body { 164 | font-size: 14px; 165 | height: 100%; 166 | margin: 0; 167 | } 168 | 169 | a { 170 | color: var(--theme-color); 171 | } 172 | 173 | .navbar a { 174 | color: var(--navbar-text-color); 175 | font-size: 16px; 176 | padding: 2px 12px 2px 12px; 177 | text-align: center; 178 | text-decoration: none; 179 | } 180 | 181 | .navbar { 182 | background: var(--navbar-bg); 183 | overflow: hidden; 184 | position: sticky; 185 | text-align: center; 186 | top: 0; 187 | width: 100%; 188 | } 189 | 190 | #content { 191 | margin: auto; 192 | max-width: 80ch; 193 | padding: 2ch; 194 | } 195 | 196 | h1, 197 | h2 { 198 | margin-top: 2%; 199 | } 200 | 201 | h1 { 202 | color: var(--h1-color); 203 | font-size: 22px; 204 | } 205 | 206 | h2 { 207 | color: var(--h2-color); 208 | font-size: 18px; 209 | } 210 | 211 | h3, 212 | h4 { 213 | font-size: 16px; 214 | } 215 | 216 | h3 { 217 | margin-top: 1%; 218 | color: var(--h3-color); 219 | } 220 | 221 | h4 { 222 | color: var(--h4-color); 223 | } 224 | 225 | .tldr { 226 | background: var(--tldr-bg); 227 | color: var(--tldr-text-color); 228 | } 229 | 230 | .tldr, 231 | pre { 232 | font-size: 13px; 233 | margin: auto; 234 | max-width: 700px; 235 | padding: 3%; 236 | } 237 | 238 | pre { 239 | background: var(--tldr-bg); 240 | overflow: auto; 241 | word-wrap: normal; 242 | } 243 | 244 | .figure-number { 245 | display: none; 246 | } 247 | 248 | .archive { 249 | margin-top: 2%; 250 | } 251 | 252 | .keywords { 253 | color: var(--keyword-color); 254 | font-size: x-small; 255 | font-style: italic; 256 | } 257 | 258 | .description { 259 | color: var(--text-color); 260 | } 261 | 262 | .archive-date { 263 | color: var(--h1-color); 264 | margin: 0; 265 | } 266 | 267 | #postamble { 268 | color: var(--keyword-color); 269 | text-align: center; 270 | font-size: small; 271 | padding: 3%; 272 | } 273 | 274 | hr { 275 | border: 0; 276 | border-top: 1px solid var(--keyword-color); 277 | display: block; 278 | height: 1px; 279 | margin: 1em 0; 280 | } 281 | 282 | /* code syntax highlighting */ 283 | .org-keyword, 284 | .org-warning, 285 | .org-function-name, 286 | .org-css-selector { 287 | color: var(--h1-color); 288 | } 289 | 290 | .org-string, 291 | .org-constant, 292 | .org-variable-name { 293 | color: var(--text-color); 294 | } 295 | 296 | .org-builtin { 297 | color: var(--h2-color); 298 | } 299 | 300 | .org-comment-delimiter, 301 | .org-comment, 302 | .org-doc { 303 | color: var(--comment-color); 304 | } 305 | 306 | .about-indented { 307 | margin-left: 7%; 308 | } 309 | 310 | .about-indented-deep { 311 | margin-left: 10%; 312 | } 313 | 314 | 315 | .about-column { 316 | float: left; 317 | width: 33.3%; 318 | } 319 | 320 | /* Clear floats after the columns */ 321 | .about:after { 322 | content: ""; 323 | display: table; 324 | clear: both; 325 | } 326 | 327 | img { 328 | max-width: 100%; 329 | } 330 | 331 | 332 | -------------------------------------------------------------------------------- /src/posts/first_post/index.org: -------------------------------------------------------------------------------- 1 | 2 | 3 | #+setupfile: ~/.emacs.d/org-templates/level1-slim.org 4 | #+title: Bitshiftcrazy 5 | #+date: "<2019-11-27 Sun 20:00>" 6 | #+keywords: blog, org-mode, programming, instagram 7 | #+description: So this is my very first attempt to write a blog. Ever. Find out why and what and how in this post. 8 | * Hello World! :) 9 | 10 | #+attr_html: :class tldr 11 | #+BEGIN_DIV 12 | [TL;DR] So this is my very first attempt to write a blog. Ever. Find out why 13 | and what and how in this post. Scroll right to the bottom if you came for 14 | code ;) 15 | #+END_DIV 16 | ** Why? 17 | 18 | #+begin_text 19 | I guess if anyone ever reads this then it's probably because they know my 20 | Instagram account. So the reason for this blogging experiment is one of 21 | my monthly Instagram crises. 22 | 23 | When I started using Instagram for coding content about two years ago 24 | my intention was to explain Computer Science topics in a fun and simple way, to 25 | make people without tech-background curious about tech and to find people 26 | who are as excited about nerd-stuff as I am. The idea was to provide enough 27 | information about a topic to make it possible for people to find out 28 | more about it by themselves (I mean...if they want to ;)). Because I 29 | don't have that much time in general (and because I'm already spending 30 | way too much time on Instagram, but that's a different story) I didn't want 31 | to write comprehensive guides or tutorials. 32 | 33 | But I have the following situation more and more frequently: I spend about 34 | 30min taking a shitload of awful pictures of my laptop (in exactly two different 35 | angles, that's the maximum level of my creativity), another 10min for finding 36 | that one picture that isn't too blurry, another 30min to write a caption...And 37 | then comes my favourite part: about 1h (!!!) for desperately trying to squeeze the 38 | caption I wrote before into 2,200 characters. 39 | It's ridiculous. 40 | 41 | So I thought "hey, that should be enough time to write a semi-good blog post 42 | instead" and here we are ;). 43 | 44 | (And then there are all those other social-media/Instagram issues like bots, 45 | Instagram collecting a huge amount of personal data, fake accounts, 46 | people chasing likes...but as I said, that deserves an own post) 47 | #+end_text 48 | ** What? 49 | 50 | #+begin_text 51 | The purpose of this blog is to give me (and people who read it of course ;)) all 52 | the wonderful things Instagram just can't give to me. 53 | Here are some of the things I have in mind: 54 | 1. More in-depth content: more explanation, tutorials, details, background 55 | information, resources... 56 | 2. MORE CODE: sharing code(-snippets) with explanation 57 | 3. Different topics: on Instagram I post about more or less the same stuff 58 | all the time. Some of the topics I'm interested in aren't suitable for 59 | Instagram (e.g. because even after 1h of trying I couldn't squeeze them 60 | into a caption). So I hope to post about other (more or less) 61 | tech-related topics like 3D printing, electronics and tinkering, 62 | philosophical tech stuff, "nerd fashion", books, papers, games, computer 63 | history, abandoned places...here as well. 64 | 65 | Of course I'll still post about programming, Linux, CompSci and Maths (oh how 66 | I missed maths on Instagram...;)) 67 | 4. A quiet place: Instagram is loud and chaotic and distractive (and also a bit 68 | scary from time to time). On this page I want to keep things simple, minimalist 69 | and yeah...quiet. That means less pictures, less fanciness, no bells and 70 | whistles. 71 | 5. Kati-esque: I often have the feeling that Instagram is just not like me or 72 | not right for me. Usually I'm not a social-media person (no Facebook, no 73 | Twitter, no Snapchat, no TikTok, gym, catholic church...). But 74 | for some reason I'm mutating into a every-detail-of-my-day-posting 75 | Instagram addict as soon as I open the app. So here I try to create 76 | a place that feels more like myself :) (for example I'm using the same 77 | colors as in my terminal and want to make it look like it a bit :D) 78 | 79 | So in short: this is my personal anti-Instagram :'D 80 | #+end_text 81 | ** How? 82 | 83 | #+begin_text 84 | At the moment I have a very simple setup for this website: I use Netlify for 85 | hosting and Emacs org-mode as a static website generator. 86 | My first thought was to use Hugo but because I prefer when I don't have 87 | to leave Emacs and because I'm a complete webdev-noob I decided to use 88 | org-mode only. And Netlify is nice because I can easily use it with git. 89 | 90 | For now I'm able to: 91 | - generate my project's html files from the corresponding org-files 92 | (and include that css stylesheet that took me hours to create ;)) 93 | - have a sitemap/archive for my posts (and only my posts) 94 | - have a simple navigation bar at the top of all files 95 | For the moment that's enough for me (or rather: that's all my nooby ass could 96 | accomplish on a Sunday evening ;)). In the future I'd like to add a few things, 97 | don't know what yet but I'm sure I'll notice what's missing as 98 | soon as I need it :D 99 | 100 | Setting up the org-export options for it is really easy (give that you're able 101 | and willing to read...unlike me who tried to guess what the options do first). 102 | Basically you just have to customize org-publish-alist (either in your init.el 103 | or like me in a seperate file). 104 | 105 | Here are my settings: 106 | #+end_text 107 | #+begin_text 108 | First include all the org stuff you need: 109 | #+end_text 110 | 111 | #+BEGIN_SRC emacs-lisp 112 | (require 'org) 113 | (require 'ox-publish) 114 | (require 'ox-html) 115 | (require 'org-element) 116 | #+END_SRC 117 | 118 | #+begin_text 119 | Then change org-publish-alist according to your needs. 120 | For example support for a sitemap, exclude all the unnecessary 121 | stuff org exports into an html file by default and so on. 122 | #+end_text 123 | 124 | #+BEGIN_SRC emacs-lisp 125 | (setq org-publish-project-alist 126 | `(("project-name" 127 | :base-directory "~/org-project/" 128 | :recursive t 129 | :publishing-directory "~/org-project/website" 130 | :publishing-function org-html-publish-to-html 131 | 132 | :with-toc nil 133 | :title nil 134 | :with-headline-numbers nil 135 | :with-date nil 136 | :with-title nil 137 | :time-stamp-file nil 138 | :section-numbers nil 139 | :table-of-contents nil 140 | 141 | :html-doctype "html5" 142 | :html-head-include-scripts nil 143 | :html-head-include-default-style nil 144 | :html-html5-fancy t 145 | :html-validation-link nil 146 | :html-head "" 147 | :html-preamble ,topnav 148 | :style "" 149 | 150 | ;; Sitemap settings 151 | :auto-sitemap t 152 | :sitemap-filename "archive.org" 153 | :sitemap-title "stuff" 154 | :sitemap-style list 155 | :sitemap-sort-files anti-chronologically 156 | :sitemap-format-entry org-blog-sitemap-format-entry 157 | :sitemap-function org-blog-sitemap-function 158 | ))) 159 | #+END_SRC 160 | 161 | #+begin_text 162 | And here's my top navigation bar (top because it's on the top, not because 163 | it's "top" like "very good", you know ;)): 164 | #+end_text 165 | 166 | #+BEGIN_SRC emacs-lisp 167 | (defvar topnav 168 | (concat 169 | "")) 176 | #+END_SRC 177 | 178 | #+begin_text 179 | So that's it for now. Here are some links about blogging with org-mode 180 | (because that's another thing Instagram won't let me do, share fucking links...): 181 | 182 | https://vicarie.in/posts/blogging-with-org.html 183 | 184 | https://www.john2x.com/blog/blogging-with-orgmode.html 185 | 186 | And the org-mode manual for html exporting: 187 | 188 | https://orgmode.org/ma 189 | #+end_text 190 | \\ 191 | 192 | #+begin_rss 193 | [[https://bitshiftcrazy.com/rss.xml][RSS]] 194 | #+end_rss 195 | 196 | -------------------------------------------------------------------------------- /website/posts/first_post/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bitshiftcrazy 6 | 7 | 8 |

    Hello World! :)

    [TL;DR] So this is my very first attempt to write a blog. Ever. Find out why 9 | and what and how in this post. Scroll right to the bottom if you came for 10 | code ;) 11 |
    12 |

    Why?

    I guess if anyone ever reads this then it's probably because they know my 13 | Instagram account. So the reason for this blogging experiment is one of 14 | my monthly Instagram crises. 15 | 16 |

    When I started using Instagram for coding content about two years ago 17 | my intention was to explain Computer Science topics in a fun and simple way, to 18 | make people without tech-background curious about tech and to find people 19 | who are as excited about nerd-stuff as I am. The idea was to provide enough 20 | information about a topic to make it possible for people to find out 21 | more about it by themselves (I mean...if they want to ;)). Because I 22 | don't have that much time in general (and because I'm already spending 23 | way too much time on Instagram, but that's a different story) I didn't want 24 | to write comprehensive guides or tutorials. 25 |

    26 | 27 |

    But I have the following situation more and more frequently: I spend about 28 | 30min taking a shitload of awful pictures of my laptop (in exactly two different 29 | angles, that's the maximum level of my creativity), another 10min for finding 30 | that one picture that isn't too blurry, another 30min to write a caption...And 31 | then comes my favourite part: about 1h (!!!) for desperately trying to squeeze the 32 | caption I wrote before into 2,200 characters. 33 | It's ridiculous. 34 |

    35 | 36 |

    So I thought "hey, that should be enough time to write a semi-good blog post 37 | instead" and here we are ;). 38 |

    39 | 40 |

    (And then there are all those other social-media/Instagram issues like bots, 41 | Instagram collecting a huge amount of personal data, fake accounts, 42 | people chasing likes...but as I said, that deserves an own post) 43 |

    44 |
    45 |

    What?

    The purpose of this blog is to give me (and people who read it of course ;)) all 46 | the wonderful things Instagram just can't give to me. 47 | Here are some of the things I have in mind: 48 |
    1. More in-depth content: more explanation, tutorials, details, background 49 | information, resources...
    2. 50 |
    3. MORE CODE: sharing code(-snippets) with explanation
    4. 51 |
    5. Different topics: on Instagram I post about more or less the same stuff 52 | all the time. Some of the topics I'm interested in aren't suitable for 53 | Instagram (e.g. because even after 1h of trying I couldn't squeeze them 54 | into a caption). So I hope to post about other (more or less) 55 | tech-related topics like 3D printing, electronics and tinkering, 56 | philosophical tech stuff, "nerd fashion", books, papers, games, computer 57 | history, abandoned places...here as well. 58 | 59 |

      Of course I'll still post about programming, Linux, CompSci and Maths (oh how 60 | I missed maths on Instagram...;)) 61 |

    6. 62 |
    7. A quiet place: Instagram is loud and chaotic and distractive (and also a bit 63 | scary from time to time). On this page I want to keep things simple, minimalist 64 | and yeah...quiet. That means less pictures, less fanciness, no bells and 65 | whistles.
    8. 66 |
    9. Kati-esque: I often have the feeling that Instagram is just not like me or 67 | not right for me. Usually I'm not a social-media person (no Facebook, no 68 | Twitter, no Snapchat, no TikTok, gym, catholic church...). But 69 | for some reason I'm mutating into a every-detail-of-my-day-posting 70 | Instagram addict as soon as I open the app. So here I try to create 71 | a place that feels more like myself :) (for example I'm using the same 72 | colors as in my terminal and want to make it look like it a bit :D)
    10. 73 |
    74 | 75 |

    So in short: this is my personal anti-Instagram :'D 76 |

    77 |
    78 |

    How?

    At the moment I have a very simple setup for this website: I use Netlify for 79 | hosting and Emacs org-mode as a static website generator. 80 | My first thought was to use Hugo but because I prefer when I don't have 81 | to leave Emacs and because I'm a complete webdev-noob I decided to use 82 | org-mode only. And Netlify is nice because I can easily use it with git. 83 | 84 |

    For now I'm able to: 85 |

    86 |
    • generate my project's html files from the corresponding org-files 87 | (and include that css stylesheet that took me hours to create ;))
    • 88 |
    • have a sitemap/archive for my posts (and only my posts)
    • 89 |
    • have a simple navigation bar at the top of all files
    • 90 |
    91 |

    For the moment that's enough for me (or rather: that's all my nooby ass could 92 | accomplish on a Sunday evening ;)). In the future I'd like to add a few things, 93 | don't know what yet but I'm sure I'll notice what's missing as 94 | soon as I need it :D 95 |

    96 | 97 |

    Setting up the org-export options for it is really easy (give that you're able 98 | and willing to read...unlike me who tried to guess what the options do first). 99 | Basically you just have to customize org-publish-alist (either in your init.el 100 | or like me in a seperate file). 101 |

    102 | 103 |

    Here are my settings: 104 |

    105 |
    106 | First include all the org stuff you need: 107 | 108 | 109 |
    (require 'org)
    110 | (require 'ox-publish)
    111 | (require 'ox-html)
    112 | (require 'org-element)
    113 | 
    114 | 115 | Then change org-publish-alist according to your needs. 116 | For example support for a sitemap, exclude all the unnecessary 117 | stuff org exports into an html file by default and so on. 118 | 119 | 120 |
    (setq org-publish-project-alist
    121 |       `(("project-name"
    122 |          :base-directory "~/org-project/"
    123 |          :recursive t
    124 |          :publishing-directory "~/org-project/website"
    125 |          :publishing-function org-html-publish-to-html
    126 | 
    127 |          :with-toc nil
    128 |          :title nil
    129 |          :with-headline-numbers nil
    130 |          :with-date nil
    131 |          :with-title nil
    132 |          :time-stamp-file nil
    133 |          :section-numbers nil
    134 |          :table-of-contents nil
    135 | 
    136 |          :html-doctype "html5"
    137 |          :html-head-include-scripts nil
    138 |          :html-head-include-default-style nil
    139 |          :html-html5-fancy t
    140 |          :html-validation-link nil
    141 |          :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">"
    142 |          :html-preamble ,topnav
    143 |          :style "<link rel=\"stylesheet\" type=\"text/css\" href\"style.css\">"
    144 | 
    145 |          ;; Sitemap settings
    146 |          :auto-sitemap t
    147 |          :sitemap-filename "archive.org"
    148 |          :sitemap-title "stuff"
    149 |          :sitemap-style list
    150 |          :sitemap-sort-files anti-chronologically
    151 |          :sitemap-format-entry org-blog-sitemap-format-entry
    152 |          :sitemap-function org-blog-sitemap-function
    153 |  )))
    154 | 
    155 | 156 | And here's my top navigation bar (top because it's on the top, not because 157 | it's "top" like "very good", you know ;)): 158 | 159 | 160 |
    (defvar topnav
    161 |   (concat
    162 |    "<nav>"
    163 |      "<a href=\"index.html\"> home </a>"
    164 |      "<a href=\"archive.html\"> stuff </a>"
    165 |      "<a href=\"links.html\"> links </a>"
    166 |      "<a href=\"about.html\"> about </a>"
    167 |      "<a href=\"contact.html\"> contact </a>"
    168 |      "</nav>"))
    169 | 
    170 | 171 | So that's it for now. Here are some links about blogging with org-mode 172 | (because that's another thing Instagram won't let me do, share fucking links...): 173 | 174 |

    //vicarie.in/posts/blogging-with-org.html 175 |

    176 | 177 |

    //www.john2x.com/blog/blogging-with-orgmode.html 178 |

    179 | 180 |

    And the org-mode manual for html exporting: 181 |

    182 | 183 |

    //orgmode.org/ma 184 |

    185 |
    186 |

    187 | 188 | RSS 189 | 190 |
    Made with Emacs :) 191 |

    Disclaimer 192 |

    193 | 194 | -------------------------------------------------------------------------------- /src/posts/changes_in_blogging_setup/index.org: -------------------------------------------------------------------------------- 1 | 2 | #+setupfile: ~/.emacs.d/org-templates/level1-slim.org 3 | #+title: Changes in Blogging Setup 4 | #+date: "<2020-11-18 Sun 20:00>" 5 | #+keywords: emacs, org-mode, blogging, code 6 | #+description: A few things bothered me in my blogging setup, here's what I changed 7 | * Changes in Blogging Setup 8 | #+attr_html: :class tldr 9 | #+BEGIN_DIV 10 | [TL;DR] A few things bothered me in my blogging setup, here's a summary of what I changed. 11 | And: I still have no idea about web development =¯\_(ツ)_/¯= 12 | #+END_DIV 13 | 14 | Since I published my blog for the first time about a year ago, quite a few things 15 | changed in my setup: 16 | gradually I added things I was convinced I need (for example functions to generate 17 | RSS), and soon I had a ca. 800 lines of code big elisp tumor to simply... 18 | generate a static website. 19 | 20 | So it was time for some cleaning and re-structuring: 21 | 22 | 23 | - I kicked out the RSS functions (sorry not sorry to the 3 people who asked 24 | for RSS) 25 | 26 | - I kicked out the functions to create a page with links (why did I even think 27 | that makes sense in the first place...?) 28 | 29 | - I switched to ox-slimhtml 30 | 31 | - I added a theme-switcher to switch between a light or a dark theme 32 | 33 | - some other minor changes: I changed the folder structure, changed and 34 | added some templates, changed the format of archive items 35 | 36 | And some things that won't change: 37 | 38 | 39 | - this website still doesn't use JavaScript 40 | 41 | - it's still generated with Emacs and org-mode 42 | 43 | - there's still no tracker or other stuff that would 44 | disrespect your privacy 45 | 46 | - I still have no idea about html and CSS... 47 | 48 | 49 | 50 | And here are some details about some of the changes: 51 | 52 | ** Switch themes with CSS and html only (no JavaScript) 53 | 54 | /Spoiler: Because of my lack of CSS and html knowledge (and my stubborness not 55 | to use JavaScript) this was a huge PITA./ 56 | 57 | But thanks to some great resources I found online I somehow collected the pieces 58 | I needed. And after some more research I also suceeded in putting those pieces together. 59 | 60 | 61 | So - to summarize the procedure in my own, CSS-nooby words - what I need to get 62 | what I want: 63 | 64 | - a checkbox 65 | 66 | - a CSS /:checked selector/ 67 | 68 | - the /subsequent-sibling combinator/ ~ (wtf, I call it "tilde"...) 69 | 70 | - CSS variables 71 | 72 | - lots of patience because...CSS 73 | 74 | 75 | I can really recommend Daniela's fantastic medium article: [[https://medium.com/better-programming/dark-mode-and-css-variables-ed6dc250232c][Dark Mode and CSS variables]], 76 | and [[https://alexandersandberg.com/theme-switcher/][this guide]] was also very useful! 77 | 78 | *** HTML 79 | 80 | First I needed a checkbox in the html code. I wanted the label to be part of my 81 | navbar so it looks somewhat like this now: 82 | 83 | #+BEGIN_SRC html 84 | 85 | 86 |
    87 |
    88 | 89 |
    90 | ... 91 |
    92 | 93 | #+END_SRC 94 | 95 | That's basically what [[https://alexandersandberg.com/theme-switcher/][this guide]] described. 96 | 97 | (To get org-mode/ox-slimthml to export the html code like this I modified the export- 98 | function, more about this in the next section) 99 | 100 | *** CSS 101 | 102 | And here's what the combination of /:checked/, CSS variables and the /~ sibling 103 | thing/ looks like: 104 | 105 | #+BEGIN_SRC css 106 | :root { 107 | /* Light mode */ 108 | --light-switch-text: "dark mode"; 109 | --light-text: #273136; 110 | --light-bg: #e3e5e6; 111 | 112 | ... 113 | 114 | /* Dark mode */ 115 | --dark-switch-text: "light mode"; 116 | --dark-text: #95b1be; 117 | --dark-bg: #14191a; 118 | 119 | ... 120 | 121 | /* Default mode */ 122 | --switch-text: var(--dark-switch-text); 123 | --text-color: var(--dark-text); 124 | --bg-color: var(--dark-bg); 125 | --theme-color: var(--dark-theme); 126 | 127 | ... 128 | 129 | /* Switched mode */ 130 | .theme-switch:checked ~ #page { 131 | --switch-text: var(--light-switch-text); 132 | --text-color: var(--light-text); 133 | --bg-color: var(--light-bg); 134 | --theme-color: var(--light-theme); 135 | 136 | ... 137 | 138 | #+END_SRC 139 | 140 | So the variables store the colors for the light, dark and default theme (which 141 | is the dark theme in my case). 142 | 143 | That's it. Mostly. 144 | 145 | And even though I still have no idea about CSS and html, I learned a valuable 146 | lesson: I'm really, really happy that I usually work with C/C++ because 147 | CSS gives me headaches. 148 | 149 | /Side note: I tried to use css-csslint in Emacs but it doesn't seem to like 150 | CSS variables so I'm using css-stylelint now.../ 151 | 152 | ** Minimize exported html with ox-slimhtml 153 | 154 | This isn't exactly a huge issue that needs fixing but it somehow bothered me (a lot): 155 | 156 | in org-mode's exported html you get a lot of these: 157 | 158 | #+BEGIN_SRC html 159 | 160 |
    161 |

    some text

    162 |
    163 | 164 | #+END_SRC 165 | 166 | That "outline-container-org09e108d" cryptic id-class-whatever stuff kinda hurts 167 | my eyes and I don't need it, so I wanted to get rid of it. 168 | 169 | That's how I discovered [[https://github.com/balddotcat/ox-slimhtml][ox-slimhtml]] which seems to do exactly what I want (most 170 | of the time). 171 | 172 | ox-slimhtml is an org-mode export backend that outputs minimal html and makes 173 | it easier to customize the html output. 174 | Another handy feature of ox-slimhtml is that it allows org-macro expansion in 175 | preamble, postamble, header and footer, quite cool for templating. 176 | Apart from that and slimming the html output it's pretty much the same 177 | as the default org html exporter. 178 | 179 | I guess the idea is to create templates for your projects. But because I don't 180 | have (and don't plan to have) other projects than this blog and there are things 181 | I always want in my html, I slightly changed the export function to include 182 | the theme-switch: 183 | 184 | #+BEGIN_SRC elisp 185 | (defun my-ox-slimhtml-publish-to-html (plist filename pub-dir) 186 | (let ((file-path (ox-slimhtml-publish-to-html plist filename pub-dir))) 187 | (with-current-buffer (find-file-noselect file-path) 188 | (goto-char (point-min)) 189 | (search-forward "") 190 | (insert (mapconcat 'identity 191 | '("" 192 | "
    ") 193 | "\n")) 194 | (goto-char (point-max)) 195 | (search-backward "") 196 | (insert "
    ") 197 | (save-buffer) 198 | (kill-buffer)) 199 | file-path)) 200 | #+END_SRC 201 | 202 | For everything else that's specific to certain files I use templates (eg. to add 203 | the stylesheet to files in subfolders). 204 | 205 | Apart from generating slimmer html, ox-slimhtml is a lot faster in publishing than the usual org-mode 206 | publishing function. 207 | 208 | Something I haven't figured out yet: images don't get exported properly (i.e. not at all ;)) 209 | with ox-slimhtml. Currently I'm using a template (YASnippet) for images as well as a workaround, 210 | but it would be nice to find out how to do this without extra steps. 211 | 212 | ** Other changes 213 | 214 | *** Directory structure 215 | 216 | I slightly changed the directory structure into something like this: 217 | 218 | #+BEGIN_SRC 219 | blog/src/ 220 | ├── about.org 221 | ├── archive.org 222 | ├── disclaimer.org 223 | ├── index.org 224 | ├── assets/ 225 | ├── css/ 226 | │   └── style.css 227 | ├── entwuerfe/ 228 | └── posts/ 229 | ├── post_1 230 | │   └── index.org 231 | ├── post_2 232 | │   ├── index.org 233 | └── post_3 234 | └── index.org 235 | #+END_SRC 236 | /("entwuerfe" = "drafts")/ 237 | *** Function to get the date from the date keyword 238 | 239 | Here's a little context: if you ask Emacs for information about /org-publish-find-date/ 240 | you get the following: 241 | 242 | /Find the date of FILE in PROJECT. 243 | This function assumes FILE is either a directory or an Org file. 244 | *If FILE is an Org file and provides a DATE keyword use it. In 245 | any other case use the file system’s modification time.* Return 246 | time in ‘current-time’ format./ 247 | 248 | So according to this definition I'd expect it to...well, do what it says it does. 249 | Return the modification time of a file or use the DATE keyword. 250 | 251 | Unfortunately in my case it always ignored the DATE keyword and returned not the 252 | modification time but the creation time. 253 | 254 | But I *really* want the date from the DATE keyword. I couldn't figure out 255 | why /org-publish-find-date/ ignores the keyword, so I wrote a function 256 | for that (and again, it would be nice if I didn't need extra steps but hey =¯\_(ツ)_/¯)=. 257 | 258 | #+BEGIN_SRC elisp 259 | (defun my-org-publish-get-date-from-keyword (file project) 260 | "Get date keyword from FILE in PROJECT and parse it to internal format." 261 | (let ((date (org-publish-find-property file :date project))) 262 | (cond ((let ((ts (and (consp date) (assq 'timestamp date)))) 263 | (and ts 264 | (let ((value (org-element-interpret-data ts))) 265 | (and (org-string-nw-p value) 266 | (org-time-string-to-time value)))))) 267 | (t (error "No timestamp in file \"%s\"" file))))) 268 | #+END_SRC 269 | 270 | And the actual reason why I want the date from the DATE keyword in the first place, 271 | for the sitemap format function: 272 | 273 | #+BEGIN_SRC elisp 274 | (defun my-org-blog-sitemap-format-entry (entry _style project) 275 | "Return format string for each ENTRY in PROJECT." 276 | (if (and (s-starts-with? "posts/" entry) (not (equal "disclaimer.org" (file-name-nondirectory entry)))) 277 | (format "@@html:@@ %s @@html:@@ [[file:%s][%s]]@@html:
    @@ %s @@html:
    @@ @@html:
    @@ %s @@html:
    @@ @@html:
    @@" 278 | (format-time-string "[%d.%m.%Y, %R %Z]" 279 | (my-org-publish-get-date-from-keyword entry project)) 280 | entry 281 | (org-publish-find-title entry project) 282 | (org-publish-find-property entry :description project 'html) 283 | (org-publish-find-property entry :keywords project 'html)))) 284 | 285 | #+END_SRC 286 | 287 | And that's it I guess. 288 | 289 | Hopefully this will be the last "major" change, but probably I'll find new excuses to procrastinate from writing 290 | blog posts. 291 | 292 | 293 | -------------------------------------------------------------------------------- /src/posts/emacs_themes/index.org: -------------------------------------------------------------------------------- 1 | 2 | #+setupfile: ~/.emacs.d/org-templates/level1-slim.org 3 | #+title: Emacs Themes 4 | #+date: "<2019-12-21 Sun 20:00>" 5 | #+keywords: emacs, beginner-friendly, themes 6 | #+description: It's important to feel at home in your beloved editor, so this post is about creating custom themes in Emacs. 7 | * Creating Emacs custom themes 8 | 9 | 10 | #+attr_html: :class tldr 11 | #+BEGIN_DIV 12 | [TL;DR] It's important to feel at home in your beloved editor, so this post is 13 | about creating custom themes in Emacs. 14 | #+END_DIV 15 | 16 | ** Why? 17 | 18 | Apart from the fact that of course we want Emacs to look pretty the 19 | right theme can help to increase your productivity and optimise your 20 | coding workflow: in the best case a theme makes it easy to read your code and 21 | spot mistakes while being friendly for your eyes. 22 | 23 | ** How? 24 | 25 | *** Creating the theme 26 | 27 | Creating themes in Emacs is really easy :) 28 | Just type M-x customize-create-theme (for Emacs newbies: "M" means the alt key). 29 | You'll be asked if you want to have common faces inserted into your theme, 30 | that's pretty handy. Then you can choose a creative title and write a description 31 | for your new theme: 32 | 33 | \\ 34 | 35 | #+BEGIN_EXPORT html 36 |
    37 | create theme screenshot 38 | 39 |
    Figure 1: A screenshot of the customize theme buffer
    40 |
    41 | #+END_EXPORT 42 | \\ 43 | Probably you also want to add additional faces for the modes you use, 44 | you can do so with the "Insert Additional Face" option close to the 45 | end of the buffer: 46 | 47 | \\ 48 | 49 | #+BEGIN_EXPORT html 50 |
    51 | create theme screenshot 52 | 53 |
    Figure 1: A screenshot of the customize theme buffer
    54 |
    55 | #+END_EXPORT 56 | 57 | 58 | Themes don't only contain faces but also variables, you can set them in 59 | this bufffer, too. 60 | 61 | *** Selecting the theme 62 | 63 | 64 | When your outburst of creativity is over and you're done with customizing your 65 | theme save it by either using the "Save Theme" button or typing C-x C-s (for Emacs 66 | newbies: "C" means the control key). 67 | The theme is saved as "your-creative-theme-name"-theme.el in the directory 68 | specified by the variable custom-theme-directory. So if you haven't changed 69 | that variable you'll probably find your new theme in the ~/.emacs.d/ directory. 70 | 71 | To select the eyecandy you just created as your new theme type M-x customize-themes 72 | or (if your prefer to use the Menu Bar) click Options->Customize Emacs->Custom Themes. 73 | You'll find yourself in the Custom Themes buffer where you can select one or more 74 | themes. 75 | 76 | Emacs looks for the themes displayed in this buffer in custom-theme-directory and 77 | etc/themes of your Emacs installation (that's where the themes that come with Emacs 78 | are located). If you want to add additional directories just add them to the 79 | list "custom-theme-load-path" (for example sth. like (add-to-list 80 | 'custom-theme-load-path "~/.my-special-theme-dir"...). 81 | 82 | Save the theme(s) with the "Save Theme Settings" button or by typing C-x C-s. 83 | 84 | \\ 85 | 86 | #+BEGIN_EXPORT html 87 |
    88 | create theme screenshot 89 | 90 |
    Figure 1: A screenshot of the customize theme buffer
    91 |
    92 | #+END_EXPORT 93 | 94 | 95 | \\ 96 | 97 | Alternatively you can load a theme in your current session by typing M-x load-theme. 98 | (or if it's been loaded before with M-x enable-theme, guess the command for disabling 99 | it ;)). 100 | 101 | Note that loading a theme executes Lisp code, so make sure you know what you're loading. 102 | 103 | ** I'm lazy 104 | 105 | 106 | The method described above is not that much effort ;) But if it's 107 | still too much effort (and I totally understand that) for you you could 108 | use the Emacs Theme Creator by Martin Haesler: 109 | 110 | \\ 111 | 112 | #+BEGIN_EXPORT html 113 |
    114 | create theme screenshot 115 | 116 |
    Figure 1: A screenshot of the customize theme buffer
    117 |
    118 | #+END_EXPORT 119 | 120 | 121 | \\ 122 | 123 | And a [[https://emacs-theme-creator.appspot.com/][link]] to it. 124 | 125 | 126 | 127 | ** What else? 128 | 129 | 130 | Since themes in Emacs are simply lisp files you can also edit them directly. 131 | You should have a call to deftheme at the beginning of your file and provide-theme 132 | at the end. 133 | The function custom-theme-set-faces contains your face settings, if you 134 | have custom variables you can set them in custom-theme-set-variables. 135 | 136 | As an example, here's my cactus-theme (feel free to use it and add the faces you 137 | need): 138 | 139 | #+BEGIN_SRC emacs-lisp 140 | (deftheme cactus 141 | "Cactus Theme") 142 | 143 | (custom-theme-set-faces 144 | 'cactus 145 | '(cursor ((t (:background "cadet blue")))) 146 | '(border ((t (:foreground "gray6")))) 147 | '(default ((t (:background "gray20" :foreground "light sea green")))) 148 | '(error ((t (:foreground "goldenrod" :weight bold)))) 149 | '(match ((t (:background "gray31")))) 150 | '(mouse ((t (:foreground "goldenrod")))) 151 | '(region ((t (:background "cadet blue")))) 152 | '(scroll-bar ((t (:background "black" :foreground "cadet blue")))) 153 | '(tool-bar ((t (:background "cadet blue" :foreground "black" :box (:line-width 1 :style released-button))))) 154 | '(tooltip ((t (:inherit variable-pitch :background "pale goldenrod" :foreground "black")))) 155 | '(warning ((t (:foreground "deep sky blue" :weight bold)))) 156 | 157 | 158 | '(beacon-fallback-background ((t (:background "goldenrod")))) 159 | '(bold ((t (:foreground "light sea green" :weight bold)))) 160 | 161 | '(comint-highlight-input ((t (:foreground "dark gray" :weight bold)))) 162 | '(comint-highlight-prompt ((t (:foreground "dark goldenrod")))) 163 | 164 | '(company-echo-common ((t (:foreground "white smoke")))) 165 | '(company-preview ((t (:background "light sky blue" :foreground "dim gray")))) 166 | '(company-preview-common ((t (:inherit company-preview :foreground "goldenrod")))) 167 | '(company-preview-search ((t (:inherit company-preview :background "sky blue")))) 168 | '(company-scrollbar-bg ((t (:background "light gray")))) 169 | '(company-scrollbar-fg ((t (:background "dim gray")))) 170 | '(company-template-field ((t (:background "royal blue" :foreground "white")))) 171 | '(company-tooltip ((t (:background "royal blue" :foreground "white smoke")))) 172 | '(company-tooltip-annotation ((t (:foreground "light blue")))) 173 | '(company-tooltip-common ((t (:foreground "cyan2")))) 174 | '(company-tooltip-selection ((t (:background "light blue")))) 175 | 176 | '(compilation-mode-line-exit ((t (:inherit compilation-info :foreground "blue3" :weight bold)))) 177 | '(compilation-mode-line-fail ((t (:inherit compilation-error :foreground "dark cyan" :weight bold)))) 178 | 179 | '(custom-button ((t (:background "cadet blue" :foreground "black" :box (:line-width 2 :style released-button))))) 180 | '(custom-button-pressed-unraised ((t (:inherit custom-button-unraised :foreground "dark gray")))) 181 | '(custom-invalid ((t (:background "blue1" :foreground "white smoke")))) 182 | '(custom-rogue ((t (:background "black" :foreground "white")))) 183 | '(custom-state ((t (:foreground "cornflower blue")))) 184 | '(custom-modified ((t (:background "steel blue" :foreground "white")))) 185 | '(custom-themed ((t (:background "cornflower blue" :foreground "white")))) 186 | 187 | '(diary ((t (:foreground "goldenrod")))) 188 | 189 | '(escape-glyph ((t (:foreground "medium aquamarine")))) 190 | '(font-lock-builtin-face ((t (:foreground "medium aquamarine")))) 191 | '(font-lock-comment-face ((t (:foreground "gray40")))) 192 | '(font-lock-constant-face ((t (:foreground "aquamarine")))) 193 | '(font-lock-function-name-face ((t (:foreground "cyan3")))) 194 | '(font-lock-keyword-face ((t (:foreground "dark goldenrod")))) 195 | '(font-lock-negation-char-face ((t (:foreground "cyan")))) 196 | '(font-lock-string-face ((t (:foreground "dark gray")))) 197 | '(font-lock-type-face ((t (:foreground "dark goldenrod")))) 198 | '(font-lock-variable-name-face ((t (:foreground "medium aquamarine")))) 199 | '(font-lock-warning-face ((t (:foreground "deep sky blue")))) 200 | '(fringe ((t (:background "gray12")))) 201 | '(haskell-constructor-face ((t (:foreground "DarkGoldenrod3")))) 202 | '(header-line ((t (:inherit mode-line :background "grey20" :foreground "light gray" :box nil)))) 203 | '(helm-action ((t (:foreground "cyan4" :underline t)))) 204 | '(helm-buffer-archive ((t (:foreground "goldenrod")))) 205 | '(helm-buffer-directory ((t (:background "LightGray" :foreground "gray15")))) 206 | '(helm-buffer-not-saved ((t (:foreground "goldenrod")))) 207 | '(helm-buffer-process ((t (:foreground "dark goldenrod")))) 208 | '(helm-buffer-saved-out ((t (:background "black" :foreground "dark gray")))) 209 | 210 | '(helm-candidate-number ((t (:background "gray" :foreground "black")))) 211 | '(helm-ff-denied ((t (:background "black" :foreground "gold")))) 212 | '(helm-ff-directory ((t (:background "LightGray" :foreground "orange4")))) 213 | '(helm-ff-executable ((t (:foreground "gainsboro")))) 214 | '(helm-ff-invalid-symlink ((t (:background "steel blue" :foreground "black")))) 215 | '(helm-ff-prefix ((t (:background "dark goldenrod" :foreground "black")))) 216 | '(helm-ff-socket ((t (:foreground "gold")))) 217 | '(helm-ff-suid ((t (:background "dark goldenrod" :foreground "white")))) 218 | '(helm-grep-file ((t (:foreground "cyan" :underline t)))) 219 | '(helm-grep-finish ((t (:foreground "gainsboro")))) 220 | '(helm-header-line-left-margin ((t (:background "dark goldenrod" :foreground "black")))) 221 | '(helm-locate-finish ((t (:foreground "gainsboro")))) 222 | '(helm-mode-prefix ((t (:background "gold" :foreground "black")))) 223 | '(helm-prefarg ((t (:foreground "gainsboro")))) 224 | '(helm-resume-need-update ((t (:background "gainsboro")))) 225 | '(helm-selection ((t (:background "cadet blue" :distant-foreground "black")))) 226 | '(helm-separator ((t (:foreground "dark goldenrod")))) 227 | '(helm-visible-mark ((t (:background "cadet blue" :foreground "black")))) 228 | '(highlight ((t (:background "dark cyan" :foreground "black")))) 229 | '(info-node ((t (:foreground "light gray" :slant italic :weight bold)))) 230 | '(isearch ((t (:background "light sea green" :foreground "white")))) 231 | '(lazy-highlight ((t (:background "dim gray")))) 232 | '(link ((t (:foreground "deep sky blue" :underline t)))) 233 | '(link-visited ((t (:inherit link :foreground "steel blue")))) 234 | '(minibuffer-prompt ((t (:foreground "dark cyan")))) 235 | '(mode-line ((t (:background "cadet blue" :foreground "black" :box (:line-width -1 :style released-button))))) 236 | '(mode-line-buffer-id ((t (:foreground "pale goldenrod" :weight bold)))) 237 | '(mode-line-highlight ((t (:box (:line-width 2 :color "medium aquamarine" :style released-button))))) 238 | '(mode-line-inactive ((t (:inherit mode-line :background "PaleTurquoise4" :foreground "grey80" :box (:line-width -1 :color "grey40") :weight light)))) 239 | '(org-agenda-calendar-event ((t (:foreground "dark cyan")))) 240 | '(org-agenda-calendar-sexp ((t (:foreground "dark cyan")))) 241 | '(org-agenda-clocking ((t (:background "dim gray" :foreground "black")))) 242 | '(org-agenda-column-dateline ((t (:background "dark cyan" :foreground "gray")))) 243 | '(org-agenda-current-time ((t (:foreground "goldenrod")))) 244 | '(org-agenda-date-weekend ((t (:foreground "deep sky blue" :weight bold)))) 245 | '(org-agenda-done ((t (:foreground "goldenrod")))) 246 | '(org-checkbox ((t (:foreground "cyan" :weight bold)))) 247 | '(org-checkbox-statistics-done ((t (:foreground "gold" :weight bold)))) 248 | '(org-checkbox-statistics-todo ((t (:foreground "gainsboro" :weight bold)))) 249 | '(org-date-selected ((t (:foreground "dark gray" :inverse-video t)))) 250 | '(org-done ((t (:foreground "cyan" :weight bold)))) 251 | '(org-drawer ((t (:foreground "dark gray")))) 252 | '(org-formula ((t (:foreground "gold3")))) 253 | '(org-level-1 ((t (:foreground "light sea green")))) 254 | '(org-level-2 ((t (:foreground "cyan")))) 255 | '(org-level-3 ((t (:foreground "goldenrod")))) 256 | '(org-level-4 ((t (:foreground "medium aquamarine")))) 257 | '(org-mode-line-clock-overrun ((t (:inherit mode-line :background "gold")))) 258 | '(org-scheduled ((t (:foreground "medium spring green")))) 259 | '(org-scheduled-today ((t (:foreground "turquoise1")))) 260 | '(org-todo ((t (:foreground "gold" :weight bold)))) 261 | 262 | '(scroll-bar ((t (:background "black" :foreground "cadet blue")))) 263 | '(show-paren-mismatch ((t (:background "dark goldenrod" :foreground "white")))) 264 | '(success ((t (:foreground "dark turquoise" :weight bold)))) 265 | 266 | '(trailing-whitespace ((t (:background "dark goldenrod")))) 267 | '(tty-menu-disabled-face ((t (:background "dark cyan" :foreground "lightgray")))) 268 | '(tty-menu-enabled-face ((t (:background "dark cyan" :foreground "yellow" :weight bold)))) 269 | '(tty-menu-selected-face ((t (:background "DarkSlateGray3" :foreground "black")))) 270 | '(vimish-fold-overlay ((t (:background "dim gray" :foreground "cadet blue")))) 271 | '(widget-button-pressed ((t (:foreground "gray")))) 272 | '(widget-documentation ((t (:foreground "cyan")))) 273 | '(window-divider ((t (:foreground "gray15"))))) 274 | 275 | (provide-theme 'cactus) 276 | 277 | #+END_SRC 278 | \\ 279 | -------------------------------------------------------------------------------- /src/posts/linux_cookies/index.org: -------------------------------------------------------------------------------- 1 | 2 | #+setupfile: ~/.emacs.d/org-templates/level1-slim.org 3 | #+title: Linux Cookies 4 | #+date: "<2020-12-20 Sun 20:00>" 5 | #+keywords: linux, cookies, linux cookies, c programming, programming, ubuntu, debian, kali, arch, arch linux, gentoo, 3D printing 6 | #+description: I made 3D-printable models for Linux Cookie Cutters of 5 popular distros. Here are the (not entirely serious) installation instructions for the various distros as well as the cookie source code. 7 | * Linux Cookies 8 | #+attr_html: :class tldr 9 | #+BEGIN_DIV 10 | [TL;DR] I made 3D-printable models for Linux Cookie Cutters of 5 popular distros. 11 | Here are the (not entirely serious) installation instructions for the various 12 | distros as well as the cookie source code. 13 | #+END_DIV 14 | 15 | #+BEGIN_EXPORT html 16 |
    17 | Linux Cookie Cutters 18 | 19 |
    Figure 1: Linux Cookie Cutters
    20 |
    21 | #+END_EXPORT 22 | 23 | 24 | If you're in a hurry and just came for the STLs, here you are: 25 | 26 | [[https://github.com/bitshiftcrazy/linux-cookies-stls][Linux Cookie Cutters on Github]] 27 | 28 | /Please keep in mind that they're just prototypes and need improvement! 29 | You'll keep pretty and (depending on your baking skills) tasty cookies with 30 | them, but I still need to optimise them to need less filament, make 31 | them easier to clean etc. 32 | (Expect Linux Cookie Cutters v2 in about a week ;))/ 33 | 34 | ** Installation Instructions 35 | 36 | #+BEGIN_EXPORT html 37 |
    38 | Colorful Linux Cookies 39 | 40 |
    Figure 1: Colorful Linux Cookies
    41 |
    42 | #+END_EXPORT 43 | 44 | *Note: it's just meant as a joke, linux-cookies are not part of any official package 45 | repositories ;)* 46 | 47 | *** Arch Cookie Installation 48 | 49 | #+BEGIN_EXPORT html 50 |
    51 | An Arch Cookie during theme installation 52 | 53 |
    Figure 1: An Arch Cookie during theme installation
    54 |
    55 | #+END_EXPORT 56 | 57 | First install the necessary dependencies: 58 | 59 | #+BEGIN_SRC shell 60 | pacman -S flour butter sugar eggs 61 | #+END_SRC 62 | 63 | Most systems have the kitchen server already installed, if not install 64 | the following utilities as well: 65 | 66 | #+BEGIN_SRC shell 67 | pacman -S kitchen-oven kitchen-bowl kitchen-scale 68 | #+END_SRC 69 | 70 | And if you want some niceties like an icing bag: 71 | 72 | #+BEGIN_SRC shell 73 | pacman -S kitchen-extra 74 | #+END_SRC 75 | 76 | Then configure oven, bowl and scale settings in the corresponding 77 | configuration files: 78 | 79 | #+BEGIN_SRC shell 80 | echo "unit = celsius" >> /etc/kitchen/oven 81 | echo "size = big" >> /etc/kitchen/bowl 82 | echo "unit = gram" >> /etc/kitchen/scale 83 | #+END_SRC 84 | 85 | Finally, install the arch-cookie package: 86 | 87 | #+BEGIN_SRC shell 88 | pacman -S arch-cookies 89 | #+END_SRC 90 | 91 | You'll get slim and fast cookies without unnecessary bloat 92 | that taste exactly as you want them to taste, your system (body) won't 93 | gain a single gram in weight from them. 94 | 95 | *** Gentoo Installation 96 | 97 | #+BEGIN_EXPORT html 98 |
    99 | Raw Linux Cookie package 100 | 101 |
    Figure 1: Raw Linux Cookie package
    102 |
    103 | #+END_EXPORT 104 | 105 | In Gentoo packages are compiled from source. Go to the next field 106 | and harvest some wheat for your flour, find some chicken for eggs 107 | and get a cow for butter. 108 | 109 | As soon as you collected the ingredients, 110 | prepare your system: 111 | 112 | First enable ingredient support in the kernel, do /make menuconfig/ and 113 | apply the following changes: 114 | 115 | #+BEGIN_SRC 116 | Kernel Hacking ---> 117 | Cookie Options ---> 118 | <*> Enable fuzzy flour 119 | <*> Force extended sugar 120 | #+END_SRC 121 | 122 | Then setup the kernel for baking support: 123 | 124 | #+BEGIN_SRC 125 | Device Drivers ---> 126 | Baking support ---> 127 | Baking Devices ---> 128 | <*> Oven Support 129 | <*> Bowl Support 130 | <*> Scale Support 131 | #+END_SRC 132 | 133 | Save and exit from the configuration and rebuild the kernel: 134 | 135 | #+BEGIN_SRC shell 136 | make -j $(nproc) 137 | make modules_install 138 | make install 139 | #+END_SRC 140 | 141 | This will take a while. 142 | After installation finishes reboot your system. 143 | 144 | Then set the right variables for oven and scale in //etc/portage/make.conf/, 145 | which value you need depends on your oven and scale manufacturers. 146 | 147 | An example configuration for a Siemens oven and a Wmf scale: 148 | 149 | #+BEGIN_SRC 150 | OVEN_TYPE="siemens" 151 | 152 | SCALE_TYPE="wmf" 153 | #+END_SRC 154 | 155 | Afterwards set your *USE flags*. Available *USE flags* for gentoo-cookies: 156 | 157 | Local USE flags: 158 | 159 | - *vanilla* for vanilla flavour 160 | - *chocolate* for chocolate flavour 161 | - *cinnamon* for cinnamon flavour 162 | - *wheat* for wheat flour 163 | - *spelt* for spelt flour 164 | - *offensive*, warning: changes your cookies to offensive shapes 165 | 166 | Global USE flags: 167 | 168 | - vegan for vegan cookies 169 | 170 | For example to enable *vanilla* flavour do: 171 | 172 | #+BEGIN_SRC shell 173 | echo "linux-cookies/gentoo-cookies vanilla" >> /etc/portage/package.use/gentoo-cookies 174 | #+END_SRC 175 | 176 | When you're done with the setup install //linux-cookies/gentoo-cookies/: 177 | 178 | #+BEGIN_SRC shell 179 | emerge --ask linux-cookies/gentoo-cookies 180 | #+END_SRC 181 | 182 | 183 | Configure the /kitchen-utilities/ as described in the Arch section and after 184 | only 6h you're done. 185 | 186 | 187 | You'll get fast and tiny cookies that are fine-tuned for your system (body), 188 | your digestion will run faster than ever before and you'll probably 189 | even lose package weight with them. 190 | 191 | *** Ubuntu/Kali/Debian Installation 192 | 193 | #+BEGIN_EXPORT html 194 |
    195 | Linux Cookies without theme 196 | 197 |
    Figure 1: Linux Cookies without theme
    198 |
    199 | #+END_EXPORT 200 | 201 | Open a terminal and type 202 | 203 | #+BEGIN_SRC shell 204 | sudo apt-get install linux-cookies 205 | #+END_SRC 206 | 207 | The package comes bundled with all necessary (and unnecessary) 208 | dependencies as well as the kitchen utilities. 209 | 210 | The resulting cookies will be a full fat version: they'll contain lots 211 | of stuff you'll never need but they're done very fast. 212 | Your system gains at least 1000g package weight. 213 | 214 | ** Cookie Source Code 215 | 216 | #+BEGIN_EXPORT html 217 |
    218 | Linux Cookies with theme 219 | 220 |
    Figure 1: Linux Cookies with theme
    221 |
    222 | #+END_EXPORT 223 | 224 | The source code is written in C to make the baking process as fast 225 | as possible ;) 226 | 227 | /Again, just a joke, the code is written to look like and be used as a cookie 228 | recipe, not so much to make sense./ 229 | 230 | If you run /linux-cookies/, it'll guide you through the baking process 231 | step by step. 232 | 233 | #+BEGIN_SRC c 234 | #include 235 | #include 236 | #include 237 | #include 238 | #include 239 | 240 | typedef struct { 241 | int temperature; 242 | char mode[30]; 243 | } Oven; 244 | 245 | typedef struct { 246 | char name[20]; 247 | int amount; 248 | char unit[5]; 249 | } Ingredient; 250 | 251 | typedef struct { 252 | int cookie_number; 253 | char cookie_type[20]; 254 | } Cookie_Sheet; 255 | 256 | void set_oven_temperature(Oven, int, char*); 257 | void mix_ingredients(Ingredient*, int); 258 | void divide_dough(); 259 | void form_ball(int); 260 | void cool(char*, int); 261 | void roll_out_dough(double); 262 | void cut_into_shapes(char *); 263 | void add_cookies(Cookie_Sheet, char*, int); 264 | void bake(int); 265 | void clear_sheet(Cookie_Sheet); 266 | void eat(); 267 | void wait_for_enter(); 268 | 269 | int main() { 270 | // initialise to zero because...we have no cookies when we start 271 | int num_cookies = 0; 272 | int dough = 0; 273 | int num_dough_ingredients = 4; 274 | 275 | // prepare the following list of ingredients for the dough 276 | Ingredient dough_ingredients[4] = {{"flour", 1000, "g"}, 277 | {"butter", 500, "g"}, 278 | {"sugar", 400, "g"}, 279 | {"eggs", 2, "pc"}}; 280 | 281 | // prepare a bowl that's big enough to hold all the ingredients 282 | Ingredient* dough_bowl = malloc(num_dough_ingredients * sizeof *dough_bowl); 283 | 284 | // the initial heat of my oven is 20 degrees celcius, no mode is set 285 | Oven myOven = {20, "none"}; 286 | 287 | // preheat the oven to 175 degree 288 | printf("Step 1:\n"); 289 | set_oven_temperature(myOven, 175, "upper_lower_heat"); 290 | 291 | // put the ingredients into the bowl 292 | printf("Step 2:\n"); 293 | for (int i = 0; i < num_dough_ingredients; i++) { 294 | dough_bowl[i] = dough_ingredients[i]; 295 | printf("Add %d %s of %s into the bowl.\n", dough_ingredients[i].amount, 296 | dough_ingredients[i].unit, 297 | dough_ingredients[i].name); 298 | wait_for_enter(); 299 | } 300 | 301 | printf("\n"); 302 | 303 | // mix them 304 | printf("Step 3:\n"); 305 | mix_ingredients(dough_bowl, num_dough_ingredients); 306 | 307 | // set dough flag to 1, we have dough now 308 | dough = 1; 309 | 310 | // divide the dough into 4 pieces and form balls 311 | printf("Step 4:\n"); 312 | for (int i = 0; i < 4; i++) { 313 | divide_dough(); 314 | form_ball(i + 1); 315 | } 316 | printf("\n"); 317 | 318 | // cool the dough for 60min 319 | printf("Step 5:\n"); 320 | cool("dough", 60); 321 | 322 | // Prepare a cookie sheet 323 | Cookie_Sheet cookie_sheet = {0}; 324 | 325 | // Roll out the dough 0.5cm thick 326 | printf("Step 6:\n"); 327 | roll_out_dough(0.5); 328 | 329 | // set all cookie types to 0 because we have none yet 330 | int arch_cookie = 0; 331 | int gentoo_cookie = 0; 332 | int debian_cookie = 0; 333 | int ubuntu_cookie = 0; 334 | int kali_cookie = 0; 335 | 336 | // loop as long as we have dough and energy to bake, 337 | // this should be 100 cookies 338 | // note: sometimes a bug occurs: there's dough left after 100 cookies 339 | // in this case you can forcefully set the dough flag to 0 by eating the rest 340 | // side effects of this hack: nausea and diarrhea on older systems 341 | printf("Step 7:\n"); 342 | while (dough) { 343 | 344 | if (num_cookies < 20) { 345 | cut_into_shapes("arch"); 346 | add_cookies(cookie_sheet, "arch", num_cookies + 1); 347 | wait_for_enter(); 348 | arch_cookie++; 349 | 350 | if (arch_cookie == 20) { 351 | bake(480); 352 | clear_sheet(cookie_sheet); 353 | } 354 | 355 | } 356 | 357 | else if (num_cookies < 40) { 358 | cut_into_shapes("gentoo"); 359 | add_cookies(cookie_sheet, "gentoo", num_cookies - 20 + 1); 360 | wait_for_enter(); 361 | gentoo_cookie++; 362 | 363 | if (gentoo_cookie == 20) { 364 | bake(540); 365 | clear_sheet(cookie_sheet); 366 | } 367 | } 368 | 369 | else if (num_cookies < 60) { 370 | cut_into_shapes("debian"); 371 | add_cookies(cookie_sheet, "debian", num_cookies - 40 + 1); 372 | wait_for_enter(); 373 | debian_cookie++; 374 | 375 | if (debian_cookie == 20) { 376 | bake(600); 377 | clear_sheet(cookie_sheet); 378 | } 379 | } 380 | 381 | else if (num_cookies < 80) { 382 | cut_into_shapes("ubuntu"); 383 | add_cookies(cookie_sheet, "ubuntu", num_cookies - 60 + 1); 384 | wait_for_enter(); 385 | ubuntu_cookie++; 386 | 387 | if (ubuntu_cookie == 20) { 388 | bake(540); 389 | clear_sheet(cookie_sheet); 390 | } 391 | 392 | } 393 | 394 | else { 395 | cut_into_shapes("kali"); 396 | add_cookies(cookie_sheet, "kali", num_cookies - 80 + 1); 397 | wait_for_enter(); 398 | kali_cookie++; 399 | 400 | if (kali_cookie == 20) { 401 | bake(480); 402 | clear_sheet(cookie_sheet); 403 | } 404 | } 405 | 406 | num_cookies++; 407 | 408 | if (num_cookies == 100) { 409 | dough = 0; 410 | printf("\n"); 411 | } 412 | } 413 | 414 | // Cool cookies for 60min 415 | printf("Step 8:\n"); 416 | cool("cookies", 60); 417 | 418 | printf("Step 9: Guten Appetit.\n"); 419 | eat(); 420 | } 421 | 422 | 423 | void set_oven_temperature(Oven oven, int temperature, char *mode) 424 | { 425 | oven.temperature = temperature; 426 | strcpy(oven.mode, mode); 427 | printf("Set oven temperature to %d %s.\n", temperature, mode); 428 | wait_for_enter(); 429 | printf("\n"); 430 | } 431 | 432 | void mix_ingredients(Ingredient bowl[], int num_ingredients) 433 | { 434 | int i, j = 0; 435 | Ingredient temp = {"", 0, ""}; 436 | 437 | srand(time(NULL)); 438 | 439 | for (i = 0; i < num_ingredients; i++) { 440 | j = rand() % num_ingredients; 441 | temp = bowl[i]; 442 | bowl[i] = bowl[j]; 443 | bowl[j] = temp; 444 | printf("Mix, mix, mix...\n"); 445 | } 446 | wait_for_enter(); 447 | printf("\n"); 448 | } 449 | 450 | void divide_dough() { 451 | printf("Divide the dough.\n"); 452 | } 453 | 454 | void form_ball(int number) { 455 | printf("Form ball number %d from dough.\n", number); 456 | wait_for_enter(); 457 | } 458 | 459 | void cool(char *name, int time) { 460 | printf("Cool %s for at least %d minutes.\n", name, time); 461 | wait_for_enter(); 462 | printf("\n"); 463 | } 464 | 465 | void roll_out_dough(double height) { 466 | printf("Roll the dough out to %f cm thick\n", height); 467 | wait_for_enter(); 468 | printf("\n"); 469 | } 470 | 471 | void cut_into_shapes(char *shape) { 472 | if (!(strcmp(shape, "arch"))) { 473 | printf("Cut an %s cookie!\n", shape); 474 | } 475 | else { 476 | printf("Cut a %s cookie!\n", shape); 477 | } 478 | } 479 | 480 | void add_cookies(Cookie_Sheet cookie_sheet, char *cookie_type, int number) 481 | { 482 | strcpy(cookie_sheet.cookie_type, cookie_type); 483 | printf("Add %s-cookie number %d to sheet...\n", cookie_type, number); 484 | cookie_sheet.cookie_number++; 485 | } 486 | 487 | void bake (int seconds) { 488 | int minutes = seconds / 60; 489 | printf("Put cookies in oven and wait for %d minutes.\n", minutes); 490 | printf("Baking...\n"); 491 | sleep(seconds); 492 | printf("\a"); 493 | printf("Cookies are done! Get them out of the oven!\n"); 494 | printf("Are you ready to continue?\n"); 495 | wait_for_enter(); 496 | } 497 | 498 | void clear_sheet(Cookie_Sheet cookie_sheet) { 499 | cookie_sheet.cookie_number = 0; 500 | strcpy(cookie_sheet.cookie_type, "no_cookies :("); 501 | } 502 | 503 | void eat() { 504 | printf("nom nom nom...\n"); 505 | printf("\n"); 506 | } 507 | 508 | 509 | void wait_for_enter(){ 510 | while (1){ 511 | printf("Press ENTER to continue...\n"); 512 | char x = getchar(); 513 | if (x == '\n' || x == EOF) 514 | break; 515 | } 516 | } 517 | 518 | 519 | 520 | #+END_SRC 521 | -------------------------------------------------------------------------------- /website/posts/changes_in_blogging_setup/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Changes in Blogging Setup 6 | 7 | 8 |

    Changes in Blogging Setup

    [TL;DR] A few things bothered me in my blogging setup, here's a summary of what I changed. 9 | And: I still have no idea about web development ¯\_(ツ)_/¯ 10 |
    11 | 12 |

    Since I published my blog for the first time about a year ago, quite a few things 13 | changed in my setup: 14 | gradually I added things I was convinced I need (for example functions to generate 15 | RSS), and soon I had a ca. 800 lines of code big elisp tumor to simply... 16 | generate a static website. 17 |

    18 | 19 |

    So it was time for some cleaning and re-structuring: 20 |

    21 | 22 | 23 |
    • I kicked out the RSS functions (sorry not sorry to the 3 people who asked 24 | for RSS)
    • 25 | 26 |
    • I kicked out the functions to create a page with links (why did I even think 27 | that makes sense in the first place...?)
    • 28 | 29 |
    • I switched to ox-slimhtml
    • 30 | 31 |
    • I added a theme-switcher to switch between a light or a dark theme
    • 32 | 33 |
    • some other minor changes: I changed the folder structure, changed and 34 | added some templates, changed the format of archive items
    • 35 |
    36 | 37 |

    And some things that won't change: 38 |

    39 | 40 | 41 |
    • this website still doesn't use JavaScript
    • 42 | 43 |
    • it's still generated with Emacs and org-mode
    • 44 | 45 |
    • there's still no tracker or other stuff that would 46 | disrespect your privacy
    • 47 | 48 |
    • I still have no idea about html and CSS...
    • 49 |
    50 | 51 | 52 | 53 |

    And here are some details about some of the changes: 54 |

    55 | 56 |

    Switch themes with CSS and html only (no JavaScript)

    Spoiler: Because of my lack of CSS and html knowledge (and my stubborness not 57 | to use JavaScript) this was a huge PITA. 58 |

    59 | 60 |

    But thanks to some great resources I found online I somehow collected the pieces 61 | I needed. And after some more research I also suceeded in putting those pieces together. 62 |

    63 | 64 | 65 |

    So - to summarize the procedure in my own, CSS-nooby words - what I need to get 66 | what I want: 67 |

    68 | 69 |
    • a checkbox
    • 70 | 71 |
    • a CSS :checked selector
    • 72 | 73 |
    • the subsequent-sibling combinator ~ (wtf, I call it "tilde"...)
    • 74 | 75 |
    • CSS variables
    • 76 | 77 |
    • lots of patience because...CSS
    • 78 |
    79 | 80 | 81 |

    I can really recommend Daniela's fantastic medium article: Dark Mode and CSS variables, 82 | and this guide was also very useful! 83 |

    84 | 85 |

    HTML

    First I needed a checkbox in the html code. I wanted the label to be part of my 86 | navbar so it looks somewhat like this now: 87 |

    88 | 89 |
    <body>
     90 |   <input type="checkbox" class="theme-switch" id="theme-switch"/>
     91 |   <div id="page">
     92 |     <div>
     93 |       <nav class="navbar"> ... <a href="#"> <label for="theme-switch" class="switch-label"></label></a></nav>
     94 |       <div id="content">
     95 |         ...
     96 |       </div>
     97 | </body>
     98 | 
    99 | 100 |

    That's basically what this guide described. 101 |

    102 | 103 |

    (To get org-mode/ox-slimthml to export the html code like this I modified the export- 104 | function, more about this in the next section) 105 |

    106 | 107 |

    CSS

    And here's what the combination of :checked, CSS variables and the ~ sibling 108 | thing looks like: 109 |

    110 | 111 |
    :root {
    112 |     /* Light mode */
    113 |     --light-switch-text: "dark mode";
    114 |     --light-text: #273136;
    115 |     --light-bg: #e3e5e6;
    116 | 
    117 |     ...
    118 | 
    119 |     /* Dark mode */
    120 |     --dark-switch-text: "light mode";
    121 |     --dark-text: #95b1be;
    122 |     --dark-bg: #14191a;
    123 | 
    124 |     ...
    125 | 
    126 |    /* Default mode */
    127 |    --switch-text: var(--dark-switch-text);
    128 |    --text-color: var(--dark-text);
    129 |    --bg-color: var(--dark-bg);
    130 |    --theme-color: var(--dark-theme);
    131 | 
    132 |     ...
    133 | 
    134 |     /* Switched mode */
    135 | .theme-switch:checked ~ #page {
    136 |     --switch-text: var(--light-switch-text);
    137 |     --text-color: var(--light-text);
    138 |     --bg-color: var(--light-bg);
    139 |     --theme-color: var(--light-theme);
    140 | 
    141 |     ...
    142 | 
    143 | 
    144 | 145 |

    So the variables store the colors for the light, dark and default theme (which 146 | is the dark theme in my case). 147 |

    148 | 149 |

    That's it. Mostly. 150 |

    151 | 152 |

    And even though I still have no idea about CSS and html, I learned a valuable 153 | lesson: I'm really, really happy that I usually work with C/C++ because 154 | CSS gives me headaches. 155 |

    156 | 157 |

    Side note: I tried to use css-csslint in Emacs but it doesn't seem to like 158 | CSS variables so I'm using css-stylelint now... 159 |

    160 | 161 |

    Minimize exported html with ox-slimhtml

    This isn't exactly a huge issue that needs fixing but it somehow bothered me (a lot): 162 |

    163 | 164 |

    in org-mode's exported html you get a lot of these: 165 |

    166 | 167 |
    
    168 | <div id="outline-container-org09e108d" class="outline-2">
    169 | <h2 id="org09e108d"> some text </h2>
    170 | <div class="outline-text-2" id="text-org09e108d">
    171 | 
    172 | 
    173 | 174 |

    That "outline-container-org09e108d" cryptic id-class-whatever stuff kinda hurts 175 | my eyes and I don't need it, so I wanted to get rid of it. 176 |

    177 | 178 |

    That's how I discovered ox-slimhtml which seems to do exactly what I want (most 179 | of the time). 180 |

    181 | 182 |

    ox-slimhtml is an org-mode export backend that outputs minimal html and makes 183 | it easier to customize the html output. 184 | Another handy feature of ox-slimhtml is that it allows org-macro expansion in 185 | preamble, postamble, header and footer, quite cool for templating. 186 | Apart from that and slimming the html output it's pretty much the same 187 | as the default org html exporter. 188 |

    189 | 190 |

    I guess the idea is to create templates for your projects. But because I don't 191 | have (and don't plan to have) other projects than this blog and there are things 192 | I always want in my html, I slightly changed the export function to include 193 | the theme-switch: 194 |

    195 | 196 |
    (defun my-ox-slimhtml-publish-to-html (plist filename pub-dir)
    197 |   (let ((file-path (ox-slimhtml-publish-to-html plist filename pub-dir)))
    198 |     (with-current-buffer (find-file-noselect file-path)
    199 |   (goto-char (point-min))
    200 |       (search-forward "<body>")
    201 |       (insert (mapconcat 'identity
    202 |                          '("<input type=\"checkbox\" class=\"theme-switch\" id=\"theme-switch\"/>"
    203 |                            "<div id=\"page\">")
    204 |                            "\n"))
    205 |       (goto-char (point-max))
    206 |       (search-backward "</body>")
    207 |       (insert "</div></div>")
    208 |       (save-buffer)
    209 |       (kill-buffer))
    210 |     file-path))
    211 | 
    212 | 213 |

    For everything else that's specific to certain files I use templates (eg. to add 214 | the stylesheet to files in subfolders). 215 |

    216 | 217 |

    Apart from generating slimmer html, ox-slimhtml is a lot faster in publishing than the usual org-mode 218 | publishing function. 219 |

    220 | 221 |

    Something I haven't figured out yet: images don't get exported properly (i.e. not at all ;)) 222 | with ox-slimhtml. Currently I'm using a template (YASnippet) for images as well as a workaround, 223 | but it would be nice to find out how to do this without extra steps. 224 |

    225 | 226 |

    Other changes

    Directory structure

    I slightly changed the directory structure into something like this: 227 |

    228 | 229 |
    blog/src/
    230 | ├── about.org
    231 | ├── archive.org
    232 | ├── disclaimer.org
    233 | ├── index.org
    234 | ├── assets/
    235 | ├── css/
    236 | │   └── style.css
    237 | ├── entwuerfe/
    238 | └── posts/
    239 |     ├── post_1
    240 |     │   └── index.org
    241 |     ├── post_2
    242 |     │   ├── index.org
    243 |     └── post_3
    244 | 	└── index.org
    245 | 
    246 |

    ("entwuerfe" = "drafts") 247 |

    248 |

    Function to get the date from the date keyword

    Here's a little context: if you ask Emacs for information about org-publish-find-date 249 | you get the following: 250 |

    251 | 252 |

    /Find the date of FILE in PROJECT. 253 | This function assumes FILE is either a directory or an Org file. 254 | If FILE is an Org file and provides a DATE keyword use it. In 255 | any other case use the file system’s modification time. Return 256 | time in ‘current-time’ format./ 257 |

    258 | 259 |

    So according to this definition I'd expect it to...well, do what it says it does. 260 | Return the modification time of a file or use the DATE keyword. 261 |

    262 | 263 |

    Unfortunately in my case it always ignored the DATE keyword and returned not the 264 | modification time but the creation time. 265 |

    266 | 267 |

    But I really want the date from the DATE keyword. I couldn't figure out 268 | why org-publish-find-date ignores the keyword, so I wrote a function 269 | for that (and again, it would be nice if I didn't need extra steps but hey ¯\_(ツ)_/¯). 270 |

    271 | 272 |
    (defun my-org-publish-get-date-from-keyword (file project)
    273 |   "Get date keyword from FILE in PROJECT and parse it to internal format."
    274 |            (let ((date (org-publish-find-property file :date project)))
    275 |              (cond ((let ((ts (and (consp date) (assq 'timestamp date))))
    276 |                       (and ts
    277 |                            (let ((value (org-element-interpret-data ts)))
    278 |                              (and (org-string-nw-p value)
    279 |                                   (org-time-string-to-time value))))))
    280 |                    (t (error "No timestamp in file \"%s\"" file)))))
    281 | 
    282 | 283 |

    And the actual reason why I want the date from the DATE keyword in the first place, 284 | for the sitemap format function: 285 |

    286 | 287 |
    (defun my-org-blog-sitemap-format-entry (entry _style project)
    288 |   "Return format string for each ENTRY in PROJECT."
    289 |   (if (and (s-starts-with? "posts/" entry) (not (equal "disclaimer.org" (file-name-nondirectory entry))))
    290 |    (format "@@html:<span class=\"archive-item\"><span class=\"archive-date\">@@ %s @@html:</span>@@ [[file:%s][%s]]@@html:<div class=\"description\">@@ %s @@html:</div>@@ @@html:<div class=\"keywords\">@@ %s @@html:</div>@@ @@html:</span>@@"
    291 |             (format-time-string "[%d.%m.%Y, %R %Z]"
    292 |                                 (my-org-publish-get-date-from-keyword entry project))
    293 |             entry
    294 |             (org-publish-find-title entry project)
    295 |             (org-publish-find-property entry :description project 'html)
    296 |             (org-publish-find-property entry :keywords project 'html))))
    297 | 
    298 | 
    299 | 300 |

    And that's it I guess. 301 |

    302 | 303 |

    Hopefully this will be the last "major" change, but probably I'll find new excuses to procrastinate from writing 304 | blog posts. 305 |

    306 |
    Made with Emacs :) 307 |

    Disclaimer 308 |

    309 | 310 | -------------------------------------------------------------------------------- /src/posts/PinkPad/index.org: -------------------------------------------------------------------------------- 1 | 2 | #+setupfile: ~/.emacs.d/org-templates/level1-slim.org 3 | #+title: The PinkPad v1 2020 Lockdown Edition 4 | #+date: "<2020-11-18 Sun 20:00>" 5 | #+keywords: raspberry pi, linux, arch linux, coding 6 | #+description: I was always jealous about those hot little mini-laptops. So I built my own one with a Raspberry Pi and a toy laptop. 7 | 8 | * The PinkPad v1 2020 Lockdown Edition 9 | 10 | #+attr_html: :class tldr 11 | #+BEGIN_DIV 12 | [TL;DR] I've always been jealous about those hot little mini-laptops. 13 | So I built my own one with a Raspberry Pi and a toy laptop. Here's why and how 14 | I did that. (It uses Arch btw.) 15 | #+END_DIV 16 | 17 | ** A very special Raspberry Pi case 18 | 19 | #+BEGIN_EXPORT html 20 |
    21 | The PinkPad: a very special Raspberry Pi case 22 | 23 |
    Figure 1: A very special Raspberry Pi case
    24 |
    25 | #+END_EXPORT 26 | 27 | Every time I saw someone with one of those unnecessarily cute mini-laptops, I got 28 | extremely jealous. But most of them are a bit too expensive for something 29 | I'd only use to flex. Stealing is illegal, I'd probably even have to murder the 30 | (former) owners of the stolen mini-laptop and buying acid to dissolve the bodies, renting a car to bury the remains far away from my home, 31 | hiring a lawyer if something goes wrong (see, I had a plan...) is most likely even more expensive than buying one. 32 | And a lot more stressful. 33 | 34 | /(That was a joke obviously, please don't call the cops ;))/ 35 | 36 | So I decided to build my own one. Apart from being cheaper it comes with 37 | another great advantage: I can build it to be as /metal/ as I am. 38 | Because let's be honest, something like the GPD Pocket might be cute. 39 | But I'm not ;) 40 | 41 | As a Black Metal fan I need something a little more...brutal. 42 | 43 | #+BEGIN_EXPORT html 44 |
    45 | satanic pinkpad 46 | 47 |
    Figure 1: How to chmod 666
    48 |
    49 | #+END_EXPORT 50 | 51 | Luckily I found the perfect model on eBay. Something that looks just as evil and 52 | badass as I feel. The perfect match: the Schlaubärchen Laptop. 53 | /(German speakers start laughing now, for everyone else "Schlaubärchen" 54 | probably still sounds pretty metal)/ 55 | 56 | The actual name of this hardcore device is [[https://www.vtech.de/vtechbaby/lern-und-musik-laptop-pink][VTech Lern und Musik Laptop]], it's 57 | a toy laptop for children from 2 - 4. 58 | 59 | As I said, I bought it on eBay to see if it was somehow possible to get Linux 60 | onto it (as previously on my Kindle and calculator and almost my microwave, but 61 | that's a different story). I didn't have high hopes, even if I would have been successful 62 | in jail-breaking the thing, those toy laptops often have some kind of ancient 63 | Z80 processor and to get /something/ on /that/...well, let's say one lock-down wouldn't 64 | be enough time 65 | (not that it hasn't been done before tho: [[https://hackaday.com/2019/10/14/repurposing-a-toy-computer-from-the-1990s/][Repurposing A Toy Computer From The 1990s]], [[http://www.symbos.de/index.htm][SymbOS]]) 66 | 67 | *So I changed my plans and turned the Schlaubärchen Laptop into the most hardcore, 68 | Black-Metal-iest, badass Raspberry Pi case ever.* 69 | 70 | 71 | 72 | 73 | ** How 74 | 75 | Finally the interesting part, /how/: 76 | 77 | It's not exactly difficult to slaughter a toy laptop, rip out its insides and 78 | put a Raspberry Pi back in. 79 | But it's more challenging than you'd expect to fit 80 | everything together: you have the perfect USB hub at home, but all your cables 81 | are too long, you have a matching display but not the right adapters, you find 82 | a small keyboard but it has the wrong colour... 83 | 84 | And just like that a "lock-down weekend project" turns into an ongoing work in progress. 85 | 86 | Before I started building I had a few things in mind I wanted to achieve: 87 | 88 | - it should /really/ be usable: that means keyboard and display have to 89 | be big enough, it needs WiFi, it needs a reasonably long battery life 90 | - it has to be sturdy: it should survive being carried (and most likely thrown) 91 | around by someone as clumsy as me without falling apart 92 | - it shouldn't look like "butchered and glued back together" too much 93 | 94 | In case you want to have such an overly cool laptop as well, read on. 95 | 96 | (Or you just want amuse yourself with reading about the insane effort someone put 97 | into butchering a toy laptop) 98 | 99 | *** Parts 100 | 101 | - the [[https://www.vtech.de/vtechbaby/lern-und-musik-laptop-pink][VTech Lern und Musik Laptop]] obviously: as I said earlier, 102 | if you buy a new one, it's about 28€. On eBay it shouldn't cost more 103 | than *15€* 104 | 105 | - a Raspberry Pi: I used a [[https://www.berrybase.de/raspberry-pi-co/raspberry-pi/boards/raspberry-pi-zero-w][Raspberry Pi Zero W]] (for about *11€*) 106 | because I already had one. 107 | If you don't use the 3D printed middle part only a Pi Zero will fit into the case. 108 | With this part you can use other Raspberry Pis as well (you 109 | may have to add a fan then tho) 110 | 111 | - a microSD for said Raspberry Pi (size depends on which distro you 112 | want to install, a 32GB microSD by SanDisk costs about *9€*) 113 | 114 | - a 5inch LCD Touch Screen: I had [[https://www.amazon.de/Waveshare-Resistive-Resolution-Interface-Raspberry/dp/B01HPV7OEG/ref=sr_1_3?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=waveshare+5+inch+lcd+display&qid=1606991005&sr=8-3][this one]] by Waveshare for about *40€* 115 | but you could basically use whatever you want or have (and fits into 116 | the 3D printed parts) 117 | 118 | - the [[https://www.amazon.de/2-4GHz-Wireless-Tastatur-Touchpad-Maus-Android/dp/B00VWVXQB6/ref=sr_1_3?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=1N3O8KE0SQW8V&dchild=1&keywords=rii+x1+mini+tastatur+wireless&qid=1606991157&sprefix=Rii+X1%2Caps%2C238&sr=8-3][Rii X1 Mini keyboard]]: it's pretty nice for typing, but again, you could 119 | use whatever you want or have. If you buy a new one it costs about *18€*, but 120 | you should easily find one on eBay for not more than *10€* 121 | 122 | - a "as small as possible" USB hub that's suitable for the current draw of 123 | your hardware components (you can get one from *9€*) 124 | 125 | - a 3D printed cover for the top part and the part with the keyboard 126 | (and a middle part for bigger Raspberries) 127 | 128 | - various cables and adapters 129 | 130 | **** For the power supply: 131 | 132 | To power the PinkPad with a battery (/really/ recommended since the 3D design 133 | kinda requires that), we need to take some things into account for the battery 134 | life expectation: 135 | 136 | Basically the runtime of the PinkPad depends on the battery's capacity and 137 | the power consumed by the hardware components. 138 | 139 | To get the average current consumption you can either use a multimeter to 140 | measure the current (given that there's a constant current draw), use something 141 | like a current sensor breakout to measure power consumption over time /or/ 142 | very roughly estimate the result based on the used component's consumption and add a 143 | little extra /mAh/ to be sure (trust me, I'm an engineer): 144 | 145 | Generally: /your battery capacity in mAh // /your project's 146 | average power consumption = your expected runtime/. 147 | 148 | All Raspberry Pi models need a 5.1V power supply, the Raspberry Pi Zero W 149 | has a recommended PSU current capacity of 1.2A and 150mA bare-board 150 | active current consumption. 151 | Additionally to your board, your other hardware components have current 152 | consumption, too (e.g. the LCD touchscreen has 235mA with backlight on and 45mA 153 | without). 154 | 155 | What you choose as power supply is up to you (I mean, within the possible 156 | power supplies ;)), here's what I used: 157 | 158 | - a 3.7V lipo battery with 6000mAh (because that was literally the only 159 | one I had) 160 | 161 | - a Boost Converter: I used the [[https://learn.adafruit.com/adafruit-powerboost-1000c-load-share-usb-charge-boost][Adafruit Power Boost 1000 C]]. It comes 162 | with quite a few handy features, my favourite being the integrated 163 | smart load-sharing lipoly charger. It's rather expensive with about 164 | *29€* tho. 165 | 166 | - I also added a switch to the Power Boost to power it on and off, 167 | I have no idea what a single switch costs tho (I just assume *5€* for 168 | a pack of switches) 169 | 170 | 171 | I don't like it when guides praise how cheap it is to "quickly build something 172 | as a weekend project" and then assume you have a whole electronics department at 173 | home and live in a makerspace. 174 | So to calculate the costs for a PinkPad I assume you don't have any of the 175 | parts - not even a microSD or USB hub - and buy everything new (aka worst case): 176 | 177 | *159€* 178 | 179 | You should be able to get lots of the parts cheaper tho, as I mentioned, eBay is a great 180 | place to check. 181 | 182 | 183 | *** Tools 184 | 185 | - a soldering iron 186 | 187 | - a good, sturdy knife 188 | 189 | - a 3D printer (does this count as tool? Kind of I guess) 190 | 191 | - various screwdrivers 192 | 193 | - lots of glue (not sure if that's a tool either...) 194 | 195 | - pink nail polish (okay, that's really not a tool but you'll need it) 196 | 197 | - a foot file (yep, that's what I use to smoothen 3D prints (and only to 198 | smoothen 3D prints), don't judge) 199 | 200 | And again: if you don't have this stuff at home this can get quite expensive. 201 | 202 | So, as with many other "cheap weekend projects", the PinkPad is only cheap 203 | if you already have most of the stuff. (It's still awesome tho) 204 | 205 | *** 3D printed parts 206 | 207 | #+BEGIN_EXPORT html 208 |
    209 | the VTech Lern- und Musiklaptop 210 | 211 |
    Figure 1: VTech Lern- und Musiklaptop
    212 |
    213 | #+END_EXPORT 214 | 215 | As you can see from the picture of the VTech laptop, there's not really 216 | enough space for a display or a keyboard with a reasonable size. 217 | 218 | So I removed those parts of the case completely (that's where the sturdy knife 219 | comes into play) and replaced them with 3D printed parts. 220 | 221 | I'm not exactly good at 3D design, but the parts are so simple that it 222 | won't be noticed (okay, it /is/ noticeable but good enough for now). 223 | 224 | **** STLs 225 | 226 | The three STL files are [[https://github.com/bitshiftcrazy/pinkpad-3D][here]] 227 | 228 | And to give you an idea of what they're supposed to do/where they're supposed to go, 229 | here's what they look like: 230 | 231 | 1. The part for the LCD: 232 | #+BEGIN_EXPORT html 233 |
    234 | a screenshot of the STL for the display part 235 | 236 |
    Figure 1:
    237 |
    238 | #+END_EXPORT 239 | 240 | 2. The middle part: 241 | #+BEGIN_EXPORT html 242 |
    243 | a screenshot of the STL for the middle part 244 | 245 |
    Figure 1:
    246 |
    247 | #+END_EXPORT 248 | 249 | You need this part if you use hardware (eg. an other Raspberry Pi than the Zero) 250 | to have more space in the top part. 251 | It goes between the part for the display and the pink part with the little bears 252 | on it. 253 | 254 | 3. The part for the keyboard: 255 | #+BEGIN_EXPORT html 256 |
    257 | a screenshot of the STL for the keyboard part 258 | 259 |
    Figure 1:
    260 |
    261 | #+END_EXPORT 262 | 263 | **** Print Settings 264 | 265 | It's not exactly a challenging print, there's really not much that could go wrong. 266 | The printing speed can be high, there's no need for support. 267 | 268 | However, to get a pretty result that doesn't look too coarse compared to the rest 269 | of the Pinkpad, set a layer height smaller than 0.15mm. 270 | I printed it with white PLA. 271 | 272 | Afterwards the edges of the prints need some smoothing with sandpaper (or a foot file...seriously, that's 273 | so much more convenient). 274 | 275 | *** Software 276 | 277 | After finding/collecting/buying/borrowing/stealing/whatever (I don't judge...) all the parts, 278 | it's time to take care of the software. 279 | 280 | *** Install Arch Linux ARM 281 | 282 | Since the Raspberry Pi has an arm processor you need an arm image from 283 | [[https://archlinuxarm.org/][Arch Linux ARM]]. I won't write a detailed guide on installing Arch Linux 284 | here (the [[https://archlinuxarm.org/platforms/armv6/raspberry-pi][instructions on the Arch Linux ARM website]] are quite good), just a quick summary. 285 | I'll also just assume that you setup your SD card from Linux. 286 | 287 | As root: 288 | 289 | 1. Partition your SD card (eg. with /parted/ or /fdisk/): 290 | - create two partitions, the first with type W95 FAT32 291 | 2. Create filesystems: 292 | - FAT filesystem for the first partition 293 | #+BEGIN_SRC shell 294 | mkfs.vfat /dev/sdX1 295 | #+END_SRC 296 | - ext4 for the second 297 | #+BEGIN_SRC bash 298 | mkfs.ext4 /dev/sdX2 299 | #+END_SRC 300 | 3. Mount the filesystems 301 | #+BEGIN_SRC bash 302 | mkdir boot root 303 | mount /dev/sdX1 boot 304 | mount /dev/sdX2 root 305 | #+END_SRC 306 | 4. Download and extract the image 307 | #+BEGIN_SRC bash 308 | wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz 309 | bsdtar -C root -xpf ArchLinuxARM-rpi-latest.tar.gz 310 | sync 311 | mv root/boot/* boot 312 | #+END_SRC 313 | 5. Unmount the partitions 314 | #+BEGIN_SRC bash 315 | umount boot root 316 | #+END_SRC 317 | 318 | Now put the SD card into your Pi, power up, log in (default user and password 319 | are /alarm/ and /alarm/ or /root/ and /root/ for roo, so better change that 320 | immediately ;)) 321 | 322 | Then initialise the pacman keyring and populate the package signing keys 323 | 324 | #+BEGIN_SRC bash 325 | pacman-key --init 326 | pacman-key --populate archlinuxarm 327 | #+END_SRC 328 | 329 | Yeah well, I said I wouldn't write a detailed guide but...there's actually not 330 | much more detail needed, that's basically it =¯\_(ツ)_/¯= 331 | 332 | **** Connect to WiFi 333 | 334 | And if you're planning to connect to WiFi (I guess you do): 335 | 336 | 1. Create/ /etc/systemd/network/wlan0.network// with: 337 | #+BEGIN_SRC bash 338 | [Match] 339 | Name=wlan0 340 | 341 | [Network] 342 | DHCP=yes 343 | #+END_SRC 344 | 345 | 2. Generate a basic configuration file with /wpa_passphrase/ 346 | #+BEGIN_SRC bash 347 | wpa_passphrase SSID PASSPHRASE > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf 348 | #+END_SRC 349 | 350 | 3. Enable and start wpa, restart networkd 351 | #+BEGIN_SRC bash 352 | systemctl enable wpa_supplicant@wlan0 353 | systemctl start wpa_supplicant@wlan0 354 | systemctl restart systemd-networkd.service 355 | #+END_SRC 356 | 357 | **** Get the LCD touchscreen to work 358 | 359 | Add these lines to //boot/config.txt/: 360 | 361 | #+BEGIN_SRC 362 | max_usb_current=1 363 | hdmi_group=2 364 | hdmi_mode=87 365 | hdmi_cvt 800 480 60 6 0 0 0 366 | hdmi_drive=1 367 | #+END_SRC 368 | 369 | This should be enough, but depending on your LCD touchscreen model it could be 370 | that you have to add some lines in /99-fbturbo.conf/, some also need drivers installed. 371 | 372 | **** Add some nice and/or essential programs 373 | 374 | I don't know if you noticed but I'm slightly too excited about Emacs, so 375 | guess what I installed first ;) 376 | 377 | Apart from Emacs I installed 378 | - /herbstluftwm/ as window manager 379 | - /gnome-terminal/ 380 | - /LXDM/ as display manager 381 | - the web browser /Dillo/ 382 | - /neofetch/ and /cmatrix/ for showing off purposes 383 | 384 | And some other, less interesting stuff (you know, git and so on). 385 | But I guess if you really want a PinkPad 386 | you know what software you want to have on it. 387 | 388 | *** Manicure for the keyboard 389 | 390 | #+BEGIN_EXPORT html 391 |
    392 | before and after pic of the keyboard 393 | 394 |
    Figure 1: The evolution of a keyboard
    395 |
    396 | #+END_EXPORT 397 | 398 | As you might have noticed the Rii keyboard is black. And unfortunately 399 | that ruins the hardcore, badass aesthetic of my soft pink PinkPad. 400 | 401 | So I had to find a way to change that. 402 | 403 | I tried various paints (even one specifically made for rubber) and varnishes, 404 | I even thought about 3D printing the cover for the keyboard. 405 | But in the end a quite simple and unexpected solution 406 | turned out to be the best: nail polish. 407 | 408 | Luckily I got some help from Daniela (yep, the same one who wrote that 409 | awesome [[https://medium.com/better-programming/dark-mode-and-css-variables-ed6dc250232c][Dark Mode and CSS variables]] Medium article I mentioned in the 410 | previous post). 411 | 412 | Daniela performed several scientific nail polish experiments on rubber or 413 | rubber-like surfaces to test which polish consistence works best. 414 | 415 | The corresponding research paper is not yet published but I can already tell 416 | you the results: the best option is a strong covering (not creamy or pearly) pink 417 | nail polish by Essie together with a clear top coat. 418 | 419 | #+BEGIN_EXPORT html 420 |
    421 | PinkPad keyboard and nail polish 422 | 423 |
    Figure 1: Manicure for the keyboard
    424 |
    425 | #+END_EXPORT 426 | 427 | Different from the other things I tried, the nail polish still lasts without 428 | a scratch (and different from the other things I can use it for my nails as well) 429 | 430 | /Fun fact: my nails never got as much attention, care or fancy stuff like a top 431 | coat but this will change/ 432 | 433 | To cover the touch-part of the keyboard while still being able to use it I took 434 | a thin white foil, the rest of the keyboard (the frame part) is painted with white 435 | acrylic varnish. 436 | 437 | *** Soldering the switch 438 | 439 | The Power Boost by Adafruit unfortunately doesn't come with a switch, 440 | but it's easy to add one. 441 | 442 | I used a "normal" (whatever that's supposed to mean here) slide switch with 443 | three pins. 444 | 445 | There won't be any power on the switch, it's only signalling to the Power Boost 446 | via the ENABLE pin. 447 | 448 | Just solder the pins of your switch to *EN*, *VS* and *GND*. (If you have a switch with 449 | only 2 pins, connect them to *EN* and *GND*) 450 | 451 | Unfortunately I don't have pics of this incredibly exciting process, but 452 | there are detailed instructions [[https://learn.adafruit.com/adafruit-powerboost-1000c-load-share-usb-charge-boost/assembly][on the Adafruit website]]. 453 | 454 | *** Assembly 455 | 456 | That's the easiest and yet most annoying part: putting the 457 | parts together. 458 | 459 | Basically this can be summarized in a few steps: 460 | 461 | 1. Brute force the parts of the case away where the display and the keyboard 462 | are supposed to go. Don't be gentle. It won't be gentle with you either. 463 | 464 | #+BEGIN_EXPORT html 465 |
    466 | my injured finger 467 | 468 |
    Figure 1: My battle wounds.
    469 |
    470 | #+END_EXPORT 471 | 472 | 2. Glue...everything: glue the middle part well...to the middle, the keyboard 473 | part to the bottom of the laptop and yourself to basically everything that 474 | gets in your way. The part for the display is screwed onto the back part 475 | of the cover later. 476 | 477 | #+BEGIN_EXPORT html 478 |
    479 | a mutilated pinkpad with slaughter tools 480 | 481 |
    Figure 1: The battleground.
    482 |
    483 | #+END_EXPORT 484 | 485 | 3. Raspberry Pi, USB hub and display are supposed to go into the top part, 486 | keyboard and battery into the bottom. 487 | Squeeze that entanglement of Raspberry Pi, USB hub, various cables and 488 | display into the top part. Everything is allowed as long as in the end 489 | - the switch is on the same side as the hole for the switch 490 | - the connection for the charger is on the side of charger hole 491 | - the cable for the battery finds its way through the little hole 492 | in the middle down to the bottom part 493 | #+BEGIN_EXPORT html 494 |
    495 | the top part of the pinkpad 496 | 497 |
    Figure 1: PinkPad intestines.
    498 |
    499 | #+END_EXPORT 500 | 501 | No squeezing should be necessary for the keyboard and battery, if you 502 | were brutal enough while brute forcing your way with the knife, there 503 | should be enough room in the bottom part. 504 | Otherwise repeat step 1. 505 | 506 | #+BEGIN_EXPORT html 507 |
    508 | the bottom part of the pinkpad 509 | 510 |
    Figure 1: More PinkPad guts.
    511 |
    512 | #+END_EXPORT 513 | 514 | If everything is in place (or at least inside), close the laptop 515 | and screw in some screws (3 is the minimum, I tried) 516 | 517 | #+BEGIN_EXPORT html 518 |
    519 | a sloth and a PinkPad 520 | 521 |
    Figure 1: Black Metal Sloth and PinkPad.
    522 |
    523 | #+END_EXPORT 524 | 525 | And if you have no idea what I was talking about, just look at the pics, it should 526 | make some sense then. 527 | 528 | Last but not least: add some stickers because as everyone knows each sticker will 529 | add 1MB RAM. 530 | 531 | AND: MAKE ABSOLUTELY SURE you tell everyone you use Arch Linux on that laptop. 532 | 533 | That's it. 534 | The birth story of the PinkPad (I didn't come up with that name btw, someone on 535 | Instagram suggested it ;)). 536 | 537 | I'm really looking forward to finally being one of the cool kids at conferences 538 | and other occasions ;) 539 | 540 | And as the "v1" in the title suggests: it's my first attempt and a work in progress, many parts are somewhat "hacky" and need improvement. 541 | 542 | There are some things I'd like to improve: 543 | 544 | - I plan to 3D print the key-caps for the keyboard with pink flex filament 545 | - I'd like to improve the 3D printed parts, make them smoother (and I 546 | also tried to paint them which didn't go so well), try to get them to 547 | fit together better 548 | - get audio somehow 549 | - get the battery status 550 | - repair the mouse (yes, that little paw used to be a mouse, but it broke :'() 551 | 552 | But for now I'm happy with my brutal-hardcore-black-metal-badass PinkPad. 553 | 554 | #+BEGIN_EXPORT html 555 |
    556 | PinkPad in front of screens 557 | 558 |
    Figure 1: PinkPad in flex mode
    559 |
    560 | #+END_EXPORT 561 | -------------------------------------------------------------------------------- /website/posts/emacs_themes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Emacs Themes 6 | 7 | 8 |

    Creating Emacs custom themes

    [TL;DR] It's important to feel at home in your beloved editor, so this post is 9 | about creating custom themes in Emacs. 10 |
    11 | 12 |

    Why?

    Apart from the fact that of course we want Emacs to look pretty the 13 | right theme can help to increase your productivity and optimise your 14 | coding workflow: in the best case a theme makes it easy to read your code and 15 | spot mistakes while being friendly for your eyes. 16 |

    17 | 18 |

    How?

    Creating the theme

    Creating themes in Emacs is really easy :) 19 | Just type M-x customize-create-theme (for Emacs newbies: "M" means the alt key). 20 | You'll be asked if you want to have common faces inserted into your theme, 21 | that's pretty handy. Then you can choose a creative title and write a description 22 | for your new theme: 23 |

    24 | 25 |

    26 | 27 |
    28 | create theme screenshot 29 | 30 |
    Figure 1: A screenshot of the customize theme buffer
    31 |
    32 |

    Probably you also want to add additional faces for the modes you use, 33 | you can do so with the "Insert Additional Face" option close to the 34 | end of the buffer: 35 |

    36 | 37 |

    38 | 39 |
    40 | create theme screenshot 41 | 42 |
    Figure 1: A screenshot of the customize theme buffer
    43 |
    44 | 45 | 46 |

    Themes don't only contain faces but also variables, you can set them in 47 | this bufffer, too. 48 |

    49 | 50 |

    Selecting the theme

    When your outburst of creativity is over and you're done with customizing your 51 | theme save it by either using the "Save Theme" button or typing C-x C-s (for Emacs 52 | newbies: "C" means the control key). 53 | The theme is saved as "your-creative-theme-name"-theme.el in the directory 54 | specified by the variable custom-theme-directory. So if you haven't changed 55 | that variable you'll probably find your new theme in the ~/.emacs.d/ directory. 56 |

    57 | 58 |

    To select the eyecandy you just created as your new theme type M-x customize-themes 59 | or (if your prefer to use the Menu Bar) click Options->Customize Emacs->Custom Themes. 60 | You'll find yourself in the Custom Themes buffer where you can select one or more 61 | themes. 62 |

    63 | 64 |

    Emacs looks for the themes displayed in this buffer in custom-theme-directory and 65 | etc/themes of your Emacs installation (that's where the themes that come with Emacs 66 | are located). If you want to add additional directories just add them to the 67 | list "custom-theme-load-path" (for example sth. like (add-to-list 68 | 'custom-theme-load-path "~/.my-special-theme-dir"...). 69 |

    70 | 71 |

    Save the theme(s) with the "Save Theme Settings" button or by typing C-x C-s. 72 |

    73 | 74 |

    75 | 76 |
    77 | create theme screenshot 78 | 79 |
    Figure 1: A screenshot of the customize theme buffer
    80 |
    81 | 82 | 83 |

    84 | 85 |

    Alternatively you can load a theme in your current session by typing M-x load-theme. 86 | (or if it's been loaded before with M-x enable-theme, guess the command for disabling 87 | it ;)). 88 |

    89 | 90 |

    Note that loading a theme executes Lisp code, so make sure you know what you're loading. 91 |

    92 | 93 |

    I'm lazy

    The method described above is not that much effort ;) But if it's 94 | still too much effort (and I totally understand that) for you you could 95 | use the Emacs Theme Creator by Martin Haesler: 96 |

    97 | 98 |

    99 | 100 |
    101 | create theme screenshot 102 | 103 |
    Figure 1: A screenshot of the customize theme buffer
    104 |
    105 | 106 | 107 |

    108 | 109 |

    And a link to it. 110 |

    111 | 112 | 113 | 114 |

    What else?

    Since themes in Emacs are simply lisp files you can also edit them directly. 115 | You should have a call to deftheme at the beginning of your file and provide-theme 116 | at the end. 117 | The function custom-theme-set-faces contains your face settings, if you 118 | have custom variables you can set them in custom-theme-set-variables. 119 |

    120 | 121 |

    As an example, here's my cactus-theme (feel free to use it and add the faces you 122 | need): 123 |

    124 | 125 |
    (deftheme cactus
    126 |   "Cactus Theme")
    127 | 
    128 | (custom-theme-set-faces
    129 |  'cactus
    130 |  '(cursor ((t (:background "cadet blue"))))
    131 |  '(border ((t (:foreground "gray6"))))
    132 |  '(default ((t (:background "gray20" :foreground "light sea green"))))
    133 |  '(error ((t (:foreground "goldenrod" :weight bold))))
    134 |  '(match ((t (:background "gray31"))))
    135 |  '(mouse ((t (:foreground "goldenrod"))))
    136 |  '(region ((t (:background "cadet blue"))))
    137 |  '(scroll-bar ((t (:background "black" :foreground "cadet blue"))))
    138 |  '(tool-bar ((t (:background "cadet blue" :foreground "black" :box (:line-width 1 :style released-button)))))
    139 |  '(tooltip ((t (:inherit variable-pitch :background "pale goldenrod" :foreground "black"))))
    140 |  '(warning ((t (:foreground "deep sky blue" :weight bold))))
    141 | 
    142 | 
    143 |  '(beacon-fallback-background ((t (:background "goldenrod"))))
    144 |  '(bold ((t (:foreground "light sea green" :weight bold))))
    145 | 
    146 |  '(comint-highlight-input ((t (:foreground "dark gray" :weight bold))))
    147 |  '(comint-highlight-prompt ((t (:foreground "dark goldenrod"))))
    148 | 
    149 |  '(company-echo-common ((t (:foreground "white smoke"))))
    150 |  '(company-preview ((t (:background "light sky blue" :foreground "dim gray"))))
    151 |  '(company-preview-common ((t (:inherit company-preview :foreground "goldenrod"))))
    152 |  '(company-preview-search ((t (:inherit company-preview :background "sky blue"))))
    153 |  '(company-scrollbar-bg ((t (:background "light gray"))))
    154 |  '(company-scrollbar-fg ((t (:background "dim gray"))))
    155 |  '(company-template-field ((t (:background "royal blue" :foreground "white"))))
    156 |  '(company-tooltip ((t (:background "royal blue" :foreground "white smoke"))))
    157 |  '(company-tooltip-annotation ((t (:foreground "light blue"))))
    158 |  '(company-tooltip-common ((t (:foreground "cyan2"))))
    159 |  '(company-tooltip-selection ((t (:background "light blue"))))
    160 | 
    161 |  '(compilation-mode-line-exit ((t (:inherit compilation-info :foreground "blue3" :weight bold))))
    162 |  '(compilation-mode-line-fail ((t (:inherit compilation-error :foreground "dark cyan" :weight bold))))
    163 | 
    164 |  '(custom-button ((t (:background "cadet blue" :foreground "black" :box (:line-width 2 :style released-button)))))
    165 |  '(custom-button-pressed-unraised ((t (:inherit custom-button-unraised :foreground "dark gray"))))
    166 |  '(custom-invalid ((t (:background "blue1" :foreground "white smoke"))))
    167 |  '(custom-rogue ((t (:background "black" :foreground "white"))))
    168 |  '(custom-state ((t (:foreground "cornflower blue"))))
    169 |  '(custom-modified ((t (:background "steel blue" :foreground "white"))))
    170 |  '(custom-themed ((t (:background "cornflower blue" :foreground "white"))))
    171 | 
    172 |  '(diary ((t (:foreground "goldenrod"))))
    173 | 
    174 |  '(escape-glyph ((t (:foreground "medium aquamarine"))))
    175 |  '(font-lock-builtin-face ((t (:foreground "medium aquamarine"))))
    176 |  '(font-lock-comment-face ((t (:foreground "gray40"))))
    177 |  '(font-lock-constant-face ((t (:foreground "aquamarine"))))
    178 |  '(font-lock-function-name-face ((t (:foreground "cyan3"))))
    179 |  '(font-lock-keyword-face ((t (:foreground "dark goldenrod"))))
    180 |  '(font-lock-negation-char-face ((t (:foreground "cyan"))))
    181 |  '(font-lock-string-face ((t (:foreground "dark gray"))))
    182 |  '(font-lock-type-face ((t (:foreground "dark goldenrod"))))
    183 |  '(font-lock-variable-name-face ((t (:foreground "medium aquamarine"))))
    184 |  '(font-lock-warning-face ((t (:foreground "deep sky blue"))))
    185 |  '(fringe ((t (:background "gray12"))))
    186 |  '(haskell-constructor-face ((t (:foreground "DarkGoldenrod3"))))
    187 |  '(header-line ((t (:inherit mode-line :background "grey20" :foreground "light gray" :box nil))))
    188 |  '(helm-action ((t (:foreground "cyan4" :underline t))))
    189 |  '(helm-buffer-archive ((t (:foreground "goldenrod"))))
    190 |  '(helm-buffer-directory ((t (:background "LightGray" :foreground "gray15"))))
    191 |  '(helm-buffer-not-saved ((t (:foreground "goldenrod"))))
    192 |  '(helm-buffer-process ((t (:foreground "dark goldenrod"))))
    193 |  '(helm-buffer-saved-out ((t (:background "black" :foreground "dark gray"))))
    194 | 
    195 |  '(helm-candidate-number ((t (:background "gray" :foreground "black"))))
    196 |  '(helm-ff-denied ((t (:background "black" :foreground "gold"))))
    197 |  '(helm-ff-directory ((t (:background "LightGray" :foreground "orange4"))))
    198 |  '(helm-ff-executable ((t (:foreground "gainsboro"))))
    199 |  '(helm-ff-invalid-symlink ((t (:background "steel blue" :foreground "black"))))
    200 |  '(helm-ff-prefix ((t (:background "dark goldenrod" :foreground "black"))))
    201 |  '(helm-ff-socket ((t (:foreground "gold"))))
    202 |  '(helm-ff-suid ((t (:background "dark goldenrod" :foreground "white"))))
    203 |  '(helm-grep-file ((t (:foreground "cyan" :underline t))))
    204 |  '(helm-grep-finish ((t (:foreground "gainsboro"))))
    205 |  '(helm-header-line-left-margin ((t (:background "dark goldenrod" :foreground "black"))))
    206 |  '(helm-locate-finish ((t (:foreground "gainsboro"))))
    207 |  '(helm-mode-prefix ((t (:background "gold" :foreground "black"))))
    208 |  '(helm-prefarg ((t (:foreground "gainsboro"))))
    209 |  '(helm-resume-need-update ((t (:background "gainsboro"))))
    210 |  '(helm-selection ((t (:background "cadet blue" :distant-foreground "black"))))
    211 |  '(helm-separator ((t (:foreground "dark goldenrod"))))
    212 |  '(helm-visible-mark ((t (:background "cadet blue" :foreground "black"))))
    213 |  '(highlight ((t (:background "dark cyan" :foreground "black"))))
    214 |  '(info-node ((t (:foreground "light gray" :slant italic :weight bold))))
    215 |  '(isearch ((t (:background "light sea green" :foreground "white"))))
    216 |  '(lazy-highlight ((t (:background "dim gray"))))
    217 |  '(link ((t (:foreground "deep sky blue" :underline t))))
    218 |  '(link-visited ((t (:inherit link :foreground "steel blue"))))
    219 |  '(minibuffer-prompt ((t (:foreground "dark cyan"))))
    220 |  '(mode-line ((t (:background "cadet blue" :foreground "black" :box (:line-width -1 :style released-button)))))
    221 |  '(mode-line-buffer-id ((t (:foreground "pale goldenrod" :weight bold))))
    222 |  '(mode-line-highlight ((t (:box (:line-width 2 :color "medium aquamarine" :style released-button)))))
    223 |  '(mode-line-inactive ((t (:inherit mode-line :background "PaleTurquoise4" :foreground "grey80" :box (:line-width -1 :color "grey40") :weight light))))
    224 |  '(org-agenda-calendar-event ((t (:foreground "dark cyan"))))
    225 |  '(org-agenda-calendar-sexp ((t (:foreground "dark cyan"))))
    226 |  '(org-agenda-clocking ((t (:background "dim gray" :foreground "black"))))
    227 |  '(org-agenda-column-dateline ((t (:background "dark cyan" :foreground "gray"))))
    228 |  '(org-agenda-current-time ((t (:foreground "goldenrod"))))
    229 |  '(org-agenda-date-weekend ((t (:foreground "deep sky blue" :weight bold))))
    230 |  '(org-agenda-done ((t (:foreground "goldenrod"))))
    231 |  '(org-checkbox ((t (:foreground "cyan" :weight bold))))
    232 |  '(org-checkbox-statistics-done ((t (:foreground "gold" :weight bold))))
    233 |  '(org-checkbox-statistics-todo ((t (:foreground "gainsboro" :weight bold))))
    234 |  '(org-date-selected ((t (:foreground "dark gray" :inverse-video t))))
    235 |  '(org-done ((t (:foreground "cyan" :weight bold))))
    236 |  '(org-drawer ((t (:foreground "dark gray"))))
    237 |  '(org-formula ((t (:foreground "gold3"))))
    238 |  '(org-level-1 ((t (:foreground "light sea green"))))
    239 |  '(org-level-2 ((t (:foreground "cyan"))))
    240 |  '(org-level-3 ((t (:foreground "goldenrod"))))
    241 |  '(org-level-4 ((t (:foreground "medium aquamarine"))))
    242 |  '(org-mode-line-clock-overrun ((t (:inherit mode-line :background "gold"))))
    243 |  '(org-scheduled ((t (:foreground "medium spring green"))))
    244 |  '(org-scheduled-today ((t (:foreground "turquoise1"))))
    245 |  '(org-todo ((t (:foreground "gold" :weight bold))))
    246 | 
    247 |  '(scroll-bar ((t (:background "black" :foreground "cadet blue"))))
    248 |  '(show-paren-mismatch ((t (:background "dark goldenrod" :foreground "white"))))
    249 |  '(success ((t (:foreground "dark turquoise" :weight bold))))
    250 | 
    251 |  '(trailing-whitespace ((t (:background "dark goldenrod"))))
    252 |  '(tty-menu-disabled-face ((t (:background "dark cyan" :foreground "lightgray"))))
    253 |  '(tty-menu-enabled-face ((t (:background "dark cyan" :foreground "yellow" :weight bold))))
    254 |  '(tty-menu-selected-face ((t (:background "DarkSlateGray3" :foreground "black"))))
    255 |  '(vimish-fold-overlay ((t (:background "dim gray" :foreground "cadet blue"))))
    256 |  '(widget-button-pressed ((t (:foreground "gray"))))
    257 |  '(widget-documentation ((t (:foreground "cyan"))))
    258 |  '(window-divider ((t (:foreground "gray15")))))
    259 | 
    260 | (provide-theme 'cactus)
    261 | 
    262 | 
    263 |

    264 |
    Made with Emacs :) 265 |

    Disclaimer 266 |

    267 | 268 | --------------------------------------------------------------------------------