website

Personal website
git clone https://github.com/michaelneuper/website.git
README | Files | Log | Refs

commit a024e8a8f92a81945140ea4a249d9847ac7351ab
parent c538a852cd908c254f40db861989f8eed304b67a
Author: Michael Neuper <michael@michaelneuper.com>
Date:   Wed,  1 Nov 2023 20:01:41 +0200

Merge pull request #5 from michaelneuper/texify2-theme

Merge Texify2 theme
Diffstat:
M.gitmodules | 3+++
ATODO.txt | 5+++++
Mconfig.toml | 153++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------
Mcontent/_index.md | 20+++++++-------------
Acontent/about.md | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mcontent/pages/library.md | 35+++++++++++++++++++++++------------
Mcontent/pages/software.md | 2+-
Acontent/post/best-firefox-extensions.md | 174+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/post/buffer-overflow.md | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/post/enable-monitor-mode-on-tp-link.md | 123+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/post/how-to-create-your-own-website.md | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rcontent/posts/optimizing-my-workflow.md -> content/post/optimizing-my-workflow.md | 0
Acontent/post/read-more.md | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/post/replace-jupyter-notebook-with-emacs-org-mode.md | 293+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/post/stop-using-proprietary-software.md | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/post/turning-a-window-manager-into-a-desktop-environment.md | 228+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/post/what-linux-packaging-format-to-use.md | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dcontent/posts/best-firefox-extensions.md | 209-------------------------------------------------------------------------------
Dcontent/posts/buffer-overflow.md | 91-------------------------------------------------------------------------------
Dcontent/posts/enable-monitor-mode-on-tp-link.md | 137-------------------------------------------------------------------------------
Dcontent/posts/how-to-create-your-own-website.md | 131-------------------------------------------------------------------------------
Dcontent/posts/read-more.md | 62--------------------------------------------------------------
Dcontent/posts/replace-jupyter-notebook-with-emacs-org-mode.md | 324-------------------------------------------------------------------------------
Dcontent/posts/stop-using-proprietary-software.md | 63---------------------------------------------------------------
Dcontent/posts/turning-a-window-manager-into-a-desktop-environment.md | 247-------------------------------------------------------------------------------
Dcontent/posts/what-linux-packaging-format-to-use.md | 136-------------------------------------------------------------------------------
Dlayouts/404.html | 11-----------
Alayouts/_default/_markup/render-codeblock-mermaid.html | 4++++
Alayouts/_default/baseof.html | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mlayouts/_default/list.html | 69+++++++++++++++++++++++++++++++++++----------------------------------
Mlayouts/_default/rss.xml | 59++++++++++++++++++++++++++++++++++++-----------------------
Mlayouts/_default/single.html | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------
Alayouts/categories/terms.html | 17+++++++++++++++++
Alayouts/index.html | 33+++++++++++++++++++++++++++++++++
Alayouts/partials/footer.html | 8++++++++
Dlayouts/partials/head_custom.html | 26--------------------------
Mlayouts/partials/header.html | 50+++++++++++++++++---------------------------------
Alayouts/robots.txt | 2++
Alayouts/tags/terms.html | 17+++++++++++++++++
Mnetlify.toml | 22++++++++++++++++++++--
Aresources/_gen/assets/scss/sass/main.scss_17d836d605e0c91e6275eb2120c9a238.content | 2++
Aresources/_gen/assets/scss/sass/main.scss_17d836d605e0c91e6275eb2120c9a238.json | 2++
Aresources/_gen/assets/scss/sass/main.scss_5481928335aee5e714c50847675a4f4e.content | 0
Aresources/_gen/assets/scss/sass/main.scss_5481928335aee5e714c50847675a4f4e.json | 2++
Dstatic/css/solarized.css | 19-------------------
Astatic/css/styles.css | 361+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Astatic/css/syntax.css | 722+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dstatic/css/theme-override.css | 323-------------------------------------------------------------------------------
Astatic/js/script.js | 27+++++++++++++++++++++++++++
Athemes/hugo-texify2 | 1+
50 files changed, 2955 insertions(+), 1971 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -4,3 +4,6 @@ [submodule "themes/hugo-classic"] path = themes/hugo-classic url = https://github.com/goodroot/hugo-classic.git +[submodule "themes/hugo-texify2"] + path = themes/hugo-texify2 + url = https://github.com/weastur/hugo-texify2.git diff --git a/TODO.txt b/TODO.txt @@ -0,0 +1,4 @@ +- Change dotted TOC border +- Change toc entried color in light mode +- Fix padding on posts +- Organise css +\ No newline at end of file diff --git a/config.toml b/config.toml @@ -1,57 +1,120 @@ -title = "Michael" -baseurl = "https://michaelneuper.com" -theme = "hugo-classic" -languageCode = "en-US" +baseURL = "https://michaelneuper.com" +disqusShortname = "" enableEmoji = true -footnotereturnlinkcontents = "↩" -ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"] - -[taxonomies] -category = "categories" -tag = "tags" - -[outputs] -home = ["RSS", "HTML"] - -[markup.goldmark.renderer] -unsafe = true - -[markup.highlight] -anchorLineNos = false -codeFences = true -guessSyntax = false -hl_Lines = "" -lineAnchors = "" -lineNoStart = 1 -lineNos = false -lineNumbersInTable = true -noClasses = true -style = "base16-solarized-dark" -tabWidth = 2 - -[permalinks] -post = "/post/:year/:month/:day/:slug/" +enableGitInfo = false +enableRobotsTXT = true +googleAnalytics = "G-BLX24KP7CS" +hasCJKLanguage = false +languageCode = "en" +rssLimit = 10 +theme = "hugo-texify2" +title = "Michael's Site" [[menu.main]] -name = "Categories" -url = "/categories/" +identifier = "post" +name = "Blog" +url = "/post/" weight = 1 [[menu.main]] -name = "Tags" -url = "/tags/" -weight = 2 - -[[menu.feed]] +identifier = "rss" name = "RSS" url = "/index.xml" +weight = 2 -[[menu.feed]] -name = "github" +[[menu.main]] +identifier = "github" +name = "GitHub" url = "https://github.com/michaelneuper" +weight = 3 + +[[menu.main]] +identifier = "contact" +name = "Contact" +url = "/pages/contact/" +weight = 4 + +[taxonomies] +tags = "tags" +categories = "categories" + +[markup] +defaultMarkdownHandler = "goldmark" +[markup.goldmark.renderer] +unsafe= true +[markup.highlight] +noClasses = false +[markup.tableOfContents] + endLevel = 6 + ordered = false + startLevel = 2 + +[author] +email = "michael@michaelneuper.com" +name = "Michael Neuper" [params] -custom_css = ["css/theme-override.css"] -favicon = "images/favicon.ico" -description = "" -footer = "Copyright © 2023 Michael Neuper | [Source](https://github.com/michaelneuper/website)" +title="Michael Neuper" +description = "Michael's Personal Website" +footnote = """ +<!-- Follow me on <a class=link href=https://github.com/michaelneuper target=_blank rel=noopener>GitHub</a> or +<a class=link href=/index.xml>RSS</a> --> +""" +keywords = ["michael", "neuper", "linux", "blog", "productivity"] +customCSS = ["css/styles.css", "css/syntax.css"] +customJS = ["js/script.js"] +dateFormat = "2 January 2006" +emphasisWithDots = true +toc = true +showWordCount = false +showReadingTime = true +rootFontSize = "105%" +math = true +enableDuckDuckGoSearchBox = true +numberedSubtitles = true + +[params.commentEngine] +code = """ +<script src="https://giscus.app/client.js" + data-repo="michaelneuper/website" + data-repo-id="R_kgDOIjPNaQ" + data-category="General" + data-category-id="DIC_kwDOIjPNac4CaklA" + data-mapping="pathname" + data-strict="0" + data-reactions-enabled="1" + data-emit-metadata="0" + data-input-position="top" + data-theme="https://github.com/michaelneuper/website/static/css/styles.css" + data-lang="en" + data-loading="lazy" + crossorigin="anonymous" + async> +</script> +""" + +[params.buymeacoffee] +code = """ +<script data-name="BMC-Widget" + data-cfasync="true" + src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js" + data-id="michaelneuper" + data-description="Like what I do? Buy me a coffee!" + data-message="" + data-color="#b58900" + data-position="Right" + data-x_margin="18" + data-y_margin="18" + crossorigin="anonymous"> +</script> +""" + +[params.sharingbuttons] +facebook = false +twitter = false +email = false +linkedin = false +reddit = false +whatsapp = false +hackernews = false +telegram = false diff --git a/content/_index.md b/content/_index.md @@ -2,10 +2,7 @@ title: "Home" --- -<img align="right" src="/images/badges/emacs.gif"> -<img align="right" src="/images/badges/sink_animated.gif"> - -## Hi, I'm Michael :wave: +## Hi, I'm Michael Welcome to my little piece of the internet! @@ -20,12 +17,8 @@ Thanks for stopping by! I hope you enjoy reading my articles and find them usefu ## Introduction -- :computer: [Programs I use and recommend](/pages/software/) -- :keyboard: [Key bindings I use](/pages/keybindings/) -- :books: [Personal library](/pages/library) -- :gift: [Donate via crypto](/pages/donate/) -- :e-mail: [Contact me](/pages/contact/) - ---- - -## Recent Posts +- [Programs I use and recommend](/pages/software/) +- [Key bindings I use](/pages/keybindings/) +- [Personal library](/pages/library) +- [Donate via crypto](/pages/donate/) +- [Contact me](/pages/contact/) +\ No newline at end of file diff --git a/content/about.md b/content/about.md @@ -0,0 +1,94 @@ ++++ +title = "About" +description = "A minimal, latex-style hugo theme for personal blogging" +date = "2023-06-20" +aliases = ["about-us", "about-texify2", "contact"] +author = "weastur" ++++ +A minimal, latex-style hugo theme for personal blogging. +The successor of the original [TeXify](https://github.com/queensferryme/hugo-theme-texify) + +<iframe src="https://ghbtns.com/github-btn.html?user=weastur&repo=hugo-texify2&type=star&count=false&size=large" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe> + +## Features + +- **Social sharing buttons** +- **Any comment engine (giscus, remark42, hyvor, etc.)** +- **Word Counter and Reading Time** +- **[Mermaid](https://mermaid.js.org) support** +- **DuckDuckGo search** +- **Configurable root font size** +- **Buymeacoffee widget** +- **Auto numbered subtitles** +- **Simplified config** +- **Hugo modules support** +- **Tested on Chrome, Safari, Edge, Firefox** +- [Disqus](https://disqus.com/) & Google Analytics included +- Responsive design for mobile devices +- Customize the site with your stylesheets +- Math equations powered by [KaTeX](https://katex.org/) +([MathJax](https://www.mathjax.org/) has been deleted) +- Minimal CSS, No JavaScript, Blazing Fast! + +\* Diff with the original texify is **bold** + +## Usage + +### Install as git submodule + +Install: + +```bash +git submodule add https://github.com/weastur/hugo-texify2.git themes/hugo-texify2 +echo "theme = 'hugo-texify2'" >> hugo.toml +``` + +Upgrade: + +```bash +git submodule foreach git pull origin master +``` + +### Install as hugo module + +Initialize hugo modules, if not done yet: + +```bash +hugo mod init github.com/<username>/<projectName> +``` + +add `[module]` section to your `hugo.toml`: + +```bash +[module] +[[module.imports]] + path = 'github.com/weastur/hugo-texify2' +``` + +load/update theme module + +```bash +hugo mod get -u github.com/weastur/hugo-texify2 +``` + +See [`hugo.toml`](https://github.com/weastur/hugo-texify2/blob/master/hugo.toml) +for an example configuration. + +## Development + +Install `pre-commit` + +```bash +pre-commit install +make dev +``` + +## Acknowledgement + +The following software inspires the design of this theme: + +- <https://github.com/vincentdoerig/latex-css> +- <https://github.com/7ma7X/HugoTeX> +- <https://theme.typora.io/theme/Academic/> +- <https://github.com/queensferryme/hugo-theme-texify> +- <https://sharingbuttons.io> diff --git a/content/pages/library.md b/content/pages/library.md @@ -8,9 +8,10 @@ I also don't necessarily like all the books I own. ## Philosophy -<img align="right" src="/images/books/critique-of-reason.jpg" width="100" height="300"> -<!-- <img align="right" src="/images/books/republic.jpg" width="100" height="150"> --> - +<div class="book-container"> + <img align="right" src="/images/books/critique-of-reason.jpg" width="100" height="150"> +</div> + - Aristotle - _The Art of Rhetoric_ - Aurelius, Marcus - _Meditations_ - Benatar, David - _Better Never to Have Been: The Harm of Coming into Existence_ @@ -18,6 +19,9 @@ I also don't necessarily like all the books I own. - Epicurus - _The Art of Happiness_ - Hitchens, Christopher - _Letters to a Young Contrarian_ - Hitchens, Christopher - _Mortality_ + <div class="book-container"> + <img align="right" src="/images/books/republic.jpg" width="100" height="150"> + </div> - Hume, David - _A Treatise of Human Nature_ - Kant, Immanuel - _Critique of Pure Reason_ - Mill, John Stuart - _Utilitarianism_ @@ -31,7 +35,9 @@ I also don't necessarily like all the books I own. ## Language -<img align="right" src="/images/books/lingua-latina.webp" width="100" height="150"> +<div class="book-container"> + <img align="right" src="/images/books/lingua-latina.webp" width="100" height="150"> +</div> - Caesar, Julius - _De Bello Civilli (**The Civil War**)_ - Caesar, Julius - _De Bello Gallico (**The Gallic War**)_ @@ -42,7 +48,9 @@ I also don't necessarily like all the books I own. ## General Science -<img align="right" src="/images/books/short-history.JPG" width="100" height="150"> +<div class="book-container"> + <img align="right" src="/images/books/short-history.JPG" width="100" height="150"> +</div> - Bryson, Bill - _A Short History of Nearly Everything_ - Darwin, Charles - _The Origin of Species_ @@ -51,8 +59,10 @@ I also don't necessarily like all the books I own. - Tyson, Neil deGrasse - _Astrophysics for People in a Hurry_ ## Computer Science - -<img align="right" src="/images/books/how-linux-works.jpg" width="100" height="150"> + +<div class="book-container"> + <img align="right" src="/images/books/how-linux-works.jpg" width="100" height="150"> +</div> - Ericson, Jon - _Hacking: The Art of Exploitation_ - Stallman, Richard M. - _Free Software, Free Society_ @@ -60,8 +70,10 @@ I also don't necessarily like all the books I own. - Zuboff, Shoshana- _The Age of Surveillance Capitalism_ ## Fiction - -<img align="right" src="/images/books/1984.jpg" width="100" height="150"> + +<div class="book-container"> + <img align="right" src="/images/books/1984.jpg" width="100" height="150"> +</div> - Danielewski, Mark Z. - _House of Leaves_ - Dick, Philip K. - _Do Androids Dream of Electric Sheep?_ @@ -74,11 +86,10 @@ I also don't necessarily like all the books I own. - Greene, Robert - _The 48 Laws of Power_ - Kahneman, Daniel - _Thinking, Fast and Slow_ - + ## Other - + - Chernev, Irving - _Logical Chess_ - LaBerge, Stephen - _Exploring the World of Lucid Dreaming_ - Ollam, Deviant- _Practical Lock Picking_ - Seirawan, Yasser - _Winning Chess Tactics_ - diff --git a/content/pages/software.md b/content/pages/software.md @@ -10,7 +10,7 @@ I use [arch](https://archlinux.org/), btw. **Terminal:** [Alactritty](https://alacritty.org/) on desktop and [iTerm2](https://iterm2.com/) on mac. -Nowadays i mostly use vterm or eshell in emacs. +Nowadays I mostly use vterm or eshell in emacs. **Shell:** [fish](https://fishshell.com/) on Linux and zsh on macOS and eshell emacs. diff --git a/content/post/best-firefox-extensions.md b/content/post/best-firefox-extensions.md @@ -0,0 +1,174 @@ +--- +title: "Best Firefox Extensions" +date: 2023-04-08T08:18:16+02:00 +categories: ['Listicles'] +tags: ['Productivity', 'Privacy'] +draft: false +--- + +Welcome to my comprehensive guide on the best Firefox extensions to supercharge your browsing experience! +As one of the most popular web browsers, Firefox offers a remarkable level of flexibility and customization through its vast extension ecosystem. +These extensions are like small add-ons that can enhance various aspects of your browsing, ranging from productivity and privacy to aesthetics and tailored experiences on platforms like YouTube and Reddit. + +## Productivity + +### [Tree Style Tab](https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/) +This extension provides the ability to work with tabs as "trees". + +New tabs opened from the current tab are automatically organized as "children" of the current tab. +Such "branches" are easily folded (collapsed) by clicking on the arrow shown in the "parent" tab, so you no longer need to suffer from too many visible tabs. +If you want, you can restructure the tree via drag and drop. + +![Tree style tab](https://addons.mozilla.org/user-media/previews/thumbs/275/275014.jpg?modified=1668096516) + +### [Simple Tab Groups](https://addons.mozilla.org/en-US/firefox/addon/simple-tab-groups/) +Simple Tab Groups works across browser instances/windows too. +If you select a group in another window, the selected window will jump to the foreground with the chosen group selected. You can even select the specific tab within that group in background browser windows. +![GIF example](https://user-images.githubusercontent.com/7843031/33828871-806ccf6e-de76-11e7-9a0e-1ddfb97e878d.gif) + + +### [Firefox Multi-Account Containers](https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/) +The Firefox Multi-Account Containers extension lets you carve out a separate box for each of your online lives – no more opening a different browser just to check your work email! + +![Multi-Account Containers](https://addons.mozilla.org/user-media/previews/thumbs/266/266159.jpg?modified=1643906676) + +### [DownThemAll!](https://addons.mozilla.org/en-US/firefox/addon/downthemall/) +DownThemAll will help you select, queue, sort and run your downloads faster. +It comes with advanced ways to select what links to download, and will remember your previous decisions so that you can queue more downloads with just One Click! + +Advanced users will also like using renaming masks, which let you automatically assign names (and even sub-folders within your downloads folder), fast-filtering or even custom, re-usable filters. + +![DownThemAll](https://addons.mozilla.org/user-media/previews/thumbs/224/224229.jpg?modified=1622132179) + +### [SingleFile](https://addons.mozilla.org/en-US/firefox/addon/single-file/) +SingleFile is an add-on for Firefox Desktop and Mobile that helps you to *save an entire webpage** including images, styling, frames, fonts etc. *as a single HTML file**. + +![SingleFile](https://addons.mozilla.org/user-media/previews/thumbs/235/235535.jpg?modified=1622133480) + +### [To Google Translate](https://addons.mozilla.org/en-US/firefox/addon/to-google-translate/) +This extension creates a context menu item in Firefox. +When you click on this menu item, the previously selected text is sent to Google Translate for translating or to Google TTS for listening pronunciation. +You can setup the default languages for translation on the options page. + +![To Google Translate](https://addons.mozilla.org/user-media/previews/thumbs/198/198330.jpg?modified=1622132267) + +## Privacy + +### [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/) +An efficient wide-spectrum content blocker. +Easy on CPU and memory. + +![uBlock Origin](https://addons.mozilla.org/user-media/previews/thumbs/238/238546.jpg?modified=1622132421) + +### [User-Agent Switcher and Manager](https://addons.mozilla.org/en-US/firefox/addon/user-agent-string-switcher/) +Spoof websites trying to gather information about your web navigation—like your browser type and operating system—to deliver distinct content you may not want. + +![User-Agent Switcher](https://addons.mozilla.org/user-media/previews/thumbs/188/188200.jpg?modified=1622132777) + +### [Privacy Badger](https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/) +Privacy Badger automatically learns to block invisible trackers. +Instead of keeping lists of what to block, Privacy Badger automatically discovers trackers based on their behavior. + +![Privacy Badger](https://addons.mozilla.org/user-media/previews/thumbs/171/171793.jpg?modified=1622132342) + +### [ClearURLs](https://addons.mozilla.org/en-US/firefox/addon/clearurls/) +This extension will automatically remove tracking elements from URLs to help protect your privacy when browsing through the Internet. + +![ClearURLs](https://addons.mozilla.org/user-media/previews/thumbs/231/231733.jpg?modified=1640781132) + +### [LocalCDN](https://addons.mozilla.org/en-US/firefox/addon/localcdn-fork-of-decentraleyes/) +LocalCDN is a web browser extension that emulates Content Delivery Networks to improve your online privacy. +It intercepts traffic, finds supported resources locally, and injects them into the environment. +All of this happens automatically, so no prior configuration is required. + +![LocalCDN](https://addons.mozilla.org/user-media/previews/full/271/271250.png?modified=1657374986) + +### [Facebook Container](https://addons.mozilla.org/en-US/firefox/addon/facebook-container/) +Facebook Container works by isolating your Facebook identity into a separate container that makes it harder for Facebook to track your visits to other websites with third-party cookies. + +![Facebook Container](https://addons.mozilla.org/user-media/previews/thumbs/235/235581.jpg?modified=1622133081) + +### [Google Container](https://addons.mozilla.org/en-US/firefox/addon/google-container/) +Google Container works by isolating your Google identity into a separate container that makes it harder for Google to track your visits to other websites with third-party cookies. + +It is a fork of the Facebook Container addon. + +## Quality of Life + +### [Auto Tab Discard](https://addons.mozilla.org/en-US/firefox/addon/auto-tab-discard/) +"Auto Tab Discard" is a lightweight browser extension that automatically reduces the amount of memory used by open but inactive tabs, helping to conserve battery life on portable devices by disabling JavaScript code and DOM events on discarded tabs. + +![Auto Tab Discard](https://addons.mozilla.org/user-media/previews/full/201/201762.png?modified=1622132901) + +### [I don't care about cookies](https://addons.mozilla.org/en-US/firefox/addon/istilldontcareaboutcookies/) +The EU regulations require that any website using tracking cookies must get user's permission before installing them. +These warnings appear on most websites until the visitor agrees with the website's terms and conditions. +Imagine how irritating that becomes when you surf anonymously or if you delete cookies automatically every time you close the browser. + +This add-on will remove these cookie warnings from almost all websites! You can report any website which still warns you about cookies: just click 'Report a cookie warning' from the extension menu (the brown cookie image next to your address bar). + +In most cases, the add-on just blocks or hides cookie related pop-ups. +When it's needed for the website to work properly, it will automatically accept the cookie policy for you (sometimes it will accept all and sometimes only necessary cookie categories, depending on what's easier to do). +It doesn't delete cookies. + +## Aesthetics + +### [Dark Reader](https://addons.mozilla.org/en-US/firefox/addon/darkreader/) +This eye-care extension enables night mode creating dark themes for websites on the fly. +Dark Reader inverts bright colors making them high contrast and easy to read at night. + +You can adjust brightness, contrast, sepia filter, dark mode, font settings and ignore-list. + +![Dark Reader](https://addons.mozilla.org/user-media/previews/thumbs/201/201069.jpg?modified=1638883247) + +## Social Platforms + +### YouTube + +#### [Enhancer for Youtube™](https://addons.mozilla.org/en-US/firefox/addon/enhancer-for-youtube/) +Built to get the most out of YouTube, this extension comes packed with all sorts of features that allow you, among other things, to manage ads as you wish, control the playback speed and the volume level with the mouse wheel, automate repetitive tasks such as selecting the appropriate playback quality, configure dozens of keyboard shortcuts to control YouTube like a pro, and much more... +Give it a try! +But be aware that you will never want to use YouTube without it again ;) + +![YouTube Enhancer](https://addons.mozilla.org/user-media/previews/thumbs/257/257216.jpg?modified=1668589063) + +#### [PocketTube](https://addons.mozilla.org/en-US/firefox/addon/youtube-subscription-groups/) +Using this simple extension you can create collections that seamlessly fit into YouTube layout. This is easy way to manage Youtube subscription / channels. + +This extension enables you to: +- Create group collections list on YouTube. +- Group YouTube subscription / channels to collections / group. One YouTube subscription / channel can has few collections +- Add custom icon for collection. Choice prepare icons or upload own one +- Show last YouTube videos by collections / group. Play all video by collections using YouTube playlist +- Auto sync your collections on Android/iOS/Firefox using Google drive and Chrome profile +- Integration in Youtube main page +- Filter video by category on Youtube feed subscriptions page +- Hide watched YouTube video +- Order by last YouTube activity, a-z, subscription count and custom +- Catch up your Youtube subscriptions + +![PocketTube](https://addons.mozilla.org/user-media/previews/thumbs/270/270578.jpg?modified=1655574773) + +#### [Return YouTube Dislike](https://addons.mozilla.org/en-US/firefox/addon/return-youtube-dislikes/) +Returns ability to see dislike statistics on youtube. + +![Return YouTube Dislike](https://addons.mozilla.org/user-media/previews/thumbs/263/263668.jpg?modified=1637785158) + +#### [SponsorBlock](https://addons.mozilla.org/en-US/firefox/addon/sponsorblock/) +Easily skip YouTube video sponsors. +When you visit a YouTube video, the extension will check the database for reported sponsors and automatically skip known sponsors. +You can also report sponsors in videos. + +![SponsorBlock](https://addons.mozilla.org/user-media/previews/thumbs/227/227750.jpg?modified=1622134672) + +### Reddit + +#### [Reddit Enhancement Suite](https://addons.mozilla.org/en-US/firefox/addon/reddit-enhancement-suite/) +Reddit Enhancement Suite (RES) is a suite of tools to enhance your Reddit browsing experience. + +![RES](https://addons.mozilla.org/user-media/previews/thumbs/238/238629.jpg?modified=1622132176) + +#### [Unreddit](https://addons.mozilla.org/en-US/firefox/addon/unreddit/) +Read removed Reddit comments. + +![Unreddit](https://addons.mozilla.org/user-media/previews/thumbs/218/218512.jpg?modified=1622134062) diff --git a/content/post/buffer-overflow.md b/content/post/buffer-overflow.md @@ -0,0 +1,83 @@ +--- +title: "Buffer Overflows: Keep Your Code Safe" +date: 2022-12-14T18:59:28+02:00 +categories: ['Articles'] +tags: ['Security', 'Programming'] +draft: false +--- + +A buffer overflow attack is a type of cyber attack in which an attacker attempts to write more data to a buffer (a temporary data storage area) in a computer's memory than the buffer is designed to hold. +This can cause the buffer to overflow, or exceed its maximum capacity, which can corrupt other parts of the computer's memory and allow the attacker to gain unauthorized access to the system. + +In this post we will explore more about how a buffer overflow attack works and how to prevent it. + +## Programming a Vulnerable Program + +Buffer overflows are a common security vulnerability in computer programs, especially those written in the C programming language. +In C, buffers are often used to store strings of characters, such as user input or file contents. +When a program receives input from a user or reads data from a file, it writes that data to a buffer. +If the amount of data is larger than the size of the buffer, the excess data will overflow into other parts of the computer's memory, potentially overwriting or corrupting other data. + +Lets write a basic program in C that is vulnerable to a buffer overflow attack. Load up your favourite text editor and create a file called `vuln.c`, then copy and paste the following: +``` c +#include <stdio.h> +#include <string.h> + +void vulnerable_function(char* input) { + char buffer[8]; + strcpy(buffer, input); + printf("The input is: %s\n", buffer); +} + +int main(int argc, char* argv[]) { + vulnerable_function(argv[1]); + + return 0; +} + +``` + +This program contains a function called `vulnerable_function()` that takes a string of characters as input. +The function declares a buffer called 'buffer' with a size of 8 characters. +It then uses the `strcpy()` function to copy the input string into the buffer. +Finally, it prints the contents of the buffer using the `printf()` function. + +To compile this code, we need a C compiler. +GCC (GNU Compiler Collection) is a fantastic C compiler and what I will use in this post. +<!-- , it is the standard C compiler for Unix-like systems like Linux and macOS. --> + +To compile the code and generate an executable file called `vuln`, you can run the following command: + +``` shell +gcc -o vuln vuln.c +``` + +To use gdb to debug the vuln program, you can use the following steps: + +1. Start gdb by running the `gdb` command. + +2. Load the vuln program into gdb by running the `file vuln` command. + +3. Run the program by running the `run` command. + +4. When the program stops at the beginning of the `main()` function, you can set a breakpoint at the beginning of the `vulnerable_function()` function by running the `break vulnerable_function` command. + +5. Run the program again by running the `run` command. This time, the program will stop at the breakpoint in the `vulnerable_function()` function. + +6. Step through the code line by line by running the `next` command. You can use the print command to print the values of variables and the `x` command to examine the contents of memory. + +7. When the program reaches the `strcpy()` function, you can see that the buffer overflows if the input string is longer than 8 characters. + +## Preventing Buffer Overflow Attacks + +To prevent buffer overflow attacks, it is important to carefully design and implement your code to avoid such vulnerabilities. Here are some best practices to follow: + +1. Use safe functions for handling strings and other data. In C, the `strncpy()` and `strncat()` functions are safer alternatives to `strcpy()` and `strcat()` because they allow you to specify the maximum number of characters to copy or concatenate. + +2. Avoid using `gets()`, which is a particularly dangerous function because it does not check the size of the input and can therefore easily cause a buffer overflow. Instead, use `fgets()` or `getline()`, which allow you to specify the maximum size of the input. + +3. Always check the return value of functions that handle strings or other data. If a function returns a value indicating that an error occurred or that the input was too large, you can take appropriate action, such as truncating the input or displaying an error message. + +4. Use secure coding practices, such as avoiding the use of hard-coded passwords, sanitizing user input to prevent SQL injection attacks, and using encryption to protect sensitive data. + +By following these best practices, you can help protect your code from buffer overflow attacks and keep your computer systems secure. diff --git a/content/post/enable-monitor-mode-on-tp-link.md b/content/post/enable-monitor-mode-on-tp-link.md @@ -0,0 +1,123 @@ +--- +title: "Enable Monitor Mode on TP-Link TL-WN722N" +date: 2022-12-16T13:07:05+02:00 +categories: ['Tutorials'] +tags: ['Networking', 'Hardware'] +draft: false +--- + +## TP-Link TL-WN722N _v1 vs v2/v3_ + +The TP-Link TL-WN722N is a wireless network interface controller (NIC) that allows a computer to connect to a wireless network. +There are three versions of this NIC: v1, v2, and v3. While all three versions are similar in many ways, there are some notable differences between them. + +One of the main differences between the TP-Link TL-WN722N v1 and v2/v3 is the chipset they use. +- The v1 version uses a `Atheros AR9271` chipset +- The v2/v3 versions use a `Realtek RTL8188EUS` chipset + +The Atheros chip supports monitor mode and packet injection out of the box, but the Realtek chip requires changing the drivers. + +## Enabling Monitor Mode + +### v1 + +Run the following command: +``` shell +sudo airmon-ng start wlan0 +``` + +That's it, you should see that your card is in monitor mode when running the following: +``` shell +sudo iwconfig | grep "Mode" +``` + +### v2/v3 + +#### Upgrade your system + +On Debian-based systems (like Kali): +``` shell +sudo apt update && apt upgrade +``` + +On Arch-based systems (like Blackarch): +``` shell +sudo pacman -Syu +``` + +Then reboot: +``` shell +sudo reboot +``` + +#### Install headers + +Debian-based: +``` shell +sudo apt install linux-headers-$(uname -r) +``` + +Arch-based: +``` shell +sudo pacman -S install linux-headers-$(uname -r) +``` + +#### Change the kernel module + +Remove the previous driver module: +``` shell +sudo rmmod r8188eu.ko +``` + +Blacklist the old module: +``` shell +sudo echo "blacklist r8188eu" > "/etc/modprobe.d/realtek.conf" +``` + +Clone the new driver: +``` shell +git clone https://github.com/aircrack-ng/rtl8188eus +``` + +Install the new driver module: +``` shell +cd rtl8188eus +``` +``` shell +make +``` +``` shell +sudo make install +``` + +Enable the new module: +``` shell +sudo modprobe 8188eu +``` + +Reboot: +``` shell +sudo reboot +``` + +#### Enable monitor mode + +Kill all airmon-ng processes: +``` shell +sudo airmon-ng check kill +``` + +Set adapter to monitor mode: +``` shell +sudo iwconfig wlan0 mode monitor +``` + +Bring the interface up: +``` shell +sudo ifconfig wlan0 up +``` + +Test to see if packet injection works: +``` shell +sudo aireplay-ng --test wlan0 +``` diff --git a/content/post/how-to-create-your-own-website.md b/content/post/how-to-create-your-own-website.md @@ -0,0 +1,122 @@ +--- +title: "How to Create Your Own Static Website in Under an Hour" +date: 2022-12-03T19:39:46+02:00 +categories: ['Tutorials'] +tags: ['Web Development'] +draft: false +--- + +Setting up your own static website can be a great way to showcase your personal brand, portfolio, or business online. +In this post, we'll walk through the process of setting up a static website using Hugo as the static site generator and Netlify as the hosting service. + +## Building The Site + +First, let's talk about what a static website is and why it's a good choice for many people. +A static website is a website that is built using only HTML, CSS, and JavaScript files. +These files are served to the user's web browser as-is, without the need for any server-side processing. +This makes static websites fast, secure, and easy to maintain. + +Hugo is a popular open-source static site generator that makes it easy to create and manage a static website. +It has a simple, easy-to-use interface and comes with a wide range of customizable templates and themes. + +To get started with Hugo, you'll need to download and install Hugo on your computer. + +1. Once you have Hugo installed, you can create a new website by running the following command in your terminal: + ``` shell + hugo new site SITE-NAME + ``` + This will create a new Hugo project in the current directory. + +2. Next, install git and initialize the directory as a git repository: + ``` shell + git init + ``` + Initializing the directory as a git repository is a useful way to keep track of changes and it will also be needed later when we upload our site to GitHub. + +3. Download a theme for you website from https://themes.gohugo.io/. A hugo theme is a template that defines the look and feel of your site. Add a theme to your site by running the following command in the root directory of your site: + ``` shell + git submodule add https://github.com/THEME_NAME/ themes/ + ``` + This will create a folder in the `/themes/` directory where your theme is stored. + +3. Open the `config.toml` file and edit according to your theme. + +4. Create content for your website by using the `hugo new` command. e.g. + ``` shell + hugo new posts/my-first-post.md + ``` + This will create a markdown file under the `/content/posts/` directory where you can edit your content. Hugo uses Markdown files for content, which makes it easy to write and format your content using a simple, readable syntax. + +5. Run the following command in the directory of your site: + ``` shell + hugo server + ``` + Hugo will build a local version of your site that you can view by going to `http://localhost:1313/` inside your browser. Hugo will also automatically show any changes you make to the site, no need to rerun the command or refresh the page. + +## Hosting Your Site + +Hosting a static website refers to the process of making a website accessible to the internet by storing its files on a web server. +A static website is one that contains static content, meaning that the content does not change unless manually updated by the website owner. +This is in contrast to a dynamic website, which generates content on the fly using server-side programming languages such as PHP or ASP.NET. + +To host a static website, you need to sign up for a web hosting service that provides the necessary storage space and bandwidth to host your website. +There are many web hosting providers available, each offering different plans and pricing options. S +ome of the most popular options include *shared hosting*, *VPS hosting*, and *dedicated hosting*. + +One solution for hosting a static website is to use a platform like Netlify. +Netlify is a cloud-based service that allows you to easily deploy and host static websites for free. +It provides a simple interface for uploading your website files, and automatically takes care of the necessary tasks such as setting up DNS records and configuring a CDN to ensure fast loading times for your website. + +In addition to hosting your static website for free, Netlify also offers a range of advanced features such as continuous deployment, split testing, and form handling. +This makes it a great option for teams and individuals looking to quickly and easily host and manage their static websites. + +To host a Hugo site on Netlify, you need to follow these steps: + +1. Create a new repository on GitHub with the name of your site + +2. On you local machine, navigate to the root directory of you Hugo site and run the following commands to create a new repository and push it to GitHub: + + ``` shell + ## Add all files in the Hugo site to the Git repository + $ git add . + + ## Commit the changes to the repository + $ git commit -m "Initial commit of Hugo site" + + ## Add the GitHub repository as a remote to your local Git repository + $ git remote add origin <GitHub repository URL> + + ## Push the Hugo site to the GitHub repository + $ git push -u origin master + ``` + +3. Once your Hugo site has been pushed to GitHub, you can connect your GitHub account to Netlify by signing in to Netlify and following the instructions on the Netlify website. + +4. Once your GitHub account is connected to Netlify, you can set up Netlify to deploy your Hugo site by clicking the "New site from Git" button and selecting your Hugo site's repository from the list of available repositories. + +5. In the next step, you need to configure the build settings for your Hugo site. This includes specifying the version of Hugo to use, the command to build your site, and the directory where the built site should be stored. + +6. After configuring the build settings, you can click the "Deploy site" button to deploy your Hugo site to Netlify. Netlify will automatically build your site using Hugo and make it available at a unique URL. For now, you can access your site by visiting the URL provided by Netlify, but in the next section we will setup a custom domain. + +That's it! Your Hugo site is now hosted on Netlify and available to the world. + +## Getting a Custom Domain (Not Free) + +Setting up a custom domain for your website involves purchasing a domain name and configuring it to point to your website's files on the web server. +A domain name is the unique address that users can type in their web browser to access your website, such as www.google.com. + +Purchasing a domain name typically costs money, as domain names are registered on a yearly basis and need to be renewed periodically to maintain ownership. +The exact cost of a domain name can vary depending on the domain registrar and the specific top-level domain (TLD) you choose (e.g. .com, .net, .org, etc.). + +There are many domain registrars available where you can purchase a domain name, such as GoDaddy, Namecheap, and Google Domains. +When choosing a domain registrar, it's important to consider factors such as pricing, customer support, and additional services offered (such as privacy protection and email hosting). + +Since we're already hosting a site on Netlify we can just purchase the domain from them. +One advantage of purchasing a domain name from Netlify is that it makes the process of setting up your custom domain easier. +Netlify provides a simple interface for purchasing and configuring your domain, and automatically sets up the necessary DNS records to point your domain to your website on Netlify's servers. A +dditionally, Netlify offers free SSL certificates for custom domains, which helps to secure your website and improve its ranking on search engines. + + +In conclusion, building your own website is a rewarding and empowering experience that allows you to share your ideas, passions, and creations with the world. +By using a static site generator like Hugo, you can quickly and easily create a professional-looking website without needing to write any complex code. +Overall, building and hosting your own website is a great way to share your creativity and ideas with the world, and can be a fun and rewarding experience. diff --git a/content/posts/optimizing-my-workflow.md b/content/post/optimizing-my-workflow.md diff --git a/content/post/read-more.md b/content/post/read-more.md @@ -0,0 +1,52 @@ +--- +title: "Unlock the Joy of Reading: Simple Strategies to Read More" +date: 2023-03-13T20:36:16+02:00 +categories: ['Guides'] +tags: ['Reading', 'Productivity'] +draft: false +--- + +In today's fast-paced world, finding time to read can be challenging. +However, reading provides numerous benefits, such as boosting mental stimulation, reducing stress, and expanding our knowledge. +If you've been struggling to incorporate more reading into your life, don't worry – you're not alone. +In this blog post, we'll explore some easy and effective strategies to help you read more and enjoy the process. + +## Set Small, Achievable Goals + +When setting reading goals, it's crucial to avoid overwhelming yourself with unrealistic expectations. +Large goals, like reading for 30 minutes every day, can be challenging to maintain consistently. +Once we fail to meet such a goal, it can quickly spiral into a habit of not reading at all. +To counteract this, establish micro-goals that are almost impossible to miss, such as reading just one page a day. +This achievable target ensures you never fall into the habit of skipping your daily reading, and more often than not, you'll find yourself exceeding the goal and reading even more. By focusing on micro-goals, you build a sustainable reading habit that becomes second nature. + +## Focus on the Chapters That Intrigue You + +This tip is particularly relevant for non-fiction books, such as popular science titles, but can apply to other genres as well. +When diving into a book, you may find that only certain chapters capture your interest. +Instead of forcing yourself to read every single page, feel empowered to focus on the sections that truly engage you. +This approach maximizes your enjoyment and allows you to extract the most valuable information from the book. + +And yes, even if you haven't read every chapter, you can still claim that you've read the book. +After all, reading is a personal journey, and there's no rule stating that you must consume every word from cover to cover. +Embrace a tailored reading experience that caters to your interests and curiosity. + +## Embrace the Art of Moving On + +It's common to feel obliged to finish a book, especially if we've invested money in purchasing it. +This sense of obligation can sometimes lead us to stop reading altogether when we're struggling with an uninteresting book. +It's important to recognize this as the sunk cost fallacy – the misconception that we must continue an activity because of the resources we've already spent on it. + +To break free from this mindset, give yourself permission to move on from a book that isn't enjoyable. +Remember, reading is meant to be a pleasurable experience that enriches our lives, not a burdensome obligation. +By letting go of books that don't engage you, you create space for discovering new, captivating stories that reignite your passion for reading. +Don't let the sunk cost fallacy dictate your reading habits – embrace the freedom to explore new literary worlds without guilt. + +## Read Multiple Books at Once + +Our mood and energy levels can significantly influence our reading preferences. +Sometimes, we might be in the midst of a complex book, such as Kant's Critique of Pure Reason, which requires substantial thought and concentration. +However, after a long day at work or school, we might crave something lighter and more accessible. + +To ensure that your reading doesn't come to a halt due to mood fluctuations, keep a selection of books on hand that cater to different mental states and preferences. +This approach allows you to switch between books depending on your mood and energy levels, ensuring that you always have something enjoyable to read. +By maintaining a diverse reading list, you'll keep the momentum going and continue to reap the benefits of reading, no matter how you're feeling. diff --git a/content/post/replace-jupyter-notebook-with-emacs-org-mode.md b/content/post/replace-jupyter-notebook-with-emacs-org-mode.md @@ -0,0 +1,293 @@ +--- +title: "Replace Jupyter Notebook With Emacs Org Mode: Unleash the Power of Literate Programming" +date: 2023-02-27T15:06:40+02:00 +categories: ['Guides'] +tags: ['Emacs', 'Programming'] +draft: false +--- + +## Introduction + +The popularity of Jupyter Notebook has surged in recent years as a powerful tool for interactive data analysis and visualization. +However, there is an alternative that has been around for a longer time and is proving to be a valuable resource for many programmers: Emacs Org Mode. +In this blog post, we will explore how you can replace Jupyter Notebook with Emacs Org Mode for a seamless and efficient literate programming experience. + +## What is Emacs Org Mode? + +Emacs Org Mode is an extension of the versatile Emacs text editor, offering a powerful platform for note-taking, project management, and literate programming. +Literate programming is an approach in which code and documentation are intertwined, allowing you to create executable documents that can be easily understood by others. +Org Mode excels at this by providing a simple and intuitive markup language that supports rich text formatting, embedded code, and exporting to various formats, such as HTML, PDF, and more. + +## Why Replace Jupyter Notebook with Emacs Org Mode? + +- Unified Environment: Emacs provides a unified environment for all your programming and text editing needs. With Org Mode, you can manage code, documentation, and project planning all within a single tool. This eliminates the need to switch between multiple applications, streamlining your workflow. + +- Extensibility: Emacs is known for its extensibility, and Org Mode is no exception. There are countless plugins and extensions available that can enhance your literate programming experience, such as `org-babel` for code execution, `org-ref` for bibliography management, and `org-present` for presentation support. + +- Version Control: Emacs integrates seamlessly with version control systems like Git, allowing you to track changes and collaborate with others easily. This is particularly useful for literate programming, as both code and documentation can be managed in the same repository. + +- Customization: Emacs and Org Mode can be tailored to suit your needs, from key bindings and appearance to functionality. This flexibility allows you to create a personalized environment that aligns with your preferences and workflow. + +## Getting Started with Emacs Org Mode for Literate Programming + +### Installing Emacs + +1. Choose your platform: + - Linux: Use your distribution's package manager to install Emacs (e.g., `sudo apt-get install emacs` for Ubuntu) + - macOS: Install Emacs using Homebrew (https://brew.sh/) with the command: `brew install --cask emacs` + - Windows: Download the installer from the official GNU Emacs website (https://www.gnu.org/software/emacs/) + +2. Launch Emacs and familiarize yourself with the interface. + +### Configuring Org Mode + +1. Ensure Org Mode is installed and up-to-date by checking your Emacs package list (`M-x list-packages`) or manually updating it. + +2. Add Org Mode configuration settings to your Emacs init file (usually `.emacs` or `init.el`). For example: + ```elisp + (require 'org) + (setq org-src-fontify-natively t) + (setq org-confirm-babel-evaluate nil) + ``` + +### Installing essential packages for data science + +Install the following packages using the built-in Emacs package manager (`M-x list-packages`): +- `org-babel`: For code block execution and literate programming +- `ess`: For R programming language support +- `elpy`: For Python programming language support + +Configure the installed packages by adding appropriate settings to your Emacs init file. + +### Setting up a Python environment in Emacs + +1. Ensure Python is installed on your system and available in your PATH. + +2. Install the ipython packages using pip: + ```shell + pip install ipython + ``` + +3. Configure Emacs to use IPython as the default Python interpreter by adding the following to your Emacs init file: + ```elisp + (setq python-shell-interpreter "ipython" + python-shell-interpreter-args "-i --simple-prompt") + ``` + +### Creating and organizing Org files for literate programming + +1. Create a new Org file with the extension `.org` (e.g., `my_project.org`). + +2. Learn the basics of Org Mode markup, such as headings, lists, and links. + +2. Write and execute code blocks within your Org file: + - Inline code execution: Use `src_<language>{<code>}` to insert inline code (e.g., `src_python{2 + 3}`). + - Code block execution: Use the following syntax to create a code block: + + ```org + #+BEGIN_SRC <language> + <code> + #+END_SRC + ``` +For example: + +```org +#+BEGIN_SRC python +print("Hello, Emacs Org Mode!") +#+END_SRC +``` + +- Execute code blocks using `C-c C-c` and display the results directly in your Org file. +- Export your Org file to various formats (e.g., HTML, PDF) for sharing and publishing. + +## Advanced Features of Emacs Org Mode for Data Science + +### Working with multiple languages in a single Org file + +Org Mode's support for various programming languages allows you to work with multiple languages in a single document. + +Configure additional languages in your Emacs init file by adding the appropriate org-babel settings, such as: + +```elisp +(org-babel-do-load-languages + 'org-babel-load-languages + '((python . t) + (R . t) + (shell . t) + ;; Add other languages here + )) +``` + +### Integrating with external tools and libraries + +Use Org Mode's `#+CALL` syntax to integrate external tools or libraries into your Org document. + +Example: Integrating Pandoc for document conversion: + +```org +#+NAME: pandoc +#+BEGIN_SRC sh :results output :var input="input.md" output="output.pdf" +pandoc $input -o $output +#+END_SRC + +#+CALL: pandoc(input="my_markdown_file.md", output="my_converted_file.pdf") +``` + +### Debugging and profiling code within Org Mode + +Leverage the debugging and profiling capabilities of your programming language within Org Mode. + +Example: Debugging Python code with pdb: + +```org +#+BEGIN_SRC python :results output +import pdb + +def my_function(a, b): + pdb.set_trace() + return a + b + +my_function(3, 5) +#+END_SRC +``` + +### Customizing code block execution and display options + +Customize code block execution with header arguments. + +Example: Exporting code block results as a separate file: + +```org +#+BEGIN_SRC python :results file :file output.png +import matplotlib.pyplot as plt + +x = [1, 2, 3, 4] +y = [2, 4, 6, 8] + +plt.plot(x, y) +plt.savefig('output.png') +#+END_SRC +``` + +### Utilizing Org Mode for project management and collaboration + +- Take advantage of Org Mode's task management and agenda features to manage data science projects. +- Create TODO items, set deadlines, and track progress using Org Mode. +- Collaborate with teammates by sharing Org files and using Git for version control. +- Example: Project management in Org Mode: + + ```org + * TODO Prepare dataset + DEADLINE: <2023-04-01> + * TODO Train machine learning model + DEADLINE: <2023-04-15> + * DONE Write report + CLOSED: [2023-03-25] + ``` + +## Tips and Tricks for Optimizing Your Emacs Org Mode Workflow + +### Keyboard shortcuts for Org Mode + +Learn and utilize Org Mode's keyboard shortcuts to improve your productivity: +- `C-c C-t`: Toggle TODO states +- `C-c C-s`: Schedule a task +- `C-c C-d`: Set a deadline +- `C-c C-o`: Open a link +- `TAB`: Fold/unfold headings +- `S-TAB`: Fold/unfold all headings + +Customize your own keyboard shortcuts in your Emacs init file, if needed. + +### Customizing your Emacs theme + +Choose from various built-in and community-provided Emacs themes to personalize your workspace. + +Install a new theme using the Emacs package manager (`M-x list-packages`), and activate it by adding the following to your Emacs init file: + +```elisp +(load-theme 'theme-name t) +``` +Adjust the appearance of Org Mode elements (e.g., headings, links, and code blocks) by customizing their faces. + +### Integrating with other Emacs packages for productivity + +Enhance your Org Mode experience by integrating it with other Emacs packages: +- `org-ref`: Manage citations and references within Org documents +- `org-brain`: Create a personal wiki or knowledge base using Org Mode +- `magit`: Integrate Git version control with your Org workflow +- `org-present`: Create presentations using Org Mode + +Install and configure these packages according to their respective documentation. + +### Using Org Mode for note-taking and knowledge management + +Use Org Mode as a powerful note-taking tool to complement your data science projects. + +Organize and search your notes using Org Mode's hierarchical structure and built-in search capabilities. + +Example: Organizing notes in Org Mode: + +```org +* Data Science Concepts +** Supervised Learning +*** Regression +- Linear Regression +- Polynomial Regression +*** Classification +- Logistic Regression +- Decision Trees +** Unsupervised Learning +*** Clustering +- K-means Clustering +- Hierarchical Clustering +``` +## Transitioning from Jupyter Notebook to Emacs Org Mode + +### Importing existing Jupyter Notebooks into Org Mode + +Use jupytext to convert Jupyter Notebooks to Org Mode files: +- Install jupytext with the command: `pip install jupytext` +- Convert your Jupyter Notebook (`.ipynb`) to an Org Mode file (`.org`) using the following command: + ```shell + jupytext --to org my_notebook.ipynb + ``` +-Review the converted Org Mode file to ensure proper formatting and correct any issues. + +### Exporting Org files to Jupyter Notebook format + +- Use jupytext to convert Org Mode files back to Jupyter Notebooks, if needed: +- Convert your Org Mode file (`.org`) to a Jupyter Notebook (`.ipynb`) using the following command: + ```shell + jupytext --to ipynb my_org_file.org + ``` +- Open the converted Jupyter Notebook with your preferred Jupyter environment (e.g., JupyterLab, Jupyter Notebook) and verify its contents. + +### Overcoming common challenges during the transition + +- Familiarize yourself with Emacs key bindings and commands, which may differ significantly from traditional text editors. +- Take the time to explore and customize your Emacs settings to create a comfortable and productive workspace. +- Seek help from the Emacs and Org Mode communities through online forums, mailing lists, and chat rooms. Many users are happy to share their experiences and offer support. + +## Conclusion + +### Recap of the benefits of using Emacs Org Mode for data science + +- Emacs Org Mode offers a powerful, flexible, and customizable environment for data science tasks, addressing many limitations of Jupyter Notebook. +- Org Mode's support for literate programming enables seamless integration of code, results, and documentation, promoting reproducible research and collaboration. +- The extensible nature of Emacs allows users to tailor their workflow to their specific needs, integrating various programming languages, tools, and productivity-enhancing packages. + +### Emphasizing the flexibility and customizability of Emacs Org Mode + +- One of the most significant advantages of Emacs Org Mode is its customizability, allowing users to create a personalized workspace that suits their needs and preferences. +- Users can choose from a wide variety of packages, themes, and settings to create an environment that enhances their productivity and enjoyment of the data science process. + +### Encouragement for readers to give Emacs Org Mode a try + +- If you're intrigued by the benefits of Emacs Org Mode for data science, consider giving it a try and experiencing its capabilities firsthand. +- Transitioning from Jupyter Notebook to Emacs Org Mode may require some initial effort, but the long-term gains in productivity and flexibility can be well worth the investment. + +### Invitation to join the Emacs Org Mode community and share experiences + +- As you embark on your journey with Emacs Org Mode, don't hesitate to reach out to the vibrant community of users and developers for help, support, and inspiration. +- Share your experiences, tips, and tricks with others, contributing to the collective knowledge and strengthening the community of Emacs Org Mode enthusiasts in the data science world. diff --git a/content/post/stop-using-proprietary-software.md b/content/post/stop-using-proprietary-software.md @@ -0,0 +1,50 @@ +--- +title: "Free Yourself from the Shackles of Proprietary Software: A Rant" +date: 2023-03-27T21:19:13+02:00 +categories: ['Editorials'] +tags: ['Open-source', 'Software'] +draft: false +--- + +## Introduction + +Have you ever found yourself frustrated by the limitations, restrictions, and lack of control you have when using proprietary software? +Welcome to the club. +So, let's dive into the many reasons why proprietary software is terrible and why we, as users and developers, should put our collective foot down and demand change. + +## The Greed of Corporations + +Proprietary software is the epitome of corporate greed, the embodiment of a money-hungry system that thrives on the limitations and frustrations it imposes upon users. +It's time to unshackle ourselves from the chains of expensive licensing fees, forced upgrades, and the never-ending cycle of subscription-based models that drain our wallets and limit our freedom to innovate. + +## Lack of Customization and Flexibility + +How many times have you used a piece of software and thought, "If only I could change this one feature or tweak this setting, it would be perfect?" Well, with proprietary software, that's just a pipe dream. +The rigidity of proprietary software stifles creativity and innovation, leaving you stuck with whatever features the software company deems necessary or, more likely, profitable. +Open-source software, on the other hand, empowers users and developers to modify, improve, and adapt the software to meet their unique needs. + +## The Inevitable Obsolescence + +Ever had a software program you loved, only to have it rendered useless when the company decided to discontinue support or force an unwanted upgrade? +It's frustrating, to say the least. +With proprietary software, you're completely at the mercy of the company's whims and decisions. +Open-source software, however, offers longevity and security, as it can be maintained and updated by a dedicated community of developers, even if the original creator moves on. + +## A Breeding Ground for Security Risks + +When it comes to proprietary software, you're essentially putting blind trust in the company to keep your data safe and protect you from security threats. +But we've all heard the horror stories of data breaches and hackers exploiting vulnerabilities in widely-used software. +Open-source software provides a level of transparency and peer review that can help identify and fix security issues faster and more efficiently. + +## Stifling Collaboration and Knowledge Sharing + +Proprietary software creates a culture of secrecy and competition, where companies guard their trade secrets and intellectual property like a dragon hoarding gold. +This prevents the sharing of knowledge and ideas that could lead to better software and technology for everyone. +Open-source software, conversely, fosters collaboration, community, and knowledge sharing that benefits the entire industry and its users. + +## Conclusion + +The time has come to break free from the limitations and frustrations of proprietary software. +We must recognize the value and potential of open-source alternatives and demand transparency, flexibility, and collaboration from the software industry. +By embracing the open-source movement, we can help create a world where software is not only more accessible and customizable but also more secure and innovative. +So, next time you're considering a software purchase or download, remember: there's a whole world of open-source alternatives out there, just waiting for you to explore. diff --git a/content/post/turning-a-window-manager-into-a-desktop-environment.md b/content/post/turning-a-window-manager-into-a-desktop-environment.md @@ -0,0 +1,228 @@ +--- +title: "The Ultimate Guide to Building Your Own Desktop Environment" +date: 2022-12-11T21:31:27+02:00 +categories: ['Guides'] +tags: ['Linux', 'Desktop Environment'] +draft: false +--- + +<!-- TODO add notification daemon--> + +## Introduction + +If you're a Linux user, you're probably familiar with the concept of window managers and desktop environments. +These programs are responsible for managing the appearance and functionality of your desktop, providing the tools and features that you need to interact with your operating system. + +But what's the difference between a window manager and a desktop environment? +And why might someone want to turn a window manager into a desktop environment? + +In this blog post, we'll explore these questions and more. +I'll provide a step-by-step guide on how to turn a window manager into a desktop environment, along with tips and tricks for customizing your window manager and making it more user-friendly. +We'll also discuss the benefits and drawbacks of using a window manager as a desktop environment, and compare popular window managers and desktop environments. + +So let's dive in and learn more about the fascinating world of window managers and desktop environments! + +## Turning a window manager into a desktop environment + +If you want to turn a window manager into a desktop environment, the first thing you need to do is install the necessary components. +This typically includes the window manager itself, a display manager, and additional utilities and applications. + +Let's explore some of these components: + +### Window Manager + +A window manager is a program that manages the placement and appearance of windows on a computer's desktop. +It is responsible for providing the "frame" around each window, allowing the user to move, resize, and minimize windows. +A window manager also provides the ability to switch between windows and to tile them on the desktop in various ways. + +There are many different window managers available for Linux and other operating systems. +Some of the most popular ones include the following: + +1. **i3**: i3 is a tiling window manager that is designed to be fast and efficient. It is easy to configure and customize, and it provides a number of advanced features for power users. + +2. **Openbox**: Openbox is a lightweight and flexible window manager that is easy to customize. It provides a minimalistic interface and a wide range of options for advanced users. + +3. **bspwm**: bspwm is a tiling window manager that is based on binary space partitioning. It is lightweight and efficient, and it provides a number of advanced features, such as automatic tiling and support for multiple monitors. + +3. **dwm**: dwm is a dynamic window manager that is written in the C programming language. It is fast and lightweight, and it provides a number of advanced features, such as support for multiple monitors and a customizable status bar. + +4. **xmonad**: xmonad is a tiling window manager that is written in the Haskell programming language. It is highly configurable and customizable, and it provides a number of advanced features, such as support for multiple workspaces and automatic tiling. + +Each window manager has its own unique features and capabilities, and the right one for you will depend on your personal preferences and needs. +Some of the pros and cons of using different window managers are as follows: + +- **i3**: i3 is a powerful and customizable window manager that is well-suited for users who want a highly efficient and flexible desktop environment. It has a steep learning curve, but once you master it, you can achieve a high level of productivity. Some of the pros of using i3 are its tiling capabilities, its support for multiple workspaces, and its ability to run on low-end hardware. Some of the cons are its lack of a built-in panel or application launcher, and its reliance on keyboard shortcuts. + +- **Openbox**: Openbox is a lightweight and flexible window manager that is easy to customize. It provides a minimalistic interface and a wide range of options for advanced users. Some of the pros of using Openbox are its low resource usage, its support for desktop icons, and its ability to integrate with other desktop environments. Some of the cons are its lack of tiling capabilities, its reliance on external utilities for certain features, and its lack of a built-in system tray. + +- **bspwm**: bspwm is a tiling window manager that is based on binary space partitioning. It is lightweight and efficient, and it provides a number of advanced features, such as automatic tiling and support for multiple monitors. Some of the pros of using bspwm are its low resource usage, its advanced tiling capabilities, and its support for multiple monitors. Some of the cons are its lack of a built-in panel or application launcher, and its reliance on external utilities for certain features. + +- **dwm**: dwm is a dynamic window manager that is written in the C programming language. It is fast and lightweight, and it provides a number of advanced features, such as support for multiple monitors and a customizable status bar. Some of the pros of using dwm are its low resource usage, its fast performance, and its customizable status bar. Some of the cons are its lack of a built-in panel or application launcher, and its reliance on keyboard shortcuts. + +- **xmonad**: xmonad is a tiling window manager that is written in the Haskell programming language. It is highly configurable and customizable, and it provides a number of advanced features, such as support for multiple workspaces and automatic tiling. Some of the pros of using xmonad are its advanced tiling capabilities, its support for multiple workspaces, and its high level of configurability. Some of the cons are its steep learning curve, its lack of a built-in panel or application launcher, and its reliance on external utilities for certain features. + +### Display Manager + +A display manager is a program that manages the login and display of the desktop environment on a computer. +It is responsible for providing the login screen, allowing the user to enter their username and password, and then starting the desktop environment and managing its display. + +Some common examples of display managers include LightDM, GDM, and SDDM. +LightDM is a cross-platform display manager that is lightweight and customizable. +GDM is the default display manager on the GNOME desktop environment, and it provides a user-friendly login screen and a range of options for advanced users. +SDDM is the default display manager on the KDE desktop environment, and it provides a modern and attractive login screen. + +When you install a desktop environment on your computer, it typically includes a default display manager. +However, you can also choose to install and use a different display manager if you prefer. +For example, if you are using the Xfce desktop environment, you could choose to use LightDM instead of the default XDM display manager. + +### Compositor + +A compositor is a program that is responsible for combining the outputs of multiple applications and displaying them on the screen. +It is typically used to provide advanced graphical effects, such as transparency, animations, and 3D transformations. + +On Linux, a compositor is typically used in conjunction with a window manager to provide a desktop environment. +The window manager is responsible for managing the placement and appearance of windows on the desktop, while the compositor provides the graphical effects. +Some window managers, such as xmonad and i3, include a built-in compositor, while others, such as Openbox, dwm and bspwm, require the use of an external compositor. + +There are many compositors available for Linux, and the right one for you will depend on your personal preferences and needs. +Some popular compositors include compton, picom, and xcompmgr. Compton is a feature-rich compositor that provides a wide range of options and effects, picom is a lightweight and efficient compositor, and xcompmgr is a simple compositor that provides basic graphical effects. + +To choose a compositor, you can consider the following factors: + +1. **Features**: Different compositors provide different sets of features and capabilities. Consider which features are most important to you, and choose a compositor that provides them. + +2. **Performance**: Compositors can have a significant impact on the performance of your desktop environment. If you are using a low-end computer or you have a lot of applications running, you may want to choose a lightweight compositor that uses fewer resources. + +3. **Compatibility**: Some compositors are compatible with only certain window managers or desktop environments. If you are using a specific window manager or desktop environment, make sure the compositor you choose is compatible with it. + +### Additional Utilities + +#### Wallpaper Setter + +You can use a program such as nitrogen or feh to set your wallpaper. +Nitrogen and feh are two popular programs that allow you to browse and select an image to use as your wallpaper, and then set it as the background for your desktop. + +To use nitrogen or feh to set your wallpaper, follow these steps: + +1. Install nitrogen or feh on your system. You can use your package manager to install the program, or you can download and compile the source code from the program's website. + +2. Run nitrogen or feh. This will open a window that allows you to browse and select an image to use as your wallpaper. + +3. Browse to the location of the image you want to use as your wallpaper, and select it. + +4. Once you have selected the image, click on the "Set as wallpaper" button (in nitrogen) or the "Apply" button (in feh) to set the image as your wallpaper. + +5. The selected image will now be displayed as your wallpaper. + +6. Add a line to your startup script to set the wallpaper. +If you're using nitrogen add: + ```shell + nitrogen --restore + ``` + If you're using feh add: + ```shell + feh --bg-scale /path/to/image.jpg + ``` + +#### Bar + +A bar on Linux is a program that displays information on the desktop, such as the current time and date, the system load, and the status of various system services. +A bar is typically used in conjunction with a window manager or desktop environment, and it provides a convenient way to access important information without needing to open a separate application. + +There are many bars available for Linux, and the right one for you will depend on your personal preferences and the desktop environment you are using. +Some popular bars include polybar, lemonbar, i3bar, xmobar, and dwmblocks. +These bars are designed to be used with specific desktop environments or window managers, and they provide a range of features and customization options. + +For example, polybar and lemonbar are general-purpose bars that can be used with any desktop environment or window manager. +They provide a wide range of features, such as support for multiple monitors and custom colors and fonts, and they are highly customizable. +i3bar is the default bar for the i3 window manager, and it provides a minimalistic interface and support for displaying information from i3 modules. +xmobar is the default bar for the xmonad window manager, and it provides a customizable interface and support for displaying information from xmonad plugins. +dwmblocks is the default bar for the dwm window manager, and it provides a minimalist interface and support for displaying information from dwm status commands. + +To choose a bar, you can consider the following factors: + +1. **Compatibility**: Some bars are designed to be used with specific desktop environments or window managers. If you are using a specific desktop environment or window manager, make sure the bar you choose is compatible with it. + +2. **Features**: Different bars provide different sets of features and capabilities. Consider which features are most important to you, and choose a bar that provides them. + +3. **Customization**: Some bars are highly customizable, allowing you to change the appearance and behaviour of the bar to suit your preferences. If you want a bar that you can tailor to your specific needs, choose a bar that provides a high degree of customization. Polybar is a popular choice. + +#### Application Launcher + +An application launcher is a program that allows you to quickly search for and launch applications on your Linux system. +An application launcher typically provides a search bar or a menu that allows you to enter the name of the application you want to launch, and it displays a list of matching applications that you can select from. + +Some popular application launchers include rofi, dmenu, and albert. + +1. **Rofi** is a flexible and customizable application launcher that allows you to search for and launch applications, as well as perform a range of other actions, such as opening a terminal or running a command. + +3. **Dmenu** is a simple and lightweight application launcher that provides a minimalistic interface and support for fuzzy search. + +4. **Albert** is a fast and efficient application launcher that uses a customizable keyboard shortcut to launch applications and perform other actions. + +#### System Tray + +A system tray (also known as a notification area) is a part of the graphical user interface (GUI) on Linux (and other operating systems) that displays icons for system and application notifications. +The system tray is typically located at the bottom or side of the screen, and it provides a convenient way for applications to display important information and notifications without disrupting the user's work. + +For example, the system tray might display an icon for a network manager application, which shows the current network status and allows the user to manage their network connections. +It might also display an icon for a battery manager application, which shows the current battery level and allows the user to manage their power settings. + +#### Polkit + +Polkit (formerly known as PolicyKit) is a framework for defining and managing administrative policies on Linux. +It provides a mechanism for controlling access to system-wide privileges, and it allows users to perform privileged tasks without needing to log in as the root user. + +Polkit consists of a number of components, including a daemon (polkitd), a command-line tool (polkit), and a library (libpolkit). +The polkit daemon runs in the background and listens for requests from applications that need to perform privileged tasks. +The polkit command-line tool allows administrators to manage and configure polkit policies. +The libpolkit library provides a convenient interface for developers to integrate polkit into their applications. + +See [the arch wiki](https://wiki.archlinux.org/title/Polkit) for more information. + +## Customizing your window manager + +Most window managers on Linux allow for customization to some extent. +Customizing your window manager can allow you to tailor the appearance and behaviour of your desktop environment to suit your preferences and needs. + +To customize your window manager, you will need to edit the window manager's configuration files. +These files are typically written in a scripting language, such as Lua or Shell, and they control the various aspects of the window manager's behaviour and appearance. + +Here are some examples of the types of things you can customize in your window manager: + +- **Appearance**: You can customize the appearance of your window manager by changing the colors, fonts, and other visual elements. For example, you might change the color of the window borders, the font used for window titles, or the size of gaps between windows. + +- **Keybindings**: You can customize the keybindings of your window manager to define which keys perform which actions. For example, you might bind the "Alt + Tab" keys to switch between windows, or the "Super + L" keys to lock the screen. + +- **Behaviour**: You can customize the behaviour of your window manager to control how windows are managed and displayed. For example, you might change the default layout of windows on the screen, or the way windows are focused when they are opened. + +- **Autostart**: You can customize the autostart of your window manager to define which applications are automatically launched when you log in. For example, you might specify that your web browser, email client, and music player are automatically started when you log in. + +To customize your window manager, you will need to edit the appropriate configuration files and specify the desired changes. +The exact steps for doing this will depend on the specific window manager you are using. +You can find instructions for customizing your window manager in the documentation or online forums for your window manager. + +## Benefits and drawbacks + +There are both benefits and drawbacks to using a window manager instead of a full desktop environment on Linux. + +As said before, a window manager is a program that provides the basic functions for managing windows on the desktop, such as opening, closing, minimizing, and maximizing windows. +A full desktop environment, on the other hand, is a complete graphical user interface (GUI) that includes not only a window manager, but also a range of other applications and utilities, such as a taskbar, a system tray, a file manager, and a desktop background. + +Here are some of the benefits of using a window manager instead of a full desktop environment on Linux: + +- **Lightweight**: Window managers are typically much lighter and more efficient than full desktop environments. This means they use fewer system resources, such as memory and CPU, and they can run on lower-powered hardware. + +- **Customizable**: Window managers are typically highly customizable, allowing users to tailor the appearance and behavior of their desktop environment to their preferences. This is because window managers typically have simple, modular architectures, with configuration files that are easy to edit and modify. + +- **Flexible**: Window managers are typically more flexible than full desktop environments, allowing users to mix and match different applications and utilities from different desktop environments. For example, a user might use the window manager from one desktop environment, but the file manager from another. +Here are some of the drawbacks of using a window manager instead of a full desktop environment on Linux: + +- **Less user-friendly**: Window managers are typically less user-friendly than full desktop environments, because they do not include many of the applications and utilities that users expect in a GUI. This can make it more difficult for new users to get started with a window manager, and it can limit the functionality of the desktop environment. + +- **Less integrated**: Window managers are typically less integrated than full desktop environments, because they do not include many of the applications and utilities that are designed to work together. This can lead to a less cohesive and consistent user experience, and it can make it more difficult to perform certain tasks. + +- **More complex**: Window managers are typically more complex than full desktop environments, because they require the user to manually configure and manage many of the components of the desktop environment. This can be a challenge for inexperienced users, and it can require more time and effort to set up and maintain a window manager. + +Overall, whether to use a window manager or a full desktop environment on Linux depends on your personal preferences and needs. +Some users may prefer the lightweight, customizable, and flexible nature of window managers, while others may prefer the user-friendly, integrated, and simple nature of full desktop environments. diff --git a/content/post/what-linux-packaging-format-to-use.md b/content/post/what-linux-packaging-format-to-use.md @@ -0,0 +1,122 @@ +--- +title: "Exploring Linux Package Formats: Which One Should You Use?" +date: 2023-01-09T13:36:52+02:00 +categories: ['Articles'] +tags: ['Linux', 'Package-management'] +draft: false +--- + +## Introduction + +Linux, a widely popular open-source operating system, is known for its versatility and adaptability. +The software distribution in Linux is primarily done through packages, which are used to install, update, and remove applications. +There are several package formats available, and choosing the right one can be confusing for newcomers or even experienced users. +In this blog post, we will discuss the key differences between popular package formats such as Flatpak, Snap, Deb, RPM, AppImage, and AUR, and provide insights to help you choose the best format for your needs. + +## Flatpak + +Flatpak is a relatively new package format. +It aims to create a universal packaging system for all Linux distributions, providing a sandboxed environment for applications. +This isolation ensures that apps have limited access to system resources, enhancing security and stability. + +### Pros: + +- Distribution-agnostic packaging system +- Improved security through sandboxing +- Easy to update and manage applications + +### Cons: + +- Increased disk space usage due to bundling of dependencies +- Slower application startup times + +## Snap + +Snap is a package format developed by Canonical, the company behind Ubuntu. +Similar to Flatpak, it focuses on providing a universal packaging system that works across multiple distributions. +Snaps are self-contained and sandboxed, which improves security and stability. + +### Pros: + +- Works across various Linux distributions +- Enhanced security with sandboxing +- Automatic updates + +### Cons: + +- Limited support for themes and desktop integration +- Increased disk space usage due to bundled dependencies + +## Deb + +Deb is the native package format for Debian-based distributions, such as Ubuntu and Linux Mint. +It uses the Advanced Package Tool (APT) for package management, making it easy to install, update, and remove applications. +Deb packages have been the standard for Debian-based systems for many years. + +### Pros: + +- Well-established and widely supported +- Efficient dependency handling +- Large repository of available packages + +### Cons: + +- Limited to Debian-based distributions +- No sandboxing or containerization + +## RPM + +RPM (RPM Package Manager) is a package format used by Red Hat-based distributions, such as Fedora and CentOS. +RPM packages are managed by various package management tools like DNF and YUM. + +### Pros: + +- Extensive support for Red Hat-based distributions +- Good dependency management +- Large repository of available packages + +### Cons: + +- Limited to Red Hat-based distributions +- No sandboxing or containerization + +## AppImage + +AppImage is a portable package format that allows users to run applications without installing them. +It is distribution-agnostic and works across various Linux distributions. +AppImages are self-contained, bundling all required dependencies, which can lead to increased disk space usage. + +### Pros: + +- Distribution-agnostic +- Portable and easy to use +- No installation required + +### Cons: + +- Increased disk space usage +- No centralized update mechanism + +## AUR (Arch User Repository) + +AUR is a community-driven repository for Arch Linux and its derivatives, such as Manjaro. +It contains a vast collection of packages that are not available in the official repositories. +Users can build and install packages directly from the AUR using helper tools like yay or paru. + +### Pros: + +- Large collection of packages +- Community-driven and maintained +- Easy to use with helper tools + +### Cons: + +- Limited to Arch-based distributions +- Packages may have varying quality and stability + +## Conclusion + +Selecting the right package format depends on various factors, such as your distribution, security requirements, and personal preferences. +If you prioritize universal compatibility and sandboxing, Flatpak and Snap are great options. +For Debian or Red Hat-based distributions, Deb and RPM are well-established choices. +If you need portability and ease of use, AppImage is the way to go. Lastly, for Arch Linux users, AUR provides a vast array of community-maintained packages. diff --git a/content/posts/best-firefox-extensions.md b/content/posts/best-firefox-extensions.md @@ -1,209 +0,0 @@ ---- -title: "Best Firefox Extensions" -date: 2023-04-08T08:18:16+02:00 -categories: ['Listicles'] -tags: ['Productivity', 'Privacy'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [Productivity](#productivity) - - [Tree Style Tab](#tree-style-tab) - - [Simple Tab Groups](#simple-tab-groups) - - [Firefox Multi-Account Containers](#firefox-multi-account-containers) - - [DownThemAll!](#downthemall) - - [SingleFile](#singlefile) - - [To Google Translate](#to-google-translate) -- [Privacy](#privacy) - - [uBlock Origin](#ublock-origin) - - [User-Agent Switcher and Manager](#user-agent-switcher-and-manager) - - [Privacy Badger](#privacy-badger) - - [ClearURLs](#clearurls) - - [LocalCDN](#localcdn) - - [Facebook Container](#facebook-container) - - [Google Container](#google-container) -- [Quality of Life](#quality-of-life) - - [Auto Tab Discard](#auto-tab-discard) - - [I don't care about cookies](#i-dont-care-about-cookies) -- [Aesthetics](#aesthetics) - - [Dark Reader](#dark-reader) -- [Social Platforms](#social-platforms) - - [YouTube](#youtube) - - [Enhancer for Youtube™](#enhancer-for-youtube) - - [PocketTube](#pockettube) - - [Return YouTube Dislike](#return-youtube-dislike) - - [SponsorBlock](#sponsorblock) - - [Reddit](#reddit) - - [Reddit Enhancement Suite](#reddit-enhancement-suite) - - [Unreddit](#unreddit) - -<!-- markdown-toc end --> - -Welcome to my comprehensive guide on the best Firefox extensions to supercharge your browsing experience! -As one of the most popular web browsers, Firefox offers a remarkable level of flexibility and customization through its vast extension ecosystem. -These extensions are like small add-ons that can enhance various aspects of your browsing, ranging from productivity and privacy to aesthetics and tailored experiences on platforms like YouTube and Reddit. - -# Productivity - -## [Tree Style Tab](https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/) -This extension provides the ability to work with tabs as "trees". - -New tabs opened from the current tab are automatically organized as "children" of the current tab. -Such "branches" are easily folded (collapsed) by clicking on the arrow shown in the "parent" tab, so you no longer need to suffer from too many visible tabs. -If you want, you can restructure the tree via drag and drop. - -![Tree style tab](https://addons.mozilla.org/user-media/previews/thumbs/275/275014.jpg?modified=1668096516) - -## [Simple Tab Groups](https://addons.mozilla.org/en-US/firefox/addon/simple-tab-groups/) -Simple Tab Groups works across browser instances/windows too. -If you select a group in another window, the selected window will jump to the foreground with the chosen group selected. You can even select the specific tab within that group in background browser windows. -![GIF example](https://user-images.githubusercontent.com/7843031/33828871-806ccf6e-de76-11e7-9a0e-1ddfb97e878d.gif) - - -## [Firefox Multi-Account Containers](https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/) -The Firefox Multi-Account Containers extension lets you carve out a separate box for each of your online lives – no more opening a different browser just to check your work email! - -![Multi-Account Containers](https://addons.mozilla.org/user-media/previews/thumbs/266/266159.jpg?modified=1643906676) - -## [DownThemAll!](https://addons.mozilla.org/en-US/firefox/addon/downthemall/) -DownThemAll will help you select, queue, sort and run your downloads faster. -It comes with advanced ways to select what links to download, and will remember your previous decisions so that you can queue more downloads with just One Click! - -Advanced users will also like using renaming masks, which let you automatically assign names (and even sub-folders within your downloads folder), fast-filtering or even custom, re-usable filters. - -![DownThemAll](https://addons.mozilla.org/user-media/previews/thumbs/224/224229.jpg?modified=1622132179) - -## [SingleFile](https://addons.mozilla.org/en-US/firefox/addon/single-file/) -SingleFile is an add-on for Firefox Desktop and Mobile that helps you to *save an entire webpage** including images, styling, frames, fonts etc. *as a single HTML file**. - -![SingleFile](https://addons.mozilla.org/user-media/previews/thumbs/235/235535.jpg?modified=1622133480) - -## [To Google Translate](https://addons.mozilla.org/en-US/firefox/addon/to-google-translate/) -This extension creates a context menu item in Firefox. -When you click on this menu item, the previously selected text is sent to Google Translate for translating or to Google TTS for listening pronunciation. -You can setup the default languages for translation on the options page. - -![To Google Translate](https://addons.mozilla.org/user-media/previews/thumbs/198/198330.jpg?modified=1622132267) - -# Privacy - -## [uBlock Origin](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/) -An efficient wide-spectrum content blocker. -Easy on CPU and memory. - -![uBlock Origin](https://addons.mozilla.org/user-media/previews/thumbs/238/238546.jpg?modified=1622132421) - -## [User-Agent Switcher and Manager](https://addons.mozilla.org/en-US/firefox/addon/user-agent-string-switcher/) -Spoof websites trying to gather information about your web navigation—like your browser type and operating system—to deliver distinct content you may not want. - -![User-Agent Switcher](https://addons.mozilla.org/user-media/previews/thumbs/188/188200.jpg?modified=1622132777) - -## [Privacy Badger](https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/) -Privacy Badger automatically learns to block invisible trackers. -Instead of keeping lists of what to block, Privacy Badger automatically discovers trackers based on their behavior. - -![Privacy Badger](https://addons.mozilla.org/user-media/previews/thumbs/171/171793.jpg?modified=1622132342) - -## [ClearURLs](https://addons.mozilla.org/en-US/firefox/addon/clearurls/) -This extension will automatically remove tracking elements from URLs to help protect your privacy when browsing through the Internet. - -![ClearURLs](https://addons.mozilla.org/user-media/previews/thumbs/231/231733.jpg?modified=1640781132) - -## [LocalCDN](https://addons.mozilla.org/en-US/firefox/addon/localcdn-fork-of-decentraleyes/) -LocalCDN is a web browser extension that emulates Content Delivery Networks to improve your online privacy. -It intercepts traffic, finds supported resources locally, and injects them into the environment. -All of this happens automatically, so no prior configuration is required. - -![LocalCDN](https://addons.mozilla.org/user-media/previews/full/271/271250.png?modified=1657374986) - -## [Facebook Container](https://addons.mozilla.org/en-US/firefox/addon/facebook-container/) -Facebook Container works by isolating your Facebook identity into a separate container that makes it harder for Facebook to track your visits to other websites with third-party cookies. - -![Facebook Container](https://addons.mozilla.org/user-media/previews/thumbs/235/235581.jpg?modified=1622133081) - -## [Google Container](https://addons.mozilla.org/en-US/firefox/addon/google-container/) -Google Container works by isolating your Google identity into a separate container that makes it harder for Google to track your visits to other websites with third-party cookies. - -It is a fork of the Facebook Container addon. - -# Quality of Life - -## [Auto Tab Discard](https://addons.mozilla.org/en-US/firefox/addon/auto-tab-discard/) -"Auto Tab Discard" is a lightweight browser extension that automatically reduces the amount of memory used by open but inactive tabs, helping to conserve battery life on portable devices by disabling JavaScript code and DOM events on discarded tabs. - -![Auto Tab Discard](https://addons.mozilla.org/user-media/previews/full/201/201762.png?modified=1622132901) - -## [I don't care about cookies](https://addons.mozilla.org/en-US/firefox/addon/istilldontcareaboutcookies/) -The EU regulations require that any website using tracking cookies must get user's permission before installing them. -These warnings appear on most websites until the visitor agrees with the website's terms and conditions. -Imagine how irritating that becomes when you surf anonymously or if you delete cookies automatically every time you close the browser. - -This add-on will remove these cookie warnings from almost all websites! You can report any website which still warns you about cookies: just click 'Report a cookie warning' from the extension menu (the brown cookie image next to your address bar). - -In most cases, the add-on just blocks or hides cookie related pop-ups. -When it's needed for the website to work properly, it will automatically accept the cookie policy for you (sometimes it will accept all and sometimes only necessary cookie categories, depending on what's easier to do). -It doesn't delete cookies. - -# Aesthetics - -## [Dark Reader](https://addons.mozilla.org/en-US/firefox/addon/darkreader/) -This eye-care extension enables night mode creating dark themes for websites on the fly. -Dark Reader inverts bright colors making them high contrast and easy to read at night. - -You can adjust brightness, contrast, sepia filter, dark mode, font settings and ignore-list. - -![Dark Reader](https://addons.mozilla.org/user-media/previews/thumbs/201/201069.jpg?modified=1638883247) - -# Social Platforms - -## YouTube - -### [Enhancer for Youtube™](https://addons.mozilla.org/en-US/firefox/addon/enhancer-for-youtube/) -Built to get the most out of YouTube, this extension comes packed with all sorts of features that allow you, among other things, to manage ads as you wish, control the playback speed and the volume level with the mouse wheel, automate repetitive tasks such as selecting the appropriate playback quality, configure dozens of keyboard shortcuts to control YouTube like a pro, and much more... -Give it a try! -But be aware that you will never want to use YouTube without it again ;) - -![YouTube Enhancer](https://addons.mozilla.org/user-media/previews/thumbs/257/257216.jpg?modified=1668589063) - -### [PocketTube](https://addons.mozilla.org/en-US/firefox/addon/youtube-subscription-groups/) -Using this simple extension you can create collections that seamlessly fit into YouTube layout. This is easy way to manage Youtube subscription / channels. - -This extension enables you to: -- Create group collections list on YouTube. -- Group YouTube subscription / channels to collections / group. One YouTube subscription / channel can has few collections -- Add custom icon for collection. Choice prepare icons or upload own one -- Show last YouTube videos by collections / group. Play all video by collections using YouTube playlist -- Auto sync your collections on Android/iOS/Firefox using Google drive and Chrome profile -- Integration in Youtube main page -- Filter video by category on Youtube feed subscriptions page -- Hide watched YouTube video -- Order by last YouTube activity, a-z, subscription count and custom -- Catch up your Youtube subscriptions - -![PocketTube](https://addons.mozilla.org/user-media/previews/thumbs/270/270578.jpg?modified=1655574773) - -### [Return YouTube Dislike](https://addons.mozilla.org/en-US/firefox/addon/return-youtube-dislikes/) -Returns ability to see dislike statistics on youtube. - -![Return YouTube Dislike](https://addons.mozilla.org/user-media/previews/thumbs/263/263668.jpg?modified=1637785158) - -### [SponsorBlock](https://addons.mozilla.org/en-US/firefox/addon/sponsorblock/) -Easily skip YouTube video sponsors. -When you visit a YouTube video, the extension will check the database for reported sponsors and automatically skip known sponsors. -You can also report sponsors in videos. - -![SponsorBlock](https://addons.mozilla.org/user-media/previews/thumbs/227/227750.jpg?modified=1622134672) - -## Reddit - -### [Reddit Enhancement Suite](https://addons.mozilla.org/en-US/firefox/addon/reddit-enhancement-suite/) -Reddit Enhancement Suite (RES) is a suite of tools to enhance your Reddit browsing experience. - -![RES](https://addons.mozilla.org/user-media/previews/thumbs/238/238629.jpg?modified=1622132176) - -### [Unreddit](https://addons.mozilla.org/en-US/firefox/addon/unreddit/) -Read removed Reddit comments. - -![Unreddit](https://addons.mozilla.org/user-media/previews/thumbs/218/218512.jpg?modified=1622134062) diff --git a/content/posts/buffer-overflow.md b/content/posts/buffer-overflow.md @@ -1,91 +0,0 @@ ---- -title: "Buffer Overflows: Keep Your Code Safe" -date: 2022-12-14T18:59:28+02:00 -categories: ['Articles'] -tags: ['Security', 'Programming'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [Programming a Vulnerable Program](#programming-a-vulnerable-program) -- [Preventing Buffer Overflow Attacks](#preventing-buffer-overflow-attacks) - -<!-- markdown-toc end --> - -A buffer overflow attack is a type of cyber attack in which an attacker attempts to write more data to a buffer (a temporary data storage area) in a computer's memory than the buffer is designed to hold. -This can cause the buffer to overflow, or exceed its maximum capacity, which can corrupt other parts of the computer's memory and allow the attacker to gain unauthorized access to the system. - -In this post we will explore more about how a buffer overflow attack works and how to prevent it. - -# Programming a Vulnerable Program - -Buffer overflows are a common security vulnerability in computer programs, especially those written in the C programming language. -In C, buffers are often used to store strings of characters, such as user input or file contents. -When a program receives input from a user or reads data from a file, it writes that data to a buffer. -If the amount of data is larger than the size of the buffer, the excess data will overflow into other parts of the computer's memory, potentially overwriting or corrupting other data. - -Lets write a basic program in C that is vulnerable to a buffer overflow attack. Load up your favourite text editor and create a file called `vuln.c`, then copy and paste the following: -``` c -#include <stdio.h> -#include <string.h> - -void vulnerable_function(char* input) { - char buffer[8]; - strcpy(buffer, input); - printf("The input is: %s\n", buffer); -} - -int main(int argc, char* argv[]) { - vulnerable_function(argv[1]); - - return 0; -} - -``` - -This program contains a function called `vulnerable_function()` that takes a string of characters as input. -The function declares a buffer called 'buffer' with a size of 8 characters. -It then uses the `strcpy()` function to copy the input string into the buffer. -Finally, it prints the contents of the buffer using the `printf()` function. - -To compile this code, we need a C compiler. -GCC (GNU Compiler Collection) is a fantastic C compiler and what I will use in this post. -<!-- , it is the standard C compiler for Unix-like systems like Linux and macOS. --> - -To compile the code and generate an executable file called `vuln`, you can run the following command: - -``` shell -gcc -o vuln vuln.c -``` - -To use gdb to debug the vuln program, you can use the following steps: - -1. Start gdb by running the `gdb` command. - -2. Load the vuln program into gdb by running the `file vuln` command. - -3. Run the program by running the `run` command. - -4. When the program stops at the beginning of the `main()` function, you can set a breakpoint at the beginning of the `vulnerable_function()` function by running the `break vulnerable_function` command. - -5. Run the program again by running the `run` command. This time, the program will stop at the breakpoint in the `vulnerable_function()` function. - -6. Step through the code line by line by running the `next` command. You can use the print command to print the values of variables and the `x` command to examine the contents of memory. - -7. When the program reaches the `strcpy()` function, you can see that the buffer overflows if the input string is longer than 8 characters. - -# Preventing Buffer Overflow Attacks - -To prevent buffer overflow attacks, it is important to carefully design and implement your code to avoid such vulnerabilities. Here are some best practices to follow: - -1. Use safe functions for handling strings and other data. In C, the `strncpy()` and `strncat()` functions are safer alternatives to `strcpy()` and `strcat()` because they allow you to specify the maximum number of characters to copy or concatenate. - -2. Avoid using `gets()`, which is a particularly dangerous function because it does not check the size of the input and can therefore easily cause a buffer overflow. Instead, use `fgets()` or `getline()`, which allow you to specify the maximum size of the input. - -3. Always check the return value of functions that handle strings or other data. If a function returns a value indicating that an error occurred or that the input was too large, you can take appropriate action, such as truncating the input or displaying an error message. - -4. Use secure coding practices, such as avoiding the use of hard-coded passwords, sanitizing user input to prevent SQL injection attacks, and using encryption to protect sensitive data. - -By following these best practices, you can help protect your code from buffer overflow attacks and keep your computer systems secure. diff --git a/content/posts/enable-monitor-mode-on-tp-link.md b/content/posts/enable-monitor-mode-on-tp-link.md @@ -1,137 +0,0 @@ ---- -title: "Enable Monitor Mode on TP-Link TL-WN722N" -date: 2022-12-16T13:07:05+02:00 -categories: ['Tutorials'] -tags: ['Networking', 'Hardware'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [TP-Link TL-WN722N _v1 vs v2/v3_](#tp-link-tl-wn722n-_v1-vs-v2v3_) -- [Enabling Monitor Mode](#enabling-monitor-mode) - - [v1](#v1) - - [v2/v3](#v2v3) - - [Upgrade your system](#upgrade-your-system) - - [Install headers](#install-headers) - - [Change the kernel module](#change-the-kernel-module) - - [Enable monitor mode](#enable-monitor-mode) - -<!-- markdown-toc end --> - -# TP-Link TL-WN722N _v1 vs v2/v3_ - -The TP-Link TL-WN722N is a wireless network interface controller (NIC) that allows a computer to connect to a wireless network. -There are three versions of this NIC: v1, v2, and v3. While all three versions are similar in many ways, there are some notable differences between them. - -One of the main differences between the TP-Link TL-WN722N v1 and v2/v3 is the chipset they use. -- The v1 version uses a `Atheros AR9271` chipset -- The v2/v3 versions use a `Realtek RTL8188EUS` chipset - -The Atheros chip supports monitor mode and packet injection out of the box, but the Realtek chip requires changing the drivers. - -# Enabling Monitor Mode - -## v1 - -Run the following command: -``` shell -sudo airmon-ng start wlan0 -``` - -That's it, you should see that your card is in monitor mode when running the following: -``` shell -sudo iwconfig | grep "Mode" -``` - -## v2/v3 - -### Upgrade your system - -On Debian-based systems (like Kali): -``` shell -sudo apt update && apt upgrade -``` - -On Arch-based systems (like Blackarch): -``` shell -sudo pacman -Syu -``` - -Then reboot: -``` shell -sudo reboot -``` - -### Install headers - -Debian-based: -``` shell -sudo apt install linux-headers-$(uname -r) -``` - -Arch-based: -``` shell -sudo pacman -S install linux-headers-$(uname -r) -``` - -### Change the kernel module - -Remove the previous driver module: -``` shell -sudo rmmod r8188eu.ko -``` - -Blacklist the old module: -``` shell -sudo echo "blacklist r8188eu" > "/etc/modprobe.d/realtek.conf" -``` - -Clone the new driver: -``` shell -git clone https://github.com/aircrack-ng/rtl8188eus -``` - -Install the new driver module: -``` shell -cd rtl8188eus -``` -``` shell -make -``` -``` shell -sudo make install -``` - -Enable the new module: -``` shell -sudo modprobe 8188eu -``` - -Reboot: -``` shell -sudo reboot -``` - -### Enable monitor mode - -Kill all airmon-ng processes: -``` shell -sudo airmon-ng check kill -``` - -Set adapter to monitor mode: -``` shell -sudo iwconfig wlan0 mode monitor -``` - -Bring the interface up: -``` shell -sudo ifconfig wlan0 up -``` - -Test to see if packet injection works: -``` shell -sudo aireplay-ng --test wlan0 -``` diff --git a/content/posts/how-to-create-your-own-website.md b/content/posts/how-to-create-your-own-website.md @@ -1,131 +0,0 @@ ---- -title: "How to Create Your Own Static Website in Under an Hour" -date: 2022-12-03T19:39:46+02:00 -categories: ['Tutorials'] -tags: ['Web Development'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [Building The Site](#building-the-site) -- [Hosting Your Site](#hosting-your-site) -- [Getting a Custom Domain (Not Free)](#getting-a-custom-domain-not-free) - -<!-- markdown-toc end --> - -Setting up your own static website can be a great way to showcase your personal brand, portfolio, or business online. -In this post, we'll walk through the process of setting up a static website using Hugo as the static site generator and Netlify as the hosting service. - -# Building The Site - -First, let's talk about what a static website is and why it's a good choice for many people. -A static website is a website that is built using only HTML, CSS, and JavaScript files. -These files are served to the user's web browser as-is, without the need for any server-side processing. -This makes static websites fast, secure, and easy to maintain. - -Hugo is a popular open-source static site generator that makes it easy to create and manage a static website. -It has a simple, easy-to-use interface and comes with a wide range of customizable templates and themes. - -To get started with Hugo, you'll need to download and install Hugo on your computer. - -1. Once you have Hugo installed, you can create a new website by running the following command in your terminal: - ``` shell - hugo new site SITE-NAME - ``` - This will create a new Hugo project in the current directory. - -2. Next, install git and initialize the directory as a git repository: - ``` shell - git init - ``` - Initializing the directory as a git repository is a useful way to keep track of changes and it will also be needed later when we upload our site to GitHub. - -3. Download a theme for you website from https://themes.gohugo.io/. A hugo theme is a template that defines the look and feel of your site. Add a theme to your site by running the following command in the root directory of your site: - ``` shell - git submodule add https://github.com/THEME_NAME/ themes/ - ``` - This will create a folder in the `/themes/` directory where your theme is stored. - -3. Open the `config.toml` file and edit according to your theme. - -4. Create content for your website by using the `hugo new` command. e.g. - ``` shell - hugo new posts/my-first-post.md - ``` - This will create a markdown file under the `/content/posts/` directory where you can edit your content. Hugo uses Markdown files for content, which makes it easy to write and format your content using a simple, readable syntax. - -5. Run the following command in the directory of your site: - ``` shell - hugo server - ``` - Hugo will build a local version of your site that you can view by going to `http://localhost:1313/` inside your browser. Hugo will also automatically show any changes you make to the site, no need to rerun the command or refresh the page. - -# Hosting Your Site - -Hosting a static website refers to the process of making a website accessible to the internet by storing its files on a web server. -A static website is one that contains static content, meaning that the content does not change unless manually updated by the website owner. -This is in contrast to a dynamic website, which generates content on the fly using server-side programming languages such as PHP or ASP.NET. - -To host a static website, you need to sign up for a web hosting service that provides the necessary storage space and bandwidth to host your website. -There are many web hosting providers available, each offering different plans and pricing options. S -ome of the most popular options include *shared hosting*, *VPS hosting*, and *dedicated hosting*. - -One solution for hosting a static website is to use a platform like Netlify. -Netlify is a cloud-based service that allows you to easily deploy and host static websites for free. -It provides a simple interface for uploading your website files, and automatically takes care of the necessary tasks such as setting up DNS records and configuring a CDN to ensure fast loading times for your website. - -In addition to hosting your static website for free, Netlify also offers a range of advanced features such as continuous deployment, split testing, and form handling. -This makes it a great option for teams and individuals looking to quickly and easily host and manage their static websites. - -To host a Hugo site on Netlify, you need to follow these steps: - -1. Create a new repository on GitHub with the name of your site - -2. On you local machine, navigate to the root directory of you Hugo site and run the following commands to create a new repository and push it to GitHub: - - ``` shell - # Add all files in the Hugo site to the Git repository - $ git add . - - # Commit the changes to the repository - $ git commit -m "Initial commit of Hugo site" - - # Add the GitHub repository as a remote to your local Git repository - $ git remote add origin <GitHub repository URL> - - # Push the Hugo site to the GitHub repository - $ git push -u origin master - ``` - -3. Once your Hugo site has been pushed to GitHub, you can connect your GitHub account to Netlify by signing in to Netlify and following the instructions on the Netlify website. - -4. Once your GitHub account is connected to Netlify, you can set up Netlify to deploy your Hugo site by clicking the "New site from Git" button and selecting your Hugo site's repository from the list of available repositories. - -5. In the next step, you need to configure the build settings for your Hugo site. This includes specifying the version of Hugo to use, the command to build your site, and the directory where the built site should be stored. - -6. After configuring the build settings, you can click the "Deploy site" button to deploy your Hugo site to Netlify. Netlify will automatically build your site using Hugo and make it available at a unique URL. For now, you can access your site by visiting the URL provided by Netlify, but in the next section we will setup a custom domain. - -That's it! Your Hugo site is now hosted on Netlify and available to the world. - -# Getting a Custom Domain (Not Free) - -Setting up a custom domain for your website involves purchasing a domain name and configuring it to point to your website's files on the web server. -A domain name is the unique address that users can type in their web browser to access your website, such as www.google.com. - -Purchasing a domain name typically costs money, as domain names are registered on a yearly basis and need to be renewed periodically to maintain ownership. -The exact cost of a domain name can vary depending on the domain registrar and the specific top-level domain (TLD) you choose (e.g. .com, .net, .org, etc.). - -There are many domain registrars available where you can purchase a domain name, such as GoDaddy, Namecheap, and Google Domains. -When choosing a domain registrar, it's important to consider factors such as pricing, customer support, and additional services offered (such as privacy protection and email hosting). - -Since we're already hosting a site on Netlify we can just purchase the domain from them. -One advantage of purchasing a domain name from Netlify is that it makes the process of setting up your custom domain easier. -Netlify provides a simple interface for purchasing and configuring your domain, and automatically sets up the necessary DNS records to point your domain to your website on Netlify's servers. A -dditionally, Netlify offers free SSL certificates for custom domains, which helps to secure your website and improve its ranking on search engines. - - -In conclusion, building your own website is a rewarding and empowering experience that allows you to share your ideas, passions, and creations with the world. -By using a static site generator like Hugo, you can quickly and easily create a professional-looking website without needing to write any complex code. -Overall, building and hosting your own website is a great way to share your creativity and ideas with the world, and can be a fun and rewarding experience. diff --git a/content/posts/read-more.md b/content/posts/read-more.md @@ -1,62 +0,0 @@ ---- -title: "Unlock the Joy of Reading: Simple Strategies to Read More" -date: 2023-03-13T20:36:16+02:00 -categories: ['Guides'] -tags: ['Reading', 'Productivity'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [Set Small, Achievable Goals](#set-small-achievable-goals) -- [Focus on the Chapters That Intrigue You](#focus-on-the-chapters-that-intrigue-you) -- [Embrace the Art of Moving On](#embrace-the-art-of-moving-on) -- [Read Multiple Books at Once](#read-multiple-books-at-once) - -<!-- markdown-toc end --> - -In today's fast-paced world, finding time to read can be challenging. -However, reading provides numerous benefits, such as boosting mental stimulation, reducing stress, and expanding our knowledge. -If you've been struggling to incorporate more reading into your life, don't worry – you're not alone. -In this blog post, we'll explore some easy and effective strategies to help you read more and enjoy the process. - -# Set Small, Achievable Goals - -When setting reading goals, it's crucial to avoid overwhelming yourself with unrealistic expectations. -Large goals, like reading for 30 minutes every day, can be challenging to maintain consistently. -Once we fail to meet such a goal, it can quickly spiral into a habit of not reading at all. -To counteract this, establish micro-goals that are almost impossible to miss, such as reading just one page a day. -This achievable target ensures you never fall into the habit of skipping your daily reading, and more often than not, you'll find yourself exceeding the goal and reading even more. By focusing on micro-goals, you build a sustainable reading habit that becomes second nature. - -# Focus on the Chapters That Intrigue You - -This tip is particularly relevant for non-fiction books, such as popular science titles, but can apply to other genres as well. -When diving into a book, you may find that only certain chapters capture your interest. -Instead of forcing yourself to read every single page, feel empowered to focus on the sections that truly engage you. -This approach maximizes your enjoyment and allows you to extract the most valuable information from the book. - -And yes, even if you haven't read every chapter, you can still claim that you've read the book. -After all, reading is a personal journey, and there's no rule stating that you must consume every word from cover to cover. -Embrace a tailored reading experience that caters to your interests and curiosity. - -# Embrace the Art of Moving On - -It's common to feel obliged to finish a book, especially if we've invested money in purchasing it. -This sense of obligation can sometimes lead us to stop reading altogether when we're struggling with an uninteresting book. -It's important to recognize this as the sunk cost fallacy – the misconception that we must continue an activity because of the resources we've already spent on it. - -To break free from this mindset, give yourself permission to move on from a book that isn't enjoyable. -Remember, reading is meant to be a pleasurable experience that enriches our lives, not a burdensome obligation. -By letting go of books that don't engage you, you create space for discovering new, captivating stories that reignite your passion for reading. -Don't let the sunk cost fallacy dictate your reading habits – embrace the freedom to explore new literary worlds without guilt. - -# Read Multiple Books at Once - -Our mood and energy levels can significantly influence our reading preferences. -Sometimes, we might be in the midst of a complex book, such as Kant's Critique of Pure Reason, which requires substantial thought and concentration. -However, after a long day at work or school, we might crave something lighter and more accessible. - -To ensure that your reading doesn't come to a halt due to mood fluctuations, keep a selection of books on hand that cater to different mental states and preferences. -This approach allows you to switch between books depending on your mood and energy levels, ensuring that you always have something enjoyable to read. -By maintaining a diverse reading list, you'll keep the momentum going and continue to reap the benefits of reading, no matter how you're feeling. diff --git a/content/posts/replace-jupyter-notebook-with-emacs-org-mode.md b/content/posts/replace-jupyter-notebook-with-emacs-org-mode.md @@ -1,324 +0,0 @@ ---- -title: "Replace Jupyter Notebook With Emacs Org Mode: Unleash the Power of Literate Programming" -date: 2023-02-27T15:06:40+02:00 -categories: ['Guides'] -tags: ['Emacs', 'Programming'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [Introduction](#introduction) -- [What is Emacs Org Mode?](#what-is-emacs-org-mode) -- [Why Replace Jupyter Notebook with Emacs Org Mode?](#why-replace-jupyter-notebook-with-emacs-org-mode) -- [Getting Started with Emacs Org Mode for Literate Programming](#getting-started-with-emacs-org-mode-for-literate-programming) - - [Installing Emacs](#installing-emacs) - - [Configuring Org Mode](#configuring-org-mode) - - [Installing essential packages for data science](#installing-essential-packages-for-data-science) - - [Setting up a Python environment in Emacs](#setting-up-a-python-environment-in-emacs) - - [Creating and organizing Org files for literate programming](#creating-and-organizing-org-files-for-literate-programming) -- [Advanced Features of Emacs Org Mode for Data Science](#advanced-features-of-emacs-org-mode-for-data-science) - - [Working with multiple languages in a single Org file](#working-with-multiple-languages-in-a-single-org-file) - - [Integrating with external tools and libraries](#integrating-with-external-tools-and-libraries) - - [Debugging and profiling code within Org Mode](#debugging-and-profiling-code-within-org-mode) - - [Customizing code block execution and display options](#customizing-code-block-execution-and-display-options) - - [Utilizing Org Mode for project management and collaboration](#utilizing-org-mode-for-project-management-and-collaboration) -- [Tips and Tricks for Optimizing Your Emacs Org Mode Workflow](#tips-and-tricks-for-optimizing-your-emacs-org-mode-workflow) - - [Keyboard shortcuts for Org Mode](#keyboard-shortcuts-for-org-mode) - - [Customizing your Emacs theme](#customizing-your-emacs-theme) - - [Integrating with other Emacs packages for productivity](#integrating-with-other-emacs-packages-for-productivity) - - [Using Org Mode for note-taking and knowledge management](#using-org-mode-for-note-taking-and-knowledge-management) -- [Transitioning from Jupyter Notebook to Emacs Org Mode](#transitioning-from-jupyter-notebook-to-emacs-org-mode) - - [Importing existing Jupyter Notebooks into Org Mode](#importing-existing-jupyter-notebooks-into-org-mode) - - [Exporting Org files to Jupyter Notebook format](#exporting-org-files-to-jupyter-notebook-format) - - [Overcoming common challenges during the transition](#overcoming-common-challenges-during-the-transition) -- [Conclusion](#conclusion) - -<!-- markdown-toc end --> - -# Introduction - -The popularity of Jupyter Notebook has surged in recent years as a powerful tool for interactive data analysis and visualization. -However, there is an alternative that has been around for a longer time and is proving to be a valuable resource for many programmers: Emacs Org Mode. -In this blog post, we will explore how you can replace Jupyter Notebook with Emacs Org Mode for a seamless and efficient literate programming experience. - -# What is Emacs Org Mode? - -Emacs Org Mode is an extension of the versatile Emacs text editor, offering a powerful platform for note-taking, project management, and literate programming. -Literate programming is an approach in which code and documentation are intertwined, allowing you to create executable documents that can be easily understood by others. -Org Mode excels at this by providing a simple and intuitive markup language that supports rich text formatting, embedded code, and exporting to various formats, such as HTML, PDF, and more. - -# Why Replace Jupyter Notebook with Emacs Org Mode? - -- Unified Environment: Emacs provides a unified environment for all your programming and text editing needs. With Org Mode, you can manage code, documentation, and project planning all within a single tool. This eliminates the need to switch between multiple applications, streamlining your workflow. - -- Extensibility: Emacs is known for its extensibility, and Org Mode is no exception. There are countless plugins and extensions available that can enhance your literate programming experience, such as `org-babel` for code execution, `org-ref` for bibliography management, and `org-present` for presentation support. - -- Version Control: Emacs integrates seamlessly with version control systems like Git, allowing you to track changes and collaborate with others easily. This is particularly useful for literate programming, as both code and documentation can be managed in the same repository. - -- Customization: Emacs and Org Mode can be tailored to suit your needs, from key bindings and appearance to functionality. This flexibility allows you to create a personalized environment that aligns with your preferences and workflow. - -# Getting Started with Emacs Org Mode for Literate Programming - -## Installing Emacs - -1. Choose your platform: - - Linux: Use your distribution's package manager to install Emacs (e.g., `sudo apt-get install emacs` for Ubuntu) - - macOS: Install Emacs using Homebrew (https://brew.sh/) with the command: `brew install --cask emacs` - - Windows: Download the installer from the official GNU Emacs website (https://www.gnu.org/software/emacs/) - -2. Launch Emacs and familiarize yourself with the interface. - -## Configuring Org Mode - -1. Ensure Org Mode is installed and up-to-date by checking your Emacs package list (`M-x list-packages`) or manually updating it. - -2. Add Org Mode configuration settings to your Emacs init file (usually `.emacs` or `init.el`). For example: - ```elisp - (require 'org) - (setq org-src-fontify-natively t) - (setq org-confirm-babel-evaluate nil) - ``` - -## Installing essential packages for data science - -Install the following packages using the built-in Emacs package manager (`M-x list-packages`): -- `org-babel`: For code block execution and literate programming -- `ess`: For R programming language support -- `elpy`: For Python programming language support - -Configure the installed packages by adding appropriate settings to your Emacs init file. - -## Setting up a Python environment in Emacs - -1. Ensure Python is installed on your system and available in your PATH. - -2. Install the ipython packages using pip: - ```shell - pip install ipython - ``` - -3. Configure Emacs to use IPython as the default Python interpreter by adding the following to your Emacs init file: - ```elisp - (setq python-shell-interpreter "ipython" - python-shell-interpreter-args "-i --simple-prompt") - ``` - -## Creating and organizing Org files for literate programming - -1. Create a new Org file with the extension `.org` (e.g., `my_project.org`). - -2. Learn the basics of Org Mode markup, such as headings, lists, and links. - -2. Write and execute code blocks within your Org file: - - Inline code execution: Use `src_<language>{<code>}` to insert inline code (e.g., `src_python{2 + 3}`). - - Code block execution: Use the following syntax to create a code block: - - ```org - #+BEGIN_SRC <language> - <code> - #+END_SRC - ``` -For example: - -```org -#+BEGIN_SRC python -print("Hello, Emacs Org Mode!") -#+END_SRC -``` - -- Execute code blocks using `C-c C-c` and display the results directly in your Org file. -- Export your Org file to various formats (e.g., HTML, PDF) for sharing and publishing. - -# Advanced Features of Emacs Org Mode for Data Science - -## Working with multiple languages in a single Org file - -Org Mode's support for various programming languages allows you to work with multiple languages in a single document. - -Configure additional languages in your Emacs init file by adding the appropriate org-babel settings, such as: - -```elisp -(org-babel-do-load-languages - 'org-babel-load-languages - '((python . t) - (R . t) - (shell . t) - ;; Add other languages here - )) -``` - -## Integrating with external tools and libraries - -Use Org Mode's `#+CALL` syntax to integrate external tools or libraries into your Org document. - -Example: Integrating Pandoc for document conversion: - -```org -#+NAME: pandoc -#+BEGIN_SRC sh :results output :var input="input.md" output="output.pdf" -pandoc $input -o $output -#+END_SRC - -#+CALL: pandoc(input="my_markdown_file.md", output="my_converted_file.pdf") -``` - -## Debugging and profiling code within Org Mode - -Leverage the debugging and profiling capabilities of your programming language within Org Mode. - -Example: Debugging Python code with pdb: - -```org -#+BEGIN_SRC python :results output -import pdb - -def my_function(a, b): - pdb.set_trace() - return a + b - -my_function(3, 5) -#+END_SRC -``` - -## Customizing code block execution and display options - -Customize code block execution with header arguments. - -Example: Exporting code block results as a separate file: - -```org -#+BEGIN_SRC python :results file :file output.png -import matplotlib.pyplot as plt - -x = [1, 2, 3, 4] -y = [2, 4, 6, 8] - -plt.plot(x, y) -plt.savefig('output.png') -#+END_SRC -``` - -## Utilizing Org Mode for project management and collaboration - -- Take advantage of Org Mode's task management and agenda features to manage data science projects. -- Create TODO items, set deadlines, and track progress using Org Mode. -- Collaborate with teammates by sharing Org files and using Git for version control. -- Example: Project management in Org Mode: - - ```org - * TODO Prepare dataset - DEADLINE: <2023-04-01> - * TODO Train machine learning model - DEADLINE: <2023-04-15> - * DONE Write report - CLOSED: [2023-03-25] - ``` - -# Tips and Tricks for Optimizing Your Emacs Org Mode Workflow - -## Keyboard shortcuts for Org Mode - -Learn and utilize Org Mode's keyboard shortcuts to improve your productivity: -- `C-c C-t`: Toggle TODO states -- `C-c C-s`: Schedule a task -- `C-c C-d`: Set a deadline -- `C-c C-o`: Open a link -- `TAB`: Fold/unfold headings -- `S-TAB`: Fold/unfold all headings - -Customize your own keyboard shortcuts in your Emacs init file, if needed. - -## Customizing your Emacs theme - -Choose from various built-in and community-provided Emacs themes to personalize your workspace. - -Install a new theme using the Emacs package manager (`M-x list-packages`), and activate it by adding the following to your Emacs init file: - -```elisp -(load-theme 'theme-name t) -``` -Adjust the appearance of Org Mode elements (e.g., headings, links, and code blocks) by customizing their faces. - -## Integrating with other Emacs packages for productivity - -Enhance your Org Mode experience by integrating it with other Emacs packages: -- `org-ref`: Manage citations and references within Org documents -- `org-brain`: Create a personal wiki or knowledge base using Org Mode -- `magit`: Integrate Git version control with your Org workflow -- `org-present`: Create presentations using Org Mode - -Install and configure these packages according to their respective documentation. - -## Using Org Mode for note-taking and knowledge management - -Use Org Mode as a powerful note-taking tool to complement your data science projects. - -Organize and search your notes using Org Mode's hierarchical structure and built-in search capabilities. - -Example: Organizing notes in Org Mode: - -```org -* Data Science Concepts -** Supervised Learning -*** Regression -- Linear Regression -- Polynomial Regression -*** Classification -- Logistic Regression -- Decision Trees -** Unsupervised Learning -*** Clustering -- K-means Clustering -- Hierarchical Clustering -``` -# Transitioning from Jupyter Notebook to Emacs Org Mode - -## Importing existing Jupyter Notebooks into Org Mode - -Use jupytext to convert Jupyter Notebooks to Org Mode files: -- Install jupytext with the command: `pip install jupytext` -- Convert your Jupyter Notebook (`.ipynb`) to an Org Mode file (`.org`) using the following command: - ```shell - jupytext --to org my_notebook.ipynb - ``` --Review the converted Org Mode file to ensure proper formatting and correct any issues. - -## Exporting Org files to Jupyter Notebook format - -- Use jupytext to convert Org Mode files back to Jupyter Notebooks, if needed: -- Convert your Org Mode file (`.org`) to a Jupyter Notebook (`.ipynb`) using the following command: - ```shell - jupytext --to ipynb my_org_file.org - ``` -- Open the converted Jupyter Notebook with your preferred Jupyter environment (e.g., JupyterLab, Jupyter Notebook) and verify its contents. - -## Overcoming common challenges during the transition - -- Familiarize yourself with Emacs key bindings and commands, which may differ significantly from traditional text editors. -- Take the time to explore and customize your Emacs settings to create a comfortable and productive workspace. -- Seek help from the Emacs and Org Mode communities through online forums, mailing lists, and chat rooms. Many users are happy to share their experiences and offer support. - -# Conclusion - -## Recap of the benefits of using Emacs Org Mode for data science - -- Emacs Org Mode offers a powerful, flexible, and customizable environment for data science tasks, addressing many limitations of Jupyter Notebook. -- Org Mode's support for literate programming enables seamless integration of code, results, and documentation, promoting reproducible research and collaboration. -- The extensible nature of Emacs allows users to tailor their workflow to their specific needs, integrating various programming languages, tools, and productivity-enhancing packages. - -## Emphasizing the flexibility and customizability of Emacs Org Mode - -- One of the most significant advantages of Emacs Org Mode is its customizability, allowing users to create a personalized workspace that suits their needs and preferences. -- Users can choose from a wide variety of packages, themes, and settings to create an environment that enhances their productivity and enjoyment of the data science process. - -## Encouragement for readers to give Emacs Org Mode a try - -- If you're intrigued by the benefits of Emacs Org Mode for data science, consider giving it a try and experiencing its capabilities firsthand. -- Transitioning from Jupyter Notebook to Emacs Org Mode may require some initial effort, but the long-term gains in productivity and flexibility can be well worth the investment. - -## Invitation to join the Emacs Org Mode community and share experiences - -- As you embark on your journey with Emacs Org Mode, don't hesitate to reach out to the vibrant community of users and developers for help, support, and inspiration. -- Share your experiences, tips, and tricks with others, contributing to the collective knowledge and strengthening the community of Emacs Org Mode enthusiasts in the data science world. diff --git a/content/posts/stop-using-proprietary-software.md b/content/posts/stop-using-proprietary-software.md @@ -1,63 +0,0 @@ ---- -title: "Free Yourself from the Shackles of Proprietary Software: A Rant" -date: 2023-03-27T21:19:13+02:00 -categories: ['Editorials'] -tags: ['Open-source', 'Software'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [Introduction](#introduction) -- [The Greed of Corporations](#the-greed-of-corporations) -- [Lack of Customization and Flexibility](#lack-of-customization-and-flexibility) -- [The Inevitable Obsolescence](#the-inevitable-obsolescence) -- [A Breeding Ground for Security Risks](#a-breeding-ground-for-security-risks) -- [Stifling Collaboration and Knowledge Sharing](#stifling-collaboration-and-knowledge-sharing) -- [Conclusion](#conclusion) - -<!-- markdown-toc end --> - -# Introduction - -Have you ever found yourself frustrated by the limitations, restrictions, and lack of control you have when using proprietary software? -Welcome to the club. -So, let's dive into the many reasons why proprietary software is terrible and why we, as users and developers, should put our collective foot down and demand change. - -# The Greed of Corporations - -Proprietary software is the epitome of corporate greed, the embodiment of a money-hungry system that thrives on the limitations and frustrations it imposes upon users. -It's time to unshackle ourselves from the chains of expensive licensing fees, forced upgrades, and the never-ending cycle of subscription-based models that drain our wallets and limit our freedom to innovate. - -# Lack of Customization and Flexibility - -How many times have you used a piece of software and thought, "If only I could change this one feature or tweak this setting, it would be perfect?" Well, with proprietary software, that's just a pipe dream. -The rigidity of proprietary software stifles creativity and innovation, leaving you stuck with whatever features the software company deems necessary or, more likely, profitable. -Open-source software, on the other hand, empowers users and developers to modify, improve, and adapt the software to meet their unique needs. - -# The Inevitable Obsolescence - -Ever had a software program you loved, only to have it rendered useless when the company decided to discontinue support or force an unwanted upgrade? -It's frustrating, to say the least. -With proprietary software, you're completely at the mercy of the company's whims and decisions. -Open-source software, however, offers longevity and security, as it can be maintained and updated by a dedicated community of developers, even if the original creator moves on. - -# A Breeding Ground for Security Risks - -When it comes to proprietary software, you're essentially putting blind trust in the company to keep your data safe and protect you from security threats. -But we've all heard the horror stories of data breaches and hackers exploiting vulnerabilities in widely-used software. -Open-source software provides a level of transparency and peer review that can help identify and fix security issues faster and more efficiently. - -# Stifling Collaboration and Knowledge Sharing - -Proprietary software creates a culture of secrecy and competition, where companies guard their trade secrets and intellectual property like a dragon hoarding gold. -This prevents the sharing of knowledge and ideas that could lead to better software and technology for everyone. -Open-source software, conversely, fosters collaboration, community, and knowledge sharing that benefits the entire industry and its users. - -# Conclusion - -The time has come to break free from the limitations and frustrations of proprietary software. -We must recognize the value and potential of open-source alternatives and demand transparency, flexibility, and collaboration from the software industry. -By embracing the open-source movement, we can help create a world where software is not only more accessible and customizable but also more secure and innovative. -So, next time you're considering a software purchase or download, remember: there's a whole world of open-source alternatives out there, just waiting for you to explore. diff --git a/content/posts/turning-a-window-manager-into-a-desktop-environment.md b/content/posts/turning-a-window-manager-into-a-desktop-environment.md @@ -1,247 +0,0 @@ ---- -title: "The Ultimate Guide to Building Your Own Desktop Environment" -date: 2022-12-11T21:31:27+02:00 -categories: ['Guides'] -tags: ['Linux', 'Desktop Environment'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [Introduction](#introduction) -- [Turning a window manager into a desktop environment](#turning-a-window-manager-into-a-desktop-environment) - - [Window Manager](#window-manager) - - [Display Manager](#display-manager) - - [Compositor](#compositor) - - [Additional Utilities](#additional-utilities) - - [Wallpaper Setter](#wallpaper-setter) - - [Bar](#bar) - - [Application Launcher](#application-launcher) - - [System Tray](#system-tray) - - [Polkit](#polkit) -- [Customizing your window manager](#customizing-your-window-manager) -- [Benefits and drawbacks](#benefits-and-drawbacks) - -<!-- markdown-toc end --> - -<!-- TODO add notification daemon--> - -# Introduction - -If you're a Linux user, you're probably familiar with the concept of window managers and desktop environments. -These programs are responsible for managing the appearance and functionality of your desktop, providing the tools and features that you need to interact with your operating system. - -But what's the difference between a window manager and a desktop environment? -And why might someone want to turn a window manager into a desktop environment? - -In this blog post, we'll explore these questions and more. -I'll provide a step-by-step guide on how to turn a window manager into a desktop environment, along with tips and tricks for customizing your window manager and making it more user-friendly. -We'll also discuss the benefits and drawbacks of using a window manager as a desktop environment, and compare popular window managers and desktop environments. - -So let's dive in and learn more about the fascinating world of window managers and desktop environments! - -# Turning a window manager into a desktop environment - -If you want to turn a window manager into a desktop environment, the first thing you need to do is install the necessary components. -This typically includes the window manager itself, a display manager, and additional utilities and applications. - -Let's explore some of these components: - -## Window Manager - -A window manager is a program that manages the placement and appearance of windows on a computer's desktop. -It is responsible for providing the "frame" around each window, allowing the user to move, resize, and minimize windows. -A window manager also provides the ability to switch between windows and to tile them on the desktop in various ways. - -There are many different window managers available for Linux and other operating systems. -Some of the most popular ones include the following: - -1. **i3**: i3 is a tiling window manager that is designed to be fast and efficient. It is easy to configure and customize, and it provides a number of advanced features for power users. - -2. **Openbox**: Openbox is a lightweight and flexible window manager that is easy to customize. It provides a minimalistic interface and a wide range of options for advanced users. - -3. **bspwm**: bspwm is a tiling window manager that is based on binary space partitioning. It is lightweight and efficient, and it provides a number of advanced features, such as automatic tiling and support for multiple monitors. - -3. **dwm**: dwm is a dynamic window manager that is written in the C programming language. It is fast and lightweight, and it provides a number of advanced features, such as support for multiple monitors and a customizable status bar. - -4. **xmonad**: xmonad is a tiling window manager that is written in the Haskell programming language. It is highly configurable and customizable, and it provides a number of advanced features, such as support for multiple workspaces and automatic tiling. - -Each window manager has its own unique features and capabilities, and the right one for you will depend on your personal preferences and needs. -Some of the pros and cons of using different window managers are as follows: - -- **i3**: i3 is a powerful and customizable window manager that is well-suited for users who want a highly efficient and flexible desktop environment. It has a steep learning curve, but once you master it, you can achieve a high level of productivity. Some of the pros of using i3 are its tiling capabilities, its support for multiple workspaces, and its ability to run on low-end hardware. Some of the cons are its lack of a built-in panel or application launcher, and its reliance on keyboard shortcuts. - -- **Openbox**: Openbox is a lightweight and flexible window manager that is easy to customize. It provides a minimalistic interface and a wide range of options for advanced users. Some of the pros of using Openbox are its low resource usage, its support for desktop icons, and its ability to integrate with other desktop environments. Some of the cons are its lack of tiling capabilities, its reliance on external utilities for certain features, and its lack of a built-in system tray. - -- **bspwm**: bspwm is a tiling window manager that is based on binary space partitioning. It is lightweight and efficient, and it provides a number of advanced features, such as automatic tiling and support for multiple monitors. Some of the pros of using bspwm are its low resource usage, its advanced tiling capabilities, and its support for multiple monitors. Some of the cons are its lack of a built-in panel or application launcher, and its reliance on external utilities for certain features. - -- **dwm**: dwm is a dynamic window manager that is written in the C programming language. It is fast and lightweight, and it provides a number of advanced features, such as support for multiple monitors and a customizable status bar. Some of the pros of using dwm are its low resource usage, its fast performance, and its customizable status bar. Some of the cons are its lack of a built-in panel or application launcher, and its reliance on keyboard shortcuts. - -- **xmonad**: xmonad is a tiling window manager that is written in the Haskell programming language. It is highly configurable and customizable, and it provides a number of advanced features, such as support for multiple workspaces and automatic tiling. Some of the pros of using xmonad are its advanced tiling capabilities, its support for multiple workspaces, and its high level of configurability. Some of the cons are its steep learning curve, its lack of a built-in panel or application launcher, and its reliance on external utilities for certain features. - -## Display Manager - -A display manager is a program that manages the login and display of the desktop environment on a computer. -It is responsible for providing the login screen, allowing the user to enter their username and password, and then starting the desktop environment and managing its display. - -Some common examples of display managers include LightDM, GDM, and SDDM. -LightDM is a cross-platform display manager that is lightweight and customizable. -GDM is the default display manager on the GNOME desktop environment, and it provides a user-friendly login screen and a range of options for advanced users. -SDDM is the default display manager on the KDE desktop environment, and it provides a modern and attractive login screen. - -When you install a desktop environment on your computer, it typically includes a default display manager. -However, you can also choose to install and use a different display manager if you prefer. -For example, if you are using the Xfce desktop environment, you could choose to use LightDM instead of the default XDM display manager. - -## Compositor - -A compositor is a program that is responsible for combining the outputs of multiple applications and displaying them on the screen. -It is typically used to provide advanced graphical effects, such as transparency, animations, and 3D transformations. - -On Linux, a compositor is typically used in conjunction with a window manager to provide a desktop environment. -The window manager is responsible for managing the placement and appearance of windows on the desktop, while the compositor provides the graphical effects. -Some window managers, such as xmonad and i3, include a built-in compositor, while others, such as Openbox, dwm and bspwm, require the use of an external compositor. - -There are many compositors available for Linux, and the right one for you will depend on your personal preferences and needs. -Some popular compositors include compton, picom, and xcompmgr. Compton is a feature-rich compositor that provides a wide range of options and effects, picom is a lightweight and efficient compositor, and xcompmgr is a simple compositor that provides basic graphical effects. - -To choose a compositor, you can consider the following factors: - -1. **Features**: Different compositors provide different sets of features and capabilities. Consider which features are most important to you, and choose a compositor that provides them. - -2. **Performance**: Compositors can have a significant impact on the performance of your desktop environment. If you are using a low-end computer or you have a lot of applications running, you may want to choose a lightweight compositor that uses fewer resources. - -3. **Compatibility**: Some compositors are compatible with only certain window managers or desktop environments. If you are using a specific window manager or desktop environment, make sure the compositor you choose is compatible with it. - -## Additional Utilities - -### Wallpaper Setter - -You can use a program such as nitrogen or feh to set your wallpaper. -Nitrogen and feh are two popular programs that allow you to browse and select an image to use as your wallpaper, and then set it as the background for your desktop. - -To use nitrogen or feh to set your wallpaper, follow these steps: - -1. Install nitrogen or feh on your system. You can use your package manager to install the program, or you can download and compile the source code from the program's website. - -2. Run nitrogen or feh. This will open a window that allows you to browse and select an image to use as your wallpaper. - -3. Browse to the location of the image you want to use as your wallpaper, and select it. - -4. Once you have selected the image, click on the "Set as wallpaper" button (in nitrogen) or the "Apply" button (in feh) to set the image as your wallpaper. - -5. The selected image will now be displayed as your wallpaper. - -6. Add a line to your startup script to set the wallpaper. -If you're using nitrogen add: - ```shell - nitrogen --restore - ``` - If you're using feh add: - ```shell - feh --bg-scale /path/to/image.jpg - ``` - -### Bar - -A bar on Linux is a program that displays information on the desktop, such as the current time and date, the system load, and the status of various system services. -A bar is typically used in conjunction with a window manager or desktop environment, and it provides a convenient way to access important information without needing to open a separate application. - -There are many bars available for Linux, and the right one for you will depend on your personal preferences and the desktop environment you are using. -Some popular bars include polybar, lemonbar, i3bar, xmobar, and dwmblocks. -These bars are designed to be used with specific desktop environments or window managers, and they provide a range of features and customization options. - -For example, polybar and lemonbar are general-purpose bars that can be used with any desktop environment or window manager. -They provide a wide range of features, such as support for multiple monitors and custom colors and fonts, and they are highly customizable. -i3bar is the default bar for the i3 window manager, and it provides a minimalistic interface and support for displaying information from i3 modules. -xmobar is the default bar for the xmonad window manager, and it provides a customizable interface and support for displaying information from xmonad plugins. -dwmblocks is the default bar for the dwm window manager, and it provides a minimalist interface and support for displaying information from dwm status commands. - -To choose a bar, you can consider the following factors: - -1. **Compatibility**: Some bars are designed to be used with specific desktop environments or window managers. If you are using a specific desktop environment or window manager, make sure the bar you choose is compatible with it. - -2. **Features**: Different bars provide different sets of features and capabilities. Consider which features are most important to you, and choose a bar that provides them. - -3. **Customization**: Some bars are highly customizable, allowing you to change the appearance and behaviour of the bar to suit your preferences. If you want a bar that you can tailor to your specific needs, choose a bar that provides a high degree of customization. Polybar is a popular choice. - -### Application Launcher - -An application launcher is a program that allows you to quickly search for and launch applications on your Linux system. -An application launcher typically provides a search bar or a menu that allows you to enter the name of the application you want to launch, and it displays a list of matching applications that you can select from. - -Some popular application launchers include rofi, dmenu, and albert. - -1. **Rofi** is a flexible and customizable application launcher that allows you to search for and launch applications, as well as perform a range of other actions, such as opening a terminal or running a command. - -3. **Dmenu** is a simple and lightweight application launcher that provides a minimalistic interface and support for fuzzy search. - -4. **Albert** is a fast and efficient application launcher that uses a customizable keyboard shortcut to launch applications and perform other actions. - -### System Tray - -A system tray (also known as a notification area) is a part of the graphical user interface (GUI) on Linux (and other operating systems) that displays icons for system and application notifications. -The system tray is typically located at the bottom or side of the screen, and it provides a convenient way for applications to display important information and notifications without disrupting the user's work. - -For example, the system tray might display an icon for a network manager application, which shows the current network status and allows the user to manage their network connections. -It might also display an icon for a battery manager application, which shows the current battery level and allows the user to manage their power settings. - -### Polkit - -Polkit (formerly known as PolicyKit) is a framework for defining and managing administrative policies on Linux. -It provides a mechanism for controlling access to system-wide privileges, and it allows users to perform privileged tasks without needing to log in as the root user. - -Polkit consists of a number of components, including a daemon (polkitd), a command-line tool (polkit), and a library (libpolkit). -The polkit daemon runs in the background and listens for requests from applications that need to perform privileged tasks. -The polkit command-line tool allows administrators to manage and configure polkit policies. -The libpolkit library provides a convenient interface for developers to integrate polkit into their applications. - -See [the arch wiki](https://wiki.archlinux.org/title/Polkit) for more information. - -# Customizing your window manager - -Most window managers on Linux allow for customization to some extent. -Customizing your window manager can allow you to tailor the appearance and behaviour of your desktop environment to suit your preferences and needs. - -To customize your window manager, you will need to edit the window manager's configuration files. -These files are typically written in a scripting language, such as Lua or Shell, and they control the various aspects of the window manager's behaviour and appearance. - -Here are some examples of the types of things you can customize in your window manager: - -- **Appearance**: You can customize the appearance of your window manager by changing the colors, fonts, and other visual elements. For example, you might change the color of the window borders, the font used for window titles, or the size of gaps between windows. - -- **Keybindings**: You can customize the keybindings of your window manager to define which keys perform which actions. For example, you might bind the "Alt + Tab" keys to switch between windows, or the "Super + L" keys to lock the screen. - -- **Behaviour**: You can customize the behaviour of your window manager to control how windows are managed and displayed. For example, you might change the default layout of windows on the screen, or the way windows are focused when they are opened. - -- **Autostart**: You can customize the autostart of your window manager to define which applications are automatically launched when you log in. For example, you might specify that your web browser, email client, and music player are automatically started when you log in. - -To customize your window manager, you will need to edit the appropriate configuration files and specify the desired changes. -The exact steps for doing this will depend on the specific window manager you are using. -You can find instructions for customizing your window manager in the documentation or online forums for your window manager. - -# Benefits and drawbacks - -There are both benefits and drawbacks to using a window manager instead of a full desktop environment on Linux. - -As said before, a window manager is a program that provides the basic functions for managing windows on the desktop, such as opening, closing, minimizing, and maximizing windows. -A full desktop environment, on the other hand, is a complete graphical user interface (GUI) that includes not only a window manager, but also a range of other applications and utilities, such as a taskbar, a system tray, a file manager, and a desktop background. - -Here are some of the benefits of using a window manager instead of a full desktop environment on Linux: - -- **Lightweight**: Window managers are typically much lighter and more efficient than full desktop environments. This means they use fewer system resources, such as memory and CPU, and they can run on lower-powered hardware. - -- **Customizable**: Window managers are typically highly customizable, allowing users to tailor the appearance and behavior of their desktop environment to their preferences. This is because window managers typically have simple, modular architectures, with configuration files that are easy to edit and modify. - -- **Flexible**: Window managers are typically more flexible than full desktop environments, allowing users to mix and match different applications and utilities from different desktop environments. For example, a user might use the window manager from one desktop environment, but the file manager from another. -Here are some of the drawbacks of using a window manager instead of a full desktop environment on Linux: - -- **Less user-friendly**: Window managers are typically less user-friendly than full desktop environments, because they do not include many of the applications and utilities that users expect in a GUI. This can make it more difficult for new users to get started with a window manager, and it can limit the functionality of the desktop environment. - -- **Less integrated**: Window managers are typically less integrated than full desktop environments, because they do not include many of the applications and utilities that are designed to work together. This can lead to a less cohesive and consistent user experience, and it can make it more difficult to perform certain tasks. - -- **More complex**: Window managers are typically more complex than full desktop environments, because they require the user to manually configure and manage many of the components of the desktop environment. This can be a challenge for inexperienced users, and it can require more time and effort to set up and maintain a window manager. - -Overall, whether to use a window manager or a full desktop environment on Linux depends on your personal preferences and needs. -Some users may prefer the lightweight, customizable, and flexible nature of window managers, while others may prefer the user-friendly, integrated, and simple nature of full desktop environments. diff --git a/content/posts/what-linux-packaging-format-to-use.md b/content/posts/what-linux-packaging-format-to-use.md @@ -1,136 +0,0 @@ ---- -title: "Exploring Linux Package Formats: Which One Should You Use?" -date: 2023-01-09T13:36:52+02:00 -categories: ['Articles'] -tags: ['Linux', 'Package-management'] -draft: false ---- - -<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> -**Table of Contents** - -- [Introduction](#introduction) -- [Flatpak](#flatpak) -- [Snap](#snap) -- [Deb](#deb) -- [RPM](#rpm) -- [AppImage](#appimage) -- [AUR (Arch User Repository)](#aur-arch-user-repository) -- [Conclusion](#conclusion) - -<!-- markdown-toc end --> - -# Introduction - -Linux, a widely popular open-source operating system, is known for its versatility and adaptability. -The software distribution in Linux is primarily done through packages, which are used to install, update, and remove applications. -There are several package formats available, and choosing the right one can be confusing for newcomers or even experienced users. -In this blog post, we will discuss the key differences between popular package formats such as Flatpak, Snap, Deb, RPM, AppImage, and AUR, and provide insights to help you choose the best format for your needs. - -# Flatpak - -Flatpak is a relatively new package format. -It aims to create a universal packaging system for all Linux distributions, providing a sandboxed environment for applications. -This isolation ensures that apps have limited access to system resources, enhancing security and stability. - -## Pros: - -- Distribution-agnostic packaging system -- Improved security through sandboxing -- Easy to update and manage applications - -## Cons: - -- Increased disk space usage due to bundling of dependencies -- Slower application startup times - -# Snap - -Snap is a package format developed by Canonical, the company behind Ubuntu. -Similar to Flatpak, it focuses on providing a universal packaging system that works across multiple distributions. -Snaps are self-contained and sandboxed, which improves security and stability. - -## Pros: - -- Works across various Linux distributions -- Enhanced security with sandboxing -- Automatic updates - -## Cons: - -- Limited support for themes and desktop integration -- Increased disk space usage due to bundled dependencies - -# Deb - -Deb is the native package format for Debian-based distributions, such as Ubuntu and Linux Mint. -It uses the Advanced Package Tool (APT) for package management, making it easy to install, update, and remove applications. -Deb packages have been the standard for Debian-based systems for many years. - -## Pros: - -- Well-established and widely supported -- Efficient dependency handling -- Large repository of available packages - -## Cons: - -- Limited to Debian-based distributions -- No sandboxing or containerization - -# RPM - -RPM (RPM Package Manager) is a package format used by Red Hat-based distributions, such as Fedora and CentOS. -RPM packages are managed by various package management tools like DNF and YUM. - -## Pros: - -- Extensive support for Red Hat-based distributions -- Good dependency management -- Large repository of available packages - -## Cons: - -- Limited to Red Hat-based distributions -- No sandboxing or containerization - -# AppImage - -AppImage is a portable package format that allows users to run applications without installing them. -It is distribution-agnostic and works across various Linux distributions. -AppImages are self-contained, bundling all required dependencies, which can lead to increased disk space usage. - -## Pros: - -- Distribution-agnostic -- Portable and easy to use -- No installation required - -## Cons: - -- Increased disk space usage -- No centralized update mechanism - -# AUR (Arch User Repository) - -AUR is a community-driven repository for Arch Linux and its derivatives, such as Manjaro. -It contains a vast collection of packages that are not available in the official repositories. -Users can build and install packages directly from the AUR using helper tools like yay or paru. - -## Pros: - -- Large collection of packages -- Community-driven and maintained -- Easy to use with helper tools - -## Cons: - -- Limited to Arch-based distributions -- Packages may have varying quality and stability - -# Conclusion - -Selecting the right package format depends on various factors, such as your distribution, security requirements, and personal preferences. -If you prioritize universal compatibility and sandboxing, Flatpak and Snap are great options. -For Debian or Red Hat-based distributions, Deb and RPM are well-established choices. -If you need portability and ease of use, AppImage is the way to go. Lastly, for Arch Linux users, AUR provides a vast array of community-maintained packages. diff --git a/layouts/404.html b/layouts/404.html @@ -1,11 +0,0 @@ -{{ partial "header.html" . }} - -<h1 align="center"> - 404 -</h1> - -<h3 align="center"> - You once were found. But now you're lost :( -</h3> - -{{ partial "footer.html" . }} diff --git a/layouts/_default/_markup/render-codeblock-mermaid.html b/layouts/_default/_markup/render-codeblock-mermaid.html @@ -0,0 +1,4 @@ +<div class="mermaid"> + {{- .Inner | safeHTML }} +</div> +{{ .Page.Store.Set "hasMermaid" true }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html @@ -0,0 +1,94 @@ +<!DOCTYPE html> +<html lang="{{ .Site.LanguageCode }}" style="font-size: {{ .Site.Params.rootFontSize | default "100%" }}"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <!-- author --> + <meta name="author" content="{{ .Site.Author.name }}"> + + <!-- description --> + {{ if .Description }} + <meta name="description" content="{{ .Description }}"> + {{ else if and .IsPage .Summary }} + <meta name="description" content="{{ .Summary }}"> + {{ else }} + <meta name="description" content="{{ .Site.Params.description }}"> + {{ end }} + + <!-- favicon --> + <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png"> + <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png"> + <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png"> + + <!-- keywords --> + {{ if .Keywords }} + <meta name="keywords" content="{{ delimit .Keywords " " }} {{ delimit .Site.Params.keywords " " }}"> + {{ else }} + <meta name="keywords" content="{{ delimit .Site.Params.keywords " " }}"> + {{ end }} + + <!-- math --> + {{ if .Site.Params.math }} + {{ partial "math.html" . }} + {{ end }} + + <!-- buymeacoffee --> + {{ .Site.Params.buymeacoffee.code | safeHTML }} + + <!-- opengraph --> + {{ template "_internal/opengraph.html" . }} + + <!-- permalink --> + <link rel="canonical" href="{{ .Permalink }}"> + + <!-- rss --> + {{ range .AlternativeOutputFormats -}} + {{ printf ` + <link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + + <!-- schema --> + {{ template "_internal/schema.html" . }} + + <!-- style --> + <link media="screen" rel="stylesheet" href='{{ "css/common.css" | absURL }}'> + <link media="screen" rel="stylesheet" href='{{ "css/content.css" | absURL }}'> + + <!-- title --> + {{ if .IsHome }} + <title>{{ .Site.Title }}</title> + {{ else }} + <title>{{ .Title }} - {{ .Site.Title }}</title> + {{ end }} + + <!-- twitter --> + {{ template "_internal/twitter_cards.html" . }} + + {{ block "head" . }}{{ end }} +</head> + +<body> + <div id="wrapper"> + {{ partial "header.html" . }} + {{ block "main" . }}{{ end }} + {{ partial "footer.html" . }} + </div> + + <!-- custom css --> + {{ range .Site.Params.customCSS }} + <link media="screen" rel="stylesheet" href="{{ . | absURL }}" /> + {{ end }} + + <!-- custom js --> + {{ range .Site.Params.customJS }} + <script src="{{ . | absURL }}"></script> + {{ end }} + + <!-- google analytics --> + {{ template "_internal/google_analytics.html" . }} + +</body> + +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html @@ -1,36 +1,37 @@ -{{ partial "header.html" . }} +{{ define "head" }} +<link rel="stylesheet" href='{{ "css/list.css" | absURL }}'> +{{ end }} -<div class="content-wrapper"> - {{if not .IsHome }} - <h1>{{ .Title | markdownify }}</h1> +{{ define "main" }} +<main id="main" class="archive"> + {{ if .Site.Params.enableDuckDuckGoSearchBox }} + <div id="searchbox"> + <form method="get" id="ddgSearch" target="_blank" action="https://duckduckgo.com/"> + <input type="hidden" name="sites" value="{{ .Site.BaseURL }}"/> + <input type="hidden" name="kf" value="-1"> <!-- no favicons --> + <input type="hidden" name="kh" value="1"> <!-- https --> + <input type="hidden" name="kae" value="-1" > <!-- default theme --> + <input type="hidden" name="k1" value="-1" > <!-- no ads --> + <input type="text" name="q" placeholder="Search…" aria-label="Search michaelneuper.com on DuckDuckGo"/> + </form> + </div> + {{ end }} + {{ $pages := where .Data.Pages "Type" "post" }} + {{ range $pages.GroupByDate "2006-01" }} + <div class="post-group"> + <h2>{{ dateFormat "January 2006" (printf "%s-01" .Key) }}</h2> + <ul> + {{ range .Pages }} + <li> + <a class="link" href="{{ .RelPermalink }}">{{ .Title }}</a> + <time>{{ .PublishDate.Format .Site.Params.dateFormat }}</time> + </li> + {{ end }} + </ul> + </div> {{ end }} - - {{ .Content }} - - <ul> - {{ $pages := .Pages }} - {{ if .IsHome }}{{ $pages = first 5 .Site.RegularPages }}{{ end }} - {{ range (where $pages "Section" "!=" "") }} - <li> - <span class="date">{{ .Date.Format "2006 Jan 02" }}</span> - - <a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a> - </li> - {{ end }} - </ul> - {{ if .IsHome }} - <a href="/posts/">See All</a> - {{ end }} - - <!-- <p> --> - <!-- <img align="left" src="/images/badges/gnu.gif"> --> - <!-- <img align="left" src="/images/badges/javascript.gif"> --> - <!-- <img align="left" src="/images/badges/suckless.gif"> --> - <!-- <img align="left" src="/images/badges/libreboot.gif"> --> - <!-- <img align="left" src="/images/badges/tor.gif"> --> - <!-- <img align="left" src="/images/badges/wiby.org.gif"> --> - <!-- <img align="left" src="/images/badges/created-with-emacs.jpg"> --> - <!-- </p> --> -</div> - - -{{ partial "footer.html" . }} + <div class="post-group"> + <h2>...</h2> + </div> +</main> +{{ end }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml @@ -1,26 +1,39 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = (where (where $pctx.RegularPages ".Section" "post") "Kind" "page") -}} +{{- else -}} +{{- $pages = (where (where $pctx.Pages ".Section" "post") "Kind" "page") -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> - <title>{{ .Site.Title }}</title> - <link>{{ .Permalink }}</link> - <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> - <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} - <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} - <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} - <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} - <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} - <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} - {{ with .OutputFormats.Get "RSS" }} - {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} - {{ end }} - {{ range .Site.RegularPages }} - <item> - <title>{{ .Title }}</title> - <link>{{ .Permalink }}</link> - <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> - {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} - <guid>{{ .Permalink }}</guid> - <description>{{- .Content | html -}}</description> - </item> - {{ end }} - </channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> + <generator>Hugo -- gohugo.io</generator> + <language>{{ site.Language.LanguageCode }}</language>{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} + <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} + <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{ .Summary | html }}</description> + </item> + {{ end }} + </channel> </rss> diff --git a/layouts/_default/single.html b/layouts/_default/single.html @@ -1,33 +1,71 @@ -{{ partial "header.html" . }} -<div class="article-meta"> -<h1><span class="title">{{ .Title | markdownify }}</span></h1> -{{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }} -{{ if .Params.date }}<h2 id= "date" class="date">{{ .Date.Format "2 January 2006" }}</h2>{{ end }} -<p class="terms"> - {{ range $i := (slice "categories" "tags") }} - {{ with ($.Param $i) }} - {{ $i | title }}: {{ range $k := . }}<a href="{{ relURL (print "/" $i "/" $k | urlize) }}">{{$k}}</a> {{ end }} +{{ define "head" }} +<link rel="stylesheet" href='{{ "css/single.css" | absURL }}'> +<link rel="stylesheet" href='{{ "css/sharingbuttons.css" | absURL }}'> +{{ end }} + +{{ define "main" }} +<main id="main" class="post"> + {{ if ne .Section "post"}} + <article class="content {{ if .Site.Params.numberedSubtitles }}numbered-subtitles{{ end }}"> + {{ .Content }} + </article> + + {{ else }} + <h1 class="post-title"> + {{ .Title }} + <div class="publish-date">{{ .PublishDate.Format .Site.Params.dateFormat }}</div> + </h1> + + {{ if ne .Params.tags nil }} + <div> + {{ range .Params.tags }} + <a class="link" href='{{ "tags" | absURL }}/{{ . | urlize }}'>#{{ . }}</a> + {{ end }} + <br></br> + </div> {{ end }} + {{ if cond (ne .Params.toc nil) .Params.toc .Site.Params.toc }} + {{ if ne .TableOfContents "<nav id=\"TableOfContents\"></nav>" }} + <details> + <summary> + <b>Table of Contents</b> + </summary> + <div class="toc {{ if .Site.Params.numberedSubtitles }}numbered-subtitles{{ end }}">{{ .TableOfContents }}</div> + </details> {{ end }} -</p> -</div> - -{{ if .Params.toc }} -{{ .TableOfContents }} -{{ end }} -<div class="content-wrapper"> - <main> + {{ end }} + <article class="content {{ if .Site.Params.numberedSubtitles }}numbered-subtitles{{ end }}"> + {{ if .Site.Params.emphasisWithDots }} + {{ .Content | replaceRE "<strong>(\\p{Han}+?)</strong>" "<strong class=chinese>$1</strong>" | safeHTML }} + {{ else }} {{ .Content }} - {{ if .Type | eq "posts" }} - <div class="navbuttons"> - {{- with .Prev }} - <a href="{{ .RelPermalink }}"><div class="prev">Previous:<br>{{ .Title }}</div></a> - {{ end -}} - {{- with .Next -}} - <a href="{{ .RelPermalink }}"><div class="next">Next:<br>{{ .Title }}</div></a> - {{ end -}} - </div> {{ end }} - </main> -</div> -{{ partial "footer.html" . }} + </article> + {{ partial "sharingbuttons.html" . }} + <div class="paginator"> + {{ if .PrevInSection }} + <a class="link" href="{{ .PrevInSection.Permalink }}">← prev</a> + {{ else }} + <a></a> + {{ end }} + {{ if .NextInSection }} + <a class="link" href="{{ .NextInSection.Permalink }}">next →</a> + {{ else }} + <a></a> + {{ end }} + </div> + <div class="comment"> + <!-- disqus --> + {{ template "_internal/disqus.html" . }} + <!-- generic engine --> + {{ .Site.Params.commentEngine.code | safeHTML }} + </div> + {{ end }} +{{ if .Page.Store.Get "hasMermaid" }} + <script type="module"> + import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs'; + mermaid.initialize({ startOnLoad: true }); + </script> +{{ end }} +</main> +{{ end }} diff --git a/layouts/categories/terms.html b/layouts/categories/terms.html @@ -0,0 +1,16 @@ +{{ define "main" }} +<main id="main"> + <h1>Categories</h1> + <br style="margin-bottom: 20px"></br> + <div class="row"> + {{ range .Data.Terms.ByCount }} + <ul> + <li><a class="title is-5 is-size-6-mobile" href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> + {{ $Totalpage:= len .Pages }} + {{ $Totalpage }} post{{ if ne $Totalpage 1 }}s{{ end }} + </li> + </ul> + {{ end }} + </div> +</main> +{{ end }} +\ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html @@ -0,0 +1,33 @@ +{{ define "head" }} +<link rel="stylesheet" href='{{ "css/index.css" | absURL }}'> +{{ end }} + +{{ define "main" }} +<main class="grid-container"> + <div id="content" class="index"> + {{ with .Site.GetPage "_index.md" }} + {{ .Content }} + {{ end }} + </div> + + <div class="sidebar"> + <h3 class="taxonomy"><a href="/categories/">Categories</a></h3> + <ul class="nav-list sidenav"> + {{range first 10 ($.Site.GetPage "taxonomyTerm" "categories").Pages }} + <li> + <a href="{{ .Permalink }}">{{.Title}}</a> + </li> + {{ end }} + </ul> + <p></p> + <h3 class="taxonomy"><a href="/tags/">Tags</a></h3> + <ul class="nav-list sidenav"> + {{range first 10 ($.Site.GetPage "taxonomyTerm" "tags").Pages }} + <li> + <a href="{{ .Permalink }}">{{.Title}}</a> + </li> + {{ end }} + </ul> + </div> +</main> +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html @@ -0,0 +1,8 @@ +<footer id="footer"> + <div> + <span>{{ .Site.Params.footnote | safeHTML }}</span> + </div> + <div> + <span>Copyright © {{ now.Format "2006"}} {{ .Site.Author.name }}</span> + </div> +</footer> diff --git a/layouts/partials/head_custom.html b/layouts/partials/head_custom.html @@ -1,26 +0,0 @@ -<header> - - <nav> - <ul> - {{ $title := lower .Title }} - {{ $section := lower .Section }} - <li class="pull-left {{ if .IsHome }}current{{ end }}"> - <a href="{{ .Site.BaseURL }}">/home/</a> - </li> - {{ range .Site.Menus.main }} - {{ $name := lower .Name }} - <li class="pull-left {{ if eq $name $title }}current{{ else if eq $section $name }}current{{ else if eq $title (pluralize $name) }}current{{ end }}"> - <a href="{{ .URL }}">/{{ lower .Name }}/</a> - </li> - {{end}} - - {{ range .Site.Menus.feed }} - {{ $name := lower .Name}} - <li class="pull-right"> - <a href="{{ .URL }}">{{ lower .Name }}</a> - </li> - {{end}} - - </ul> - </nav> -</header> diff --git a/layouts/partials/header.html b/layouts/partials/header.html @@ -1,34 +1,17 @@ -<!DOCTYPE html> -<html lang="{{ .Site.LanguageCode }}"> - <head> - - <!-- Google tag (gtag.js) --> - <script async src="https://www.googletagmanager.com/gtag/js?id=G-BLX24KP7CS"></script> - <script> - window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); +{{ $parsedUrl := urls.Parse .Site.BaseURL }} +{{ $domain := $parsedUrl.Host }} +{{ $domainWithoutWWW := replace $domain "www." "" }} +<header id="header"> + <h1> + <a href="{{ .Site.BaseURL }}">{{ .Site.Params.title | default .Site.Title }}</a> + </h1> - gtag('config', 'G-BLX24KP7CS'); - </script> - - - <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png"> - <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png"> - <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png"> - <link rel="manifest" href="/images/site.webmanifest"> - - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.Description }}{{ end }}"> - <title>{{ .Title }} | {{ .Site.Title }}</title> - <link rel="stylesheet" href="{{ "/css/style.css" | relURL }}" /> - <link rel="stylesheet" href="{{ "/css/fonts.css" | relURL }}" /> - {{ range .Site.Params.custom_css -}} - <link rel="stylesheet" href="{{ . | absURL }}"> - {{- end }} - {{ partial "head_custom.html" . }} - </head> - - <body> - <br/> + <nav> + {{ range .Site.Menus.main }} + <span class="nav-bar-item"> + <a class="link" href="{{ .URL | safeURL }}">{{ .Name }}</a> + </span> + {{ end }} + </nav> +</header> +<hr class="head-rule"></hr> +\ No newline at end of file diff --git a/layouts/robots.txt b/layouts/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Sitemap: {{ "sitemap.xml" | absURL }} diff --git a/layouts/tags/terms.html b/layouts/tags/terms.html @@ -0,0 +1,16 @@ +{{ define "main" }} +<main id="main"> + <h1>Tags</h1> + <br style="margin-bottom: 20px"></br> + <div class="row"> + {{ range .Data.Terms.ByCount }} + <ul> + <li><a class="title is-5 is-size-6-mobile" href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> + {{ $Totalpage:= len .Pages }} + {{ $Totalpage }} post{{ if ne $Totalpage 1 }}s{{ end }} + </li> + </ul> + {{ end }} + </div> +</main> +{{ end }} +\ No newline at end of file diff --git a/netlify.toml b/netlify.toml @@ -1,2 +1,20 @@ -[context.production.environment] - HUGO_VERSION = "0.115.1" +[build.environment] +HUGO_VERSION = "0.115.1" +DART_SASS_VERSION = "1.63.6" +TZ = "America/Los_Angeles" + +[build] +publish = "public" +command = """\ + curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \ + tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \ + rm dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \ + export PATH=/opt/build/repo/dart-sass:$PATH && \ + hugo --gc --minify \ + """ + +[[headers]] +for = "/*" +[headers.values] +Cache-Control = "max-age=3600" +X-Content-Type-Options = "nosniff" diff --git a/resources/_gen/assets/scss/sass/main.scss_17d836d605e0c91e6275eb2120c9a238.content b/resources/_gen/assets/scss/sass/main.scss_17d836d605e0c91e6275eb2120c9a238.content @@ -0,0 +1 @@ +@media(prefers-color-scheme:dark){:root{--background:$base03;--background-secondary:$base02;--text:$base0;--text-secondary:$base01;--text-emphasized:$base1}}@media(prefers-color-scheme:light){:root{--background:$base3;--background-secondary:$base2;--text:$base00;--text-secondary:$base1;--text-emphasized:$base01}}:root{--yellow:$yellow;--orange:$orange;--red:$red;--magenta:$magenta;--violet:$violet;--blue:$blue;--cyan:$cyan;--green:$green}body{background-color:var(--background);color:var(--text)}hr{background-color:var(--text-secondary)}#wrapper{background-color:var(--background)}#main .toc{background-color:var(--background-secondary)}blockquote{background:var(--background-secondary)}.content pre{background-color:var(--background-secondary)!important;color:var(--text)}code{background-color:var(--background)!important;color:var(--text-emphasized)!important}button.copyButton{background-color:var(--background);color:var(--text-secondary)}a:link{color:var(--blue)}a:visited{color:var(--violet)}a:hover{color:var(--violet)}nav a{color:var(--text-emphasized)!important}nav a:after{background-color:var(--text)}h2 a{color:var(--text-emphasized)!important}h2.header a:hover,h2.header a:visited,h2.header a.current{color:var(--text-emphasized)}time{color:var(--text-secondary)}table{margin:auto;background-color:var(--background);border-top:1px solid var(--text);border-bottom:1px solid var(--text)}table thead th{border-bottom:1px solid var(--text)}table th{background:var(--background-secondary)!important;color:var(--text-emphasized)!important}table td{padding:5px}.nav-list{border-color:var(--text-secondary)}.sidebar ul li a{color:var(--text)}.sidebar ul li a:hover{color:var(--text-emphasized);background-color:var(--background-secondary)} +\ No newline at end of file diff --git a/resources/_gen/assets/scss/sass/main.scss_17d836d605e0c91e6275eb2120c9a238.json b/resources/_gen/assets/scss/sass/main.scss_17d836d605e0c91e6275eb2120c9a238.json @@ -0,0 +1 @@ +{"Target":"css/style.min.41fda607c3dfd41ae9d7d5708f56bc7e53b25269487b59db797032f5ddb678a8.css","MediaType":"text/css","Data":{"Integrity":"sha256-Qf2mB8Pf1Brp19Vwj1a8flOyUmlIe1nbeXAy9d22eKg="}} +\ No newline at end of file diff --git a/resources/_gen/assets/scss/sass/main.scss_5481928335aee5e714c50847675a4f4e.content b/resources/_gen/assets/scss/sass/main.scss_5481928335aee5e714c50847675a4f4e.content diff --git a/resources/_gen/assets/scss/sass/main.scss_5481928335aee5e714c50847675a4f4e.json b/resources/_gen/assets/scss/sass/main.scss_5481928335aee5e714c50847675a4f4e.json @@ -0,0 +1 @@ +{"Target":"css/style.min.e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css","MediaType":"text/css","Data":{"Integrity":"sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="}} +\ No newline at end of file diff --git a/static/css/solarized.css b/static/css/solarized.css @@ -1,18 +0,0 @@ -:root { - --base03: #002b36; - --base02: #073642; - --base01: #586e75; - --base00: #657b83; - --base0: #839496; - --base1: #93a1a1; - --base2: #eee8d5; - --base3: #fdf6e3; - --yellow: #b58900; - --orange: #cb4b16; - --red: #dc322f; - --magenta: #d33682; - --violet: #6c71c4; - --blue: #268bd2; - --cyan: #2aa198; - --green: #859900; -} -\ No newline at end of file diff --git a/static/css/styles.css b/static/css/styles.css @@ -0,0 +1,361 @@ +@media (prefers-color-scheme: dark) { + :root { + --background: #002b36; + --background-secondary: #073642; + --text: #839496; + --text-secondary: #586e75; + --text-emphasized: #93a1a1; + } +} + +@media (prefers-color-scheme: light) { + :root { + --background: #fdf6e3; + --background-secondary: #eee8d5; + --text: #657b83; + --text-secondary: #93a1a1; + --text-emphasized: #586e75; + } +} + +:root { + --yellow: #b58900; + --orange: #cb4b16; + --red: #dc322f; + --magenta: #d33682; + --violet: #6c71c4; + --blue: #268bd2; + --cyan: #2aa198; + --green: #859900; +} + +body { + background-color: var(--background); + color: var(--text); +} + +hr { + background-color: var(--text-secondary); + margin-top: 20px; + margin-bottom: 10px; + border: 0; + height: 2px; +} + +table { + margin: auto; + background-color: var(--background); + border-top: 1px solid var(--text); + border-bottom: 1px solid var(--text); + border-collapse: collapse; + border: none; + border-radius: 0.25rem; + margin-top: 0; + margin-bottom: 0; +} + +table thead th { + border-bottom: 1px solid var(--text-secondary); +} + +.content th { + background: var(--background-secondary); + color: var(--text-emphasized); +} + +th, +td { + padding: 5px; +} + +.content blockquote { + background: var(--background-secondary); + border-color: var(--text); + border-radius: 0.25rem; + padding-right: 20px; +} + +.content pre { + background-color: var(--background-secondary) !important; + position: relative; + border-radius: 0.25rem; +} + +.content code { + background-color: var(--background-secondary); + color: var(--text); +} + +.content mark { + background-color: var(--background-secondary); + color: var(--text-emphasized); + border-radius: 0.25rem; + padding-left: 5px; + padding-right: 5px; +} + +.content kbd { + background-color: var(--background-secondary); + color: var(--text-emphasized); + border-radius: 0.25rem; +} + +#wrapper { + background-color: var(--background); + padding-left: 100px; + padding-right: 100px; + + @media (max-width: 767px) { + padding-left: 40px; + padding-right: 40px; /* TODO fix padding */ + } +} + +main { + display: flex; +} + +main.grid-container { + display: grid; + grid-template-columns: 3fr 1fr; + gap: 20px; + + @media (max-width: 767px) { + grid-template-columns: 1fr; + } +} + +#main { + max-width: 1000px; + + .toc { + background-color: var(--background-secondary); + border: 1px dashed var(--text-secondary); + border-radius: 0.25rem; + } +} + +#main :target { + background-color: var(--background-secondary); + color: var(--text-emphasized); + border-radius: 0.25em; + padding-left: 20px; + padding-top: 10px; + padding-bottom: 10px; +} + +.numbered-subtitles { + color: var(--text) !important; +} + +.index { + flex: 3; + padding-right: 10px; + padding-left: 10px; + + @media (max-width: 767px) { + padding-left: 10px; + padding-right: 10px; + } +} + +.sidebar { + flex: 1; + + @media (max-width: 767px) { + order: 1; + padding-left: 10px; + padding-right: 10px; + } +} + +.sidebar ul { + list-style: none; + padding: 0; +} + +.sidebar ul li a { + text-decoration: none; + display: block; + padding: 2px 12px; + color: var(--text); + + transition: color 0.3s, background-color 0.3s; +} + +.sidebar ul li a:hover { + color: var(--text-emphasized); + background-color: var(--background-secondary); +} + +.nav-list { + border-color: var(--text-secondary); + display: block; + padding: 10px 15px; + margin: 10px 5px; + margin-left: -5px; + border: 2px solid; + border-radius: 0.25rem; +} + +.content a { + text-decoration: none; +} + +a:link { + color: var(--blue); +} + +a:visited { + color: var(--violet); +} + +a:hover { + color: var(--violet); +} + +/* h2 a { + color: var(--basei1); +} */ + +span.nav-bar-item a.link { + color: var(--text-emphasized); + text-decoration: none; + display: inline-block; + position: relative; +} + +span.nav-bar-item a:after { + background-color: var(--text-emphasized); + content: ""; + position: absolute; + width: 100%; + transform: scaleX(0); + height: 2px; + bottom: 0; + left: 0; + transform-origin: bottom right; + transition: transform 0.25s ease-out; +} + +span.nav-bar-item a:hover:after { + transform: scaleX(1); + transform-origin: bottom left; +} + +#TableOfContents a { + text-decoration: none; + color: var(--text); +} + +#TableOfContents a:hover { + text-decoration: underline; +} + +header a:hover, +header a:visited, +header .current a { + color: var(--text-emphasized); +} + +h3.taxonomy > a { + color: var(--text); +} + +h3.taxonomy > a:visited { + color: var(--text); +} + +h3.taxonomy > a:hover { + color: var(--text-emphasized); +} + +.post-group a { + text-decoration: none; + transition: text-decoration 0.3s ease; +} + +.post-group a:hover { + text-decoration: underline; +} + +time { + color: var(--text-secondary); +} + +button.copyButton { + background-color: var(--background); + color: var(--text-emphasized); + position: absolute; + bottom: 5px; + right: 5px; + opacity: 0.7; + border: none; + padding: 5px 10px; + border-radius: 0.25rem; + cursor: pointer; + font-size: 14px; + transition: opacity 0.3s; +} + +button.copyButton:hover { + opacity: 1; +} + +/* TODO fix this */ +.main-content { + flex: 1; + max-width: 80%; + margin: 0 auto; + box-sizing: border-box; + padding-left: 300px; + + @media (max-width: 768px) { + padding-left: 0; + margin: 20px; + } +} + +.post-title { + text-align: center; +} + +.publish-date { + color: var(--text-secondary); + font-size: large; + padding-top: 10px; +} + +::selection { + background-color: var(--blue); + color: white; +} + +::-moz-selection { + background-color: var(--blue); + color: white; +} + +.book-container { + clear: both; +} + +.book-container > img { + margin-left: 50px; +} + +#ddgSearch > input { + color: var(--text-emphasized); + background-color: var(--background-secondary); + font-family: "Latin Modern Roman", "Times New Roman", serif; + padding-left: 8px; + width: 200px; + height: 25px; + margin-bottom: 25px; + border: 1px solid var(--text); + border-radius: 0.25rem; +} + +#ddgSearch > input:focus { + outline: 1.5px solid var(--text-emphasized); +} diff --git a/static/css/syntax.css b/static/css/syntax.css @@ -0,0 +1,722 @@ +@media (prefers-color-scheme: dark) { + /* Background */ + .bg { + color: #93a1a1; + background-color: #002b36; + } + /* PreWrapper */ + .chroma { + color: #93a1a1; + background-color: #002b36; + } + /* Other */ + .chroma .x { + color: #cb4b16; + } + /* Error */ + .chroma .err { + } + /* CodeLine */ + .chroma .cl { + } + /* LineLink */ + .chroma .lnlinks { + outline: none; + text-decoration: none; + color: inherit; + } + /* LineTableTD */ + .chroma .lntd { + vertical-align: top; + padding: 0; + margin: 0; + border: 0; + } + /* LineTable */ + .chroma .lntable { + border-spacing: 0; + padding: 0; + margin: 0; + border: 0; + } + /* LineHighlight */ + .chroma .hl { + background-color: #19404a; + } + /* LineNumbersTable */ + .chroma .lnt { + white-space: pre; + -webkit-user-select: none; + user-select: none; + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: #495050; + } + /* LineNumbers */ + .chroma .ln { + white-space: pre; + -webkit-user-select: none; + user-select: none; + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: #495050; + } + /* Line */ + .chroma .line { + display: flex; + } + /* Keyword */ + .chroma .k { + color: #719e07; + } + /* KeywordConstant */ + .chroma .kc { + color: #cb4b16; + } + /* KeywordDeclaration */ + .chroma .kd { + color: #268bd2; + } + /* KeywordNamespace */ + .chroma .kn { + color: #719e07; + } + /* KeywordPseudo */ + .chroma .kp { + color: #719e07; + } + /* KeywordReserved */ + .chroma .kr { + color: #268bd2; + } + /* KeywordType */ + .chroma .kt { + color: #dc322f; + } + /* Name */ + .chroma .n { + } + /* NameAttribute */ + .chroma .na { + } + /* NameBuiltin */ + .chroma .nb { + color: #b58900; + } + /* NameBuiltinPseudo */ + .chroma .bp { + color: #268bd2; + } + /* NameClass */ + .chroma .nc { + color: #268bd2; + } + /* NameConstant */ + .chroma .no { + color: #cb4b16; + } + /* NameDecorator */ + .chroma .nd { + color: #268bd2; + } + /* NameEntity */ + .chroma .ni { + color: #cb4b16; + } + /* NameException */ + .chroma .ne { + color: #cb4b16; + } + /* NameFunction */ + .chroma .nf { + color: #268bd2; + } + /* NameFunctionMagic */ + .chroma .fm { + } + /* NameLabel */ + .chroma .nl { + } + /* NameNamespace */ + .chroma .nn { + } + /* NameOther */ + .chroma .nx { + } + /* NameProperty */ + .chroma .py { + } + /* NameTag */ + .chroma .nt { + color: #268bd2; + } + /* NameVariable */ + .chroma .nv { + color: #268bd2; + } + /* NameVariableClass */ + .chroma .vc { + } + /* NameVariableGlobal */ + .chroma .vg { + } + /* NameVariableInstance */ + .chroma .vi { + } + /* NameVariableMagic */ + .chroma .vm { + } + /* Literal */ + .chroma .l { + } + /* LiteralDate */ + .chroma .ld { + } + /* LiteralString */ + .chroma .s { + color: #2aa198; + } + /* LiteralStringAffix */ + .chroma .sa { + color: #2aa198; + } + /* LiteralStringBacktick */ + .chroma .sb { + color: #586e75; + } + /* LiteralStringChar */ + .chroma .sc { + color: #2aa198; + } + /* LiteralStringDelimiter */ + .chroma .dl { + color: #2aa198; + } + /* LiteralStringDoc */ + .chroma .sd { + } + /* LiteralStringDouble */ + .chroma .s2 { + color: #2aa198; + } + /* LiteralStringEscape */ + .chroma .se { + color: #cb4b16; + } + /* LiteralStringHeredoc */ + .chroma .sh { + } + /* LiteralStringInterpol */ + .chroma .si { + color: #2aa198; + } + /* LiteralStringOther */ + .chroma .sx { + color: #2aa198; + } + /* LiteralStringRegex */ + .chroma .sr { + color: #dc322f; + } + /* LiteralStringSingle */ + .chroma .s1 { + color: #2aa198; + } + /* LiteralStringSymbol */ + .chroma .ss { + color: #2aa198; + } + /* LiteralNumber */ + .chroma .m { + color: #2aa198; + } + /* LiteralNumberBin */ + .chroma .mb { + color: #2aa198; + } + /* LiteralNumberFloat */ + .chroma .mf { + color: #2aa198; + } + /* LiteralNumberHex */ + .chroma .mh { + color: #2aa198; + } + /* LiteralNumberInteger */ + .chroma .mi { + color: #2aa198; + } + /* LiteralNumberIntegerLong */ + .chroma .il { + color: #2aa198; + } + /* LiteralNumberOct */ + .chroma .mo { + color: #2aa198; + } + /* Operator */ + .chroma .o { + color: #719e07; + } + /* OperatorWord */ + .chroma .ow { + color: #719e07; + } + /* Punctuation */ + .chroma .p { + } + /* Comment */ + .chroma .c { + color: #586e75; + } + /* CommentHashbang */ + .chroma .ch { + color: #586e75; + } + /* CommentMultiline */ + .chroma .cm { + color: #586e75; + } + /* CommentSingle */ + .chroma .c1 { + color: #586e75; + } + /* CommentSpecial */ + .chroma .cs { + color: #719e07; + } + /* CommentPreproc */ + .chroma .cp { + color: #719e07; + } + /* CommentPreprocFile */ + .chroma .cpf { + color: #719e07; + } + /* Generic */ + .chroma .g { + } + /* GenericDeleted */ + .chroma .gd { + color: #dc322f; + } + /* GenericEmph */ + .chroma .ge { + font-style: italic; + } + /* GenericError */ + .chroma .gr { + color: #dc322f; + font-weight: bold; + } + /* GenericHeading */ + .chroma .gh { + color: #cb4b16; + } + /* GenericInserted */ + .chroma .gi { + color: #719e07; + } + /* GenericOutput */ + .chroma .go { + } + /* GenericPrompt */ + .chroma .gp { + } + /* GenericStrong */ + .chroma .gs { + font-weight: bold; + } + /* GenericSubheading */ + .chroma .gu { + color: #268bd2; + } + /* GenericTraceback */ + .chroma .gt { + } + /* GenericUnderline */ + .chroma .gl { + } + /* TextWhitespace */ + .chroma .w { + } +} + +@media (prefers-color-scheme: light) { + /* Background */ + .bg { + color: #586e75; + background-color: #eee8d5; + } + /* PreWrapper */ + .chroma { + color: #586e75; + background-color: #eee8d5; + } + /* Other */ + .chroma .x { + } + /* Error */ + .chroma .err { + } + /* CodeLine */ + .chroma .cl { + } + /* LineLink */ + .chroma .lnlinks { + outline: none; + text-decoration: none; + color: inherit; + } + /* LineTableTD */ + .chroma .lntd { + vertical-align: top; + padding: 0; + margin: 0; + border: 0; + } + /* LineTable */ + .chroma .lntable { + border-spacing: 0; + padding: 0; + margin: 0; + border: 0; + } + /* LineHighlight */ + .chroma .hl { + background-color: #d6d0bf; + } + /* LineNumbersTable */ + .chroma .lnt { + white-space: pre; + -webkit-user-select: none; + user-select: none; + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: #7f7f7f; + } + /* LineNumbers */ + .chroma .ln { + white-space: pre; + -webkit-user-select: none; + user-select: none; + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: #7f7f7f; + } + /* Line */ + .chroma .line { + display: flex; + } + /* Keyword */ + .chroma .k { + color: #859900; + } + /* KeywordConstant */ + .chroma .kc { + color: #859900; + font-weight: bold; + } + /* KeywordDeclaration */ + .chroma .kd { + color: #859900; + } + /* KeywordNamespace */ + .chroma .kn { + color: #dc322f; + font-weight: bold; + } + /* KeywordPseudo */ + .chroma .kp { + color: #859900; + } + /* KeywordReserved */ + .chroma .kr { + color: #859900; + } + /* KeywordType */ + .chroma .kt { + color: #859900; + font-weight: bold; + } + /* Name */ + .chroma .n { + color: #268bd2; + } + /* NameAttribute */ + .chroma .na { + color: #268bd2; + } + /* NameBuiltin */ + .chroma .nb { + color: #cb4b16; + } + /* NameBuiltinPseudo */ + .chroma .bp { + color: #268bd2; + } + /* NameClass */ + .chroma .nc { + color: #cb4b16; + } + /* NameConstant */ + .chroma .no { + color: #268bd2; + } + /* NameDecorator */ + .chroma .nd { + color: #268bd2; + } + /* NameEntity */ + .chroma .ni { + color: #268bd2; + } + /* NameException */ + .chroma .ne { + color: #268bd2; + } + /* NameFunction */ + .chroma .nf { + color: #268bd2; + } + /* NameFunctionMagic */ + .chroma .fm { + color: #268bd2; + } + /* NameLabel */ + .chroma .nl { + color: #268bd2; + } + /* NameNamespace */ + .chroma .nn { + color: #268bd2; + } + /* NameOther */ + .chroma .nx { + color: #268bd2; + } + /* NameProperty */ + .chroma .py { + color: #268bd2; + } + /* NameTag */ + .chroma .nt { + color: #268bd2; + font-weight: bold; + } + /* NameVariable */ + .chroma .nv { + color: #268bd2; + } + /* NameVariableClass */ + .chroma .vc { + color: #268bd2; + } + /* NameVariableGlobal */ + .chroma .vg { + color: #268bd2; + } + /* NameVariableInstance */ + .chroma .vi { + color: #268bd2; + } + /* NameVariableMagic */ + .chroma .vm { + color: #268bd2; + } + /* Literal */ + .chroma .l { + color: #2aa198; + } + /* LiteralDate */ + .chroma .ld { + color: #2aa198; + } + /* LiteralString */ + .chroma .s { + color: #2aa198; + } + /* LiteralStringAffix */ + .chroma .sa { + color: #2aa198; + } + /* LiteralStringBacktick */ + .chroma .sb { + color: #2aa198; + } + /* LiteralStringChar */ + .chroma .sc { + color: #2aa198; + } + /* LiteralStringDelimiter */ + .chroma .dl { + color: #2aa198; + } + /* LiteralStringDoc */ + .chroma .sd { + color: #2aa198; + } + /* LiteralStringDouble */ + .chroma .s2 { + color: #2aa198; + } + /* LiteralStringEscape */ + .chroma .se { + color: #2aa198; + } + /* LiteralStringHeredoc */ + .chroma .sh { + color: #2aa198; + } + /* LiteralStringInterpol */ + .chroma .si { + color: #2aa198; + } + /* LiteralStringOther */ + .chroma .sx { + color: #2aa198; + } + /* LiteralStringRegex */ + .chroma .sr { + color: #2aa198; + } + /* LiteralStringSingle */ + .chroma .s1 { + color: #2aa198; + } + /* LiteralStringSymbol */ + .chroma .ss { + color: #2aa198; + } + /* LiteralNumber */ + .chroma .m { + color: #2aa198; + font-weight: bold; + } + /* LiteralNumberBin */ + .chroma .mb { + color: #2aa198; + font-weight: bold; + } + /* LiteralNumberFloat */ + .chroma .mf { + color: #2aa198; + font-weight: bold; + } + /* LiteralNumberHex */ + .chroma .mh { + color: #2aa198; + font-weight: bold; + } + /* LiteralNumberInteger */ + .chroma .mi { + color: #2aa198; + font-weight: bold; + } + /* LiteralNumberIntegerLong */ + .chroma .il { + color: #2aa198; + font-weight: bold; + } + /* LiteralNumberOct */ + .chroma .mo { + color: #2aa198; + font-weight: bold; + } + /* Operator */ + .chroma .o { + } + /* OperatorWord */ + .chroma .ow { + color: #859900; + } + /* Punctuation */ + .chroma .p { + } + /* Comment */ + .chroma .c { + color: #93a1a1; + font-style: italic; + } + /* CommentHashbang */ + .chroma .ch { + color: #93a1a1; + font-style: italic; + } + /* CommentMultiline */ + .chroma .cm { + color: #93a1a1; + font-style: italic; + } + /* CommentSingle */ + .chroma .c1 { + color: #93a1a1; + font-style: italic; + } + /* CommentSpecial */ + .chroma .cs { + color: #93a1a1; + font-style: italic; + } + /* CommentPreproc */ + .chroma .cp { + color: #93a1a1; + font-style: italic; + } + /* CommentPreprocFile */ + .chroma .cpf { + color: #93a1a1; + font-style: italic; + } + /* Generic */ + .chroma .g { + color: #d33682; + } + /* GenericDeleted */ + .chroma .gd { + color: #d33682; + } + /* GenericEmph */ + .chroma .ge { + color: #d33682; + } + /* GenericError */ + .chroma .gr { + color: #d33682; + } + /* GenericHeading */ + .chroma .gh { + color: #d33682; + } + /* GenericInserted */ + .chroma .gi { + color: #d33682; + } + /* GenericOutput */ + .chroma .go { + color: #d33682; + } + /* GenericPrompt */ + .chroma .gp { + color: #d33682; + } + /* GenericStrong */ + .chroma .gs { + color: #d33682; + } + /* GenericSubheading */ + .chroma .gu { + color: #d33682; + } + /* GenericTraceback */ + .chroma .gt { + color: #d33682; + } + /* GenericUnderline */ + .chroma .gl { + color: #d33682; + } + /* TextWhitespace */ + .chroma .w { + } +} diff --git a/static/css/theme-override.css b/static/css/theme-override.css @@ -1,323 +0,0 @@ -@import url("solarized.css"); - -/* Dark mode */ -@media (prefers-color-scheme: dark) { - body { - background-color: var(--base03); - color: var(--base0); - } - - blockquote { - background: var(--base02); - } - pre { - background-color: var(--base03) !important; - color: var(--base0); - } - - a { - color: var(--blue); - } - a:visited { - color: var(--violet); - } - a:hover { - color: var(--violet); - } - - header { - background: var(--base03); - border-bottom: 0px; - } - header a { - color: var(--base1); - } - header a:hover, - header a:visited, - header .current a { - color: var(--base1); - } - - .article-meta, - .menu a { - background: var(--base02); - color: var(--base1); - } - - table { - margin: auto; - background-color: var(--base03); - border-top: 1px solid var(--base0); - border-bottom: 1px solid var(--base0); - } - table thead th { - border-bottom: 1px solid var(--base0); - } - th, - td { - padding: 5px; - } - tr:nth-child(even) { - background: var(--base02); - } -} - -/* Light mode */ -@media (prefers-color-scheme: light) { - body { - background-color: var(--base3); - color: var(--base00); - } - - blockquote { - background: var(--base3); - } - - a { - color: var(--blue); - } - a:visited { - color: var(--violet); - } - a:hover { - color: var(--violet); - } - - header { - background: var(--base3); - border-bottom: 0px; - } - header a { - color: var(--base01); - } - header a:hover, - header a:visited, - header .current a { - color: var(--base01); - } - - pre { - background-color: var(--base03) !important; - color: var(--base0); - } - - .article-meta, - .menu a { - background: var(--base2); - color: var(--base00); - } - - table { - margin: auto; - border-top: 1px solid var(--base00); - border-bottom: 1px solid var(--base00); - } - table thead th { - border-bottom: 1px solid var(--base00); - } - th, - td { - padding: 5px; - } - tr:nth-child(even) { - background: var(--base2); - } -} - -body { - font-family: sans-serif; - max-width: 1000px; - margin: auto; - padding: 0.2em; - line-height: 1.5em; -} - -h1 { - line-height: 1.5em; - color: var(--blue); -} - -h2 { - color: var(--cyan); -} - -h3 { - color: var(--violet); -} - -h4 { - color: var(--green); -} - -h2#date { - line-height: 0.5em; - opacity: 0.7; -} - -.date { - font-family: monospace; - opacity: 0.7; -} - -#TableOfContents, -#TOC { - border: 1px solid var(--light-brown); - border-radius: 5px; -} - -/* Header and Footer */ -.menu li { - display: inline-block; -} -.article-meta, -.menu a { - text-decoration: none; - padding: 5px; - border-radius: 5px; - border-style: solid; - border-width: 1px; - margin-bottom: 20px; -} - -.terms { - font-size: 0.9em; -} -.article-meta { - font-size: 90%; - width: 90%; - margin-left: auto; - margin-right: auto; -} -.menu, -footer { - text-align: center; - font-size: 90%; - opacity: 0.6; -} -.title { - font-size: 1.1em; -} -footer a { - text-decoration: none; -} - -.pull-left { - float: left; -} -.pull-right { - float: right; -} - -a { - text-decoration: none; - cursor: pointer; -} - -a:hover { - text-decoration: underline; -} - -/* Adjust background at your leisure! */ -header { - position: relative; - width: 100%; - height: 1.75rem; - font-size: 1rem; -} - -header ul, -header ol { - margin: 0; - padding: 0; - list-style: none; -} -header nav { - padding: 0 0.5rem; -} - -header a { - line-height: 1.75rem; - padding: 0 0.5rem; -} - -/* Code Boxes */ -pre { - /* border: 0px solid var(--cyan); */ - border: 0px; - /* padding: 1em; */ - /* overflow-x: auto; */ - border-radius: 5px; -} - -code { - /* font-family: 'Ubuntu Mono', monospace; */ - font-family: monospace; -} - -pre code { - background: none; -} - -/* Images, tables, misc. */ -img, -iframe, -video { - max-width: 100%; - height: auto; - display: block; - margin-left: auto; - margin-right: auto; -} - -main { - hyphens: auto; - max-width: 95%; - margin-left: auto; - margin-right: auto; - line-height: 1.7em; - hyphens: auto; - display: block; - font-size: 1.1em; -} -main a { - font-weight: bold; -} - -blockquote { - border-left: 5px solid var(--light-brown); - padding: 3px 1em 3px; -} - -.content-wrapper { - padding: 0px 12px 0px 12px; - width: 95%; - margin-left: auto; - margin-right: auto; -} -#partywizard { - min-width: 40px; - float: right; - padding: 10px; - display: block; -} - -#runscape { - min-width: 40px; - float: right; - padding: 10px; - display: block; -} - -/* Next and previous buttons */ -.navbuttons { - font-weight: bold; -} - -.prev { - text-align: left; -} - -.next { - text-align: right; - /* margin-top: -60px; */ -} diff --git a/static/js/script.js b/static/js/script.js @@ -0,0 +1,26 @@ +// Add copy button to <pre> blocks +function addCopyButton() { + const codeBlocks = document.querySelectorAll('pre'); + codeBlocks.forEach((codeBlock) => { + const copyButton = document.createElement('button'); + copyButton.innerHTML = 'Copy'; + copyButton.classList.add('copyButton'); + copyButton.addEventListener('click', () => { + const textToCopy = codeBlock.innerText.trim(); + copyToClipboard(textToCopy); + }); + codeBlock.before(copyButton); + }); +} + +function copyToClipboard(text) { + navigator.clipboard.writeText(text) + .then(() => { + console.log('Text copied to clipboard:', text); + }) + .catch(err => { + console.error('Failed to copy: ', err); + }); +} + +addCopyButton(); +\ No newline at end of file diff --git a/themes/hugo-texify2 b/themes/hugo-texify2 @@ -0,0 +1 @@ +Subproject commit 746506675771fa45ecaac67bb594ffe008208b5f