diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-29 13:14:46 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-29 13:14:46 +0200 |
| commit | fb98e1e94d624605ba6ea75daf5e8ce0400fa629 (patch) | |
| tree | d0fbb57dfb7ad4ca2c60603e77e796e860e841fa /content/en | |
| parent | 9af1bb4f87931012184509a71b1cf60d96730ad9 (diff) | |
| parent | dc4eba2c6a709995a2f4718f9fb407f3057a13b8 (diff) | |
| download | danixxyz-release_29042026-1314.tar.gz danixxyz-release_29042026-1314.zip | |
Merge branch 'master' into productionrelease_29042026-1314
Diffstat (limited to 'content/en')
| -rw-r--r-- | content/en/_index.md | 2 | ||||
| -rw-r--r-- | content/en/articles/git-setup-own-server-part2/index.md | 48 | ||||
| -rw-r--r-- | content/en/articles/manage-your-passwords-with-password-store/index.md | 92 | ||||
| -rw-r--r-- | content/en/articles/my-hugo-workflow/index.md | 346 | ||||
| -rw-r--r-- | content/en/articles/playing-with-colors/index.md | 2 | ||||
| -rw-r--r-- | content/en/articles/poker-time/index.md | 3 | ||||
| -rw-r--r-- | content/en/articles/pure-nerdgasm/index.md | 8 | ||||
| -rw-r--r-- | content/en/articles/r-i-p-steve-jobs/index.md | 2 | ||||
| -rw-r--r-- | content/en/articles/responsibility/index.md | 6 | ||||
| -rw-r--r-- | content/en/repository/index.md | 48 |
10 files changed, 467 insertions, 90 deletions
diff --git a/content/en/_index.md b/content/en/_index.md index 450e04e..68fb715 100644 --- a/content/en/_index.md +++ b/content/en/_index.md @@ -7,4 +7,4 @@ description: "Portfolio and blog by Danilo Macrì" Welcome to danix.xyz, my name is Danilo but you can call me danix. -> Here I write about stuff I find interesting. On this site you may read about WordPress, Hugo, bash, Slackware, and lots of other things. Feel free to have a look and take what you like.
\ No newline at end of file +> Here I write about stuff I find interesting. On this site you may read about web development in WordPress, Hugo, AI, bash, Slackware GNU/Linux, and lots of other things. Feel free to have a look and take what you like.
\ No newline at end of file diff --git a/content/en/articles/git-setup-own-server-part2/index.md b/content/en/articles/git-setup-own-server-part2/index.md index 42c50c4..2b10f29 100644 --- a/content/en/articles/git-setup-own-server-part2/index.md +++ b/content/en/articles/git-setup-own-server-part2/index.md @@ -12,32 +12,48 @@ tags = [ "git", "linux", "python", "howto", "automation", "ssh", "flask", "do it This is a followup on [my previous article about how to setup your server][1] to handle a GIT repository and deploy to a web server like apache. -Since I started experimenting with python and web publishing with it I wanted a way to push all the changes to my codebase directly to a web server, in a similar way as to what I already do with php and apache.<figure class="wp-block-pullquote" style="border-color:#abb8c3"> +Since I started experimenting with python and web publishing with it I wanted a way to push all the changes to my codebase directly to a web server, in a similar way as to what I already do with php and apache. -<blockquote class="has-text-color has-very-dark-gray-color"> - <p> - I want to do it myself, the way I like it.. - </p> - - <cite>danix</cite> -</blockquote></figure> +> I want to do it myself, the way I like it.. +> +> — danix -Serving python scripts is slightly different than serving html or php, here’s a scheme that shows what happens when using python (flask in this example) to serve some web content. - - -<div class="wp-block-image"> - <figure class="aligncenter"><img loading="lazy" width="1024" height="393" src="https://danix.xyz/wp-content/uploads/2018/12/flask-scheme-1024x393.png" alt="" class="wp-image-3852" srcset="https://danix.xyz/wp-content/uploads/2018/12/flask-scheme-1024x393.png 1024w, https://danix.xyz/wp-content/uploads/2018/12/flask-scheme-300x115.png 300w, https://danix.xyz/wp-content/uploads/2018/12/flask-scheme-768x294.png 768w, https://danix.xyz/wp-content/uploads/2018/12/flask-scheme.png 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>a simple scheme of how python scripts are served on the web.</figcaption></figure> -</div> +Serving python scripts is slightly different than serving html or php, here's a scheme that shows what happens when using python (flask in this example) to serve some web content. As you can see the web server is acting as a reverse proxy to the [WSGI][2] server Gunicorn, Apache receives a request from a client, forwards the request to Gunicorn which in turn asks the python web service, in our case our flask web app. Other than as a reverse proxy, apache is used also to serve static content which is not originated in python, like images, css or js scripts. In order to deploy a python web app I had to install the mod_wsgi extension for apache, then I decided to use a folder in my system to install the virtual environment for python to run my web app and point to that directory in my vhost configuration file inside apache. After that I created a directory where to store all files for my web app and instructed apache to serve them using the virtualenv I created earlier. This is more or less what I did: -<pre class="wp-block-preformatted"># create the virtual environment for python inside<br /># the folder /usr/local/virtualenvs/my-app:<br />virtualenv /usr/local/virtualenvs/my-app<br /><br /># now create the directory inside the apache root<br /># to store our web app<br />mkdir /var/www/htdocs/my-app<br /></pre> +```bash +# create the virtual environment for python inside +# the folder /usr/local/virtualenvs/my-app: +virtualenv /usr/local/virtualenvs/my-app + +# now create the directory inside the apache root +# to store our web app +mkdir /var/www/htdocs/my-app +``` Now if we put all the py files for our flask web app we can run it inside apache, this is the configuration for the vhost I used: -<pre class="wp-block-preformatted"><VirtualHost *:80><br /><code> ServerName my-app.mysite.ext</code><br /><code> ErrorLog "/var/log/httpd/my-app.error_log"</code><br /><code> CustomLog "/var/log/httpd/my-app.access_log" common</code><br /><code> WSGIDaemonProcess my-app user=apache group=apache threads=5 python-home=/usr/local/virtualenvs/my-app</code><br /><code> WSGIScriptAlias / /var/www/htdocs/my-app/my-app.wsgi</code><br /><code> WSGIProcessGroup my-app</code><br /><code> Alias "/static/" "/var/www/htdocs/my-app/static/"</code><br /><code> <Directory "/var/www/htdocs/my-app/static/"></code><br /><code> Order allow,deny</code><br /><code> Allow from all</code><br /><code> </Directory></code><br /><code> <Directory "/var/www/htdocs/my-app/"></code><br /><code> Require all granted</code><br /><code> </Directory></code><br /></VirtualHost><br /><br /></pre> +```apache +<VirtualHost *:80> + ServerName my-app.mysite.ext + ErrorLog "/var/log/httpd/my-app.error_log" + CustomLog "/var/log/httpd/my-app.access_log" common + WSGIDaemonProcess my-app user=apache group=apache threads=5 python-home=/usr/local/virtualenvs/my-app + WSGIScriptAlias / /var/www/htdocs/my-app/my-app.wsgi + WSGIProcessGroup my-app + Alias "/static/" "/var/www/htdocs/my-app/static/" + <Directory "/var/www/htdocs/my-app/static/"> + Order allow,deny + Allow from all + </Directory> + <Directory "/var/www/htdocs/my-app/"> + Require all granted + </Directory> +</VirtualHost> +``` With this setting I can now reach my web app and test it after restarting the web server. diff --git a/content/en/articles/manage-your-passwords-with-password-store/index.md b/content/en/articles/manage-your-passwords-with-password-store/index.md index 275f5bf..9b1a580 100644 --- a/content/en/articles/manage-your-passwords-with-password-store/index.md +++ b/content/en/articles/manage-your-passwords-with-password-store/index.md @@ -13,25 +13,19 @@ Hello everyone, lately I’ve decided not to use the password manager offered by all major browsers nowadays, but instead try to manage all my passwords using some open source software in order to have a better control over my passwords. -I’ve decided to write this article after reading this <a rel="noreferrer noopener" href="https://alien.slackbook.org/blog/sync-and-share-your-chromium-and-more-browser-data-among-all-your-computers/" target="_blank">blog entry by AlienBob</a> where he speaks of KeepassXC, and since I’ve used it, I wanted to give a valid alternative to some downsides that I’ve stumbled upon while using it. +I've decided to write this article after reading this [blog entry by AlienBob](https://alien.slackbook.org/blog/sync-and-share-your-chromium-and-more-browser-data-among-all-your-computers/) where he speaks of KeepassXC, and since I've used it, I wanted to give a valid alternative to some downsides that I've stumbled upon while using it. -The first approach I’ve attempted, as I said, was using <a rel="noreferrer noopener" href="https://keepassxc.org/" target="_blank">KeepassXC</a>, quoting their website: +The first approach I've attempted, as I said, was using [KeepassXC](https://keepassxc.org/), quoting their website: -<blockquote class="wp-block-quote"> - <p> - KeePassXC – Cross-Platform Password Manager - </p> - - <p> - Never forget a password again.<br />Securely store passwords using industry standard encryption, quickly auto-type them into desktop applications, and use our browser extension to log into websites. - </p> - - <cite><a rel="noreferrer noopener" style="" href="https://keepassxc.org/" target="_blank">KeepassXC website</a></cite> -</blockquote> +> **KeePassXC – Cross-Platform Password Manager** +> +> Never forget a password again. Securely store passwords using industry standard encryption, quickly auto-type them into desktop applications, and use our browser extension to log into websites. +> +> — [KeepassXC website](https://keepassxc.org/) What I did was install keepassXC on my Slackware64-current, export all my passwords from my main browser, save them as CSV and import them inside keepassXC. Now I have to remember just one password to access my database and I can install the browser integration add-on for chromium (or firefox) to have all my passwords readily available. Neat!! -To share my passwords between my devices, I simply made a private git repository on my server and synced the password database with it. I then went and installed <a rel="noreferrer noopener" href="https://github.com/bpellin/keepassdroid" target="_blank">KeePassDroid</a>, which is an Android implementation of keepassXC. +To share my passwords between my devices, I simply made a private git repository on my server and synced the password database with it. I then went and installed [KeePassDroid](https://github.com/bpellin/keepassdroid), which is an Android implementation of keepassXC. Since keepassdroid doesn’t sync automatically from a remote server, I had to use git on my phone to pull/push to my remote in order to keep the password database up to date, and even if that’s not a big deal, I wasn’t happy with my password workflow so, while still using this approach, I was looking for alternatives. @@ -39,73 +33,83 @@ Since keepassdroid doesn’t sync automatically from a remote server, I had ## Meet password-store -I stumbled upon <a rel="noreferrer noopener" href="https://www.passwordstore.org" target="_blank">password-store</a>, which claims to be the standard unix password manager. +I stumbled upon [password-store](https://www.passwordstore.org), which claims to be the standard unix password manager. -The way it works is simple yet brilliant in my opinion, each password is kept secure in a gpg encrypted text file inside a known directory structure, the file itself as well as the directory containing it can have whatever naming convention you want, and everything can be manipulated with standard unix tools (cp, mv, rm, etc.). <acronym title="Keep It Simple, Stupid">KISS</acronym> rule, am I right?! +The way it works is simple yet brilliant in my opinion, each password is kept secure in a gpg encrypted text file inside a known directory structure, the file itself as well as the directory containing it can have whatever naming convention you want, and everything can be manipulated with standard unix tools (cp, mv, rm, etc.). {{< acronym title="Keep It Simple, Stupid" >}}KISS{{< /acronym >}} rule, am I right?! -Here’s how it looks like, standard tree view from the shell: +Here's how it looks like, standard tree view from the shell: -<pre class="wp-block-code language-bash"><code>.password-store/ -[...] +```bash +.password-store/ +[...] ├── facebook/ -│ └── facebook-username +│ └── facebook-username ├── twitter/ -│ └── twitter-username +│ └── twitter-username ├── www.instagram.com/ -│ └── instagram-username -[...]</code></pre> +│ └── instagram-username +[...] +``` -In this example, facebook is a directory, containing a gpg encrypted text file named “facebook-username”, in that file is written my password for that user on facebook, pretty straightforward. +In this example, facebook is a directory, containing a gpg encrypted text file named "facebook-username", in that file is written my password for that user on facebook, pretty straightforward. -The beauty of the pass program, is that it also includes git subcommands, so you can use it to sync your password database to a remote. Here’s how it works: +The beauty of the pass program, is that it also includes git subcommands, so you can use it to sync your password database to a remote. Here's how it works: -The first thing you want to do is create a remote repository on your git server, there’s a million ways to do so, and it depends on your git provider. If you want to host a git server I have an howto on this site, <a href="https://danix.xyz/2018/07/git-setup-own-server/" data-type="post" data-id="3748">give it a look</a>. +The first thing you want to do is create a remote repository on your git server, there's a million ways to do so, and it depends on your git provider. If you want to host a git server I have an howto on this site, [give it a look](https://danix.xyz/2018/07/git-setup-own-server/). -After creating the remote repository, you want to clone it in `~/.password-store`, the default directory where pass will store all your credentials, and to do so you’ll do: +After creating the remote repository, you want to clone it in `~/.password-store`, the default directory where pass will store all your credentials, and to do so you'll do: -<pre class="wp-block-code language-bash"><code>git clone myserver.com:git-repository ~/.password-store</code></pre> +```bash +git clone myserver.com:git-repository ~/.password-store +``` -Assuming you already have a gpg key pair for johndoe@youremailaddress.com, you’ll have to initialize the password repository like this: +Assuming you already have a gpg key pair for johndoe@youremailaddress.com, you'll have to initialize the password repository like this: -<pre class="wp-block-code language-bash"><code>pass init johndoe@youremailaddress.com</code></pre> +```bash +pass init johndoe@youremailaddress.com +``` Now pass will use the gpg key pair for that email address when encrypting and decrypting your passwords. Since it also understands when the directory is a local clone of a git repository, after initializing with the previous command, it created a commit ready to be pushed, so all you have to do is -<pre class="wp-block-code language-bash"><code>cd ~/.password-store && git push +```bash +cd ~/.password-store && git push # or you can use pass internal git capabilities with: -pass git push</code></pre> +pass git push +``` and your password database will be synced. From there you can simply invoke pass to see all your passwords, you can search your database, add or remove passwords, modify them etc. For more info you can check the manual where you also have advanced examples on how to use git with pass. -On my android phone I’ve installed the mobile version of <a rel="noreferrer noopener" href="https://play.google.com/store/apps/details?id=dev.msfjarvis.aps" target="_blank">Password Store</a>, I’ve setup my ssh key in order to be able to pull/push from my git remote, and now I have all my passwords syncronized to my mobile as well. +On my android phone I've installed the mobile version of [Password Store](https://play.google.com/store/apps/details?id=dev.msfjarvis.aps), I've setup my ssh key in order to be able to pull/push from my git remote, and now I have all my passwords syncronized to my mobile as well. ## On the phone The process for installing password-store on the phone is a bit tricky, but nothing really difficult. The two apps we need are: - * <a href="https://play.google.com/store/apps/details?id=dev.msfjarvis.aps" target="_blank" rel="noreferrer noopener">Password-store</a> - * <a href="https://play.google.com/store/apps/details?id=org.sufficientlysecure.keychain" target="_blank" rel="noreferrer noopener">OpenKeyChain</a> + * [Password-store](https://play.google.com/store/apps/details?id=dev.msfjarvis.aps) + * [OpenKeyChain](https://play.google.com/store/apps/details?id=org.sufficientlysecure.keychain) -After installing both those apps, we’ll need to go on our computer and export our public and private gpg keys in order to import them inside OpenKeyChain, to do so we’ll go in the terminal and type away: +After installing both those apps, we'll need to go on our computer and export our public and private gpg keys in order to import them inside OpenKeyChain, to do so we'll go in the terminal and type away: -<pre class="wp-block-code language-bash"><code>gpg --export-secret-keys --armor johndoe@youremailaddress.com > private.asc -gpg --export --armor johndoe@youremailaddress.com > public.asc</code></pre> +```bash +gpg --export-secret-keys --armor johndoe@youremailaddress.com > private.asc +gpg --export --armor johndoe@youremailaddress.com > public.asc +``` -now we have both our private and public key stored in a file, which we can transfer to the phone and import inside OpenKeyChain. I’ve imported the private key first and then the public one, and while importing the latter, OpenKeyChain confirmed that the key was updated, so both are essentially on the same keypair. +now we have both our private and public key stored in a file, which we can transfer to the phone and import inside OpenKeyChain. I've imported the private key first and then the public one, and while importing the latter, OpenKeyChain confirmed that the key was updated, so both are essentially on the same keypair. -One important note regarding git, depending on how your git repository is setup, you might be needed to import your ssh key inside password-store on your phone in order to access the repository, that’s really easy as the app will ask for your git configuration the first time you open it. +One important note regarding git, depending on how your git repository is setup, you might be needed to import your ssh key inside password-store on your phone in order to access the repository, that's really easy as the app will ask for your git configuration the first time you open it. -Once you’ve setup your git access, it will ask you to allow OpenKeyChain to manage your gpg key pair whenever you use password-store, and that’s it! You have now your passwords securely stored through GnuPG and synced between your devices with git. +Once you've setup your git access, it will ask you to allow OpenKeyChain to manage your gpg key pair whenever you use password-store, and that's it! You have now your passwords securely stored through GnuPG and synced between your devices with git. ## Bonus note -password-store is a command line program that you can access via it’s command `pass`, but there are also graphical interfaces to access it. +password-store is a command line program that you can access via its command `pass`, but there are also graphical interfaces to access it. -One of them is <a rel="noreferrer noopener" href="https://qtpass.org/" target="_blank">qtpass</a>, you should find it in most distros, on Slackware I found it on <a rel="noreferrer noopener" href="https://slackbuilds.org/repository/14.2/desktop/qtpass/?search=qtpass" target="_blank">SBo</a> and compiled it without any problems. It performs very well, allows you to manipulate your password repository from a graphical interface, performs push/pull operations on git and makes it easier to create complex passwords whenever you need. Just a headsup, if you install this setup on raspbian, remember to install one of the pinentry programs to be able to insert your passkey when you are not in the terminal. +One of them is [qtpass](https://qtpass.org/), you should find it in most distros, on Slackware I found it on [SBo](https://slackbuilds.org/repository/14.2/desktop/qtpass/?search=qtpass) and compiled it without any problems. It performs very well, allows you to manipulate your password repository from a graphical interface, performs push/pull operations on git and makes it easier to create complex passwords whenever you need. Just a headsup, if you install this setup on raspbian, remember to install one of the pinentry programs to be able to insert your passkey when you are not in the terminal. -I hope you’ll find this article useful, remember to drop me a [comment][1] if you need any help and I’ll be happy to help you as best as I can. +I hope you'll find this article useful, remember to drop me a [comment][1] if you need any help and I'll be happy to help you as best as I can. Cheers!! diff --git a/content/en/articles/my-hugo-workflow/index.md b/content/en/articles/my-hugo-workflow/index.md new file mode 100644 index 0000000..60e6bbd --- /dev/null +++ b/content/en/articles/my-hugo-workflow/index.md @@ -0,0 +1,346 @@ ++++ +title = "The Git Config Settings I Actually Use" +author = "Danilo M." +type = "tech" +date = "2026-04-28T19:53:46+02:00" +draft = false +excerpt = "A tour through my ~/.gitconfig, covering the settings I've grown to rely on daily and why each one earns its place." +tags = ["git", "workflow", "linux", "gpg", "hugo", "configuration", "howto"] +categories = ["DIY", "Code"] ++++ + +A few years back, I set up a two-repository system for this site: one repo for content, another for the theme (living as a submodule). It's a clean architecture in theory, but in practice, managing two repos means you're constantly juggling branch updates, resolving submodule pointer conflicts, and pushing to two remotes in sequence. I started carrying around a `.gitconfig` file between machines, tweaking it bit by bit as I discovered settings that eliminated friction. + +This isn't a guide to every git option, that would be a book. Instead, it's a personal tour through the settings I've actually integrated into my workflow, why they matter, and what changed once each one was on. + +<!--more--> + +## The Setup Glue: `push.autoSetupRemote` and `pull.rebase` + +These two live together because they're about the boundaries of your branches: pushing them up and pulling them back down. + +### push.autoSetupRemote + +The old frustration: cut a new branch locally, write code, run `git push`, and get: + +``` +fatal: The current branch feature/my-new-branch has no upstream branch. +To push the current and set the upstream branch, use: + + git push --set-upstream origin feature/my-new-branch +``` + +It's boilerplate ceremony every time you push a new branch. The fix: + +```ini +[push] + autoSetupRemote = true +``` + +Now `git push` on a new branch just works. It infers the tracking branch automatically. The first time I used this with Hugo content branches, cutting `content/new-article` on Monday and pushing immediately, I realized I'd eliminated maybe fifty typos a year of `--set-upstream`. + +### pull.rebase + +Linear history matters more on a single-author site. Without `pull.rebase = true`, pulling changes creates merge commits like "Merge branch 'main' of origin/main" even when you're just syncing. These commits don't represent work; they're noise. They clutter `git log`, make bisecting slower, and add confusion to the graph. + +```ini +[pull] + rebase = true +``` + +With this on, pulling rebases your local work on top of the remote tip. When you're managing a Hugo site with a theme submodule, this is especially helpful: submodule pointer updates stay tidy in the log instead of hiding inside merge commits. + +## Identity and Trust: `commit.gpgsign` + +GPG signing commits isn't about compliance or passing audits. It's about provenance. Every commit on my repos carries my cryptographic signature, proof that it came from me and hasn't been tampered with. + +```ini +[user] + signingkey = YOUR_GPG_KEY_ID + email = danix@danix.xyz + name = Danilo M. + +[commit] + gpgsign = true +``` + +The first time you set this up, know that `gpg-agent` needs to be running and your key needs to be imported locally. Once both are in place, every commit is signed automatically. If you want to dive deeper into GPG keys, I wrote about [managing passwords with password-store](/en/articles/manage-your-passwords-with-password-store/), which covers key setup. + +## Reducing Friction: `help.autocorrect`, `fetch.prune`, and `fetch.prunetags` + +Three small settings that save daily typing and mental overhead. + +### help.autocorrect + +Typos happen. I often type `git statsu` instead of `git status`, or `git comit` instead of `git commit`. The old behavior is an error message and a suggested fix. With: + +```ini +[help] + autocorrect = 10 +``` + +Git autocorrects and runs the command after a 1-second countdown: + +``` +$ git statsu +WARNING: You called a Git command named 'statsu', which does not exist. +Continuing in 0.9 seconds, assuming that you meant 'status'. +``` + +The `10` here means 1 second (git measures in tenths). It's long enough to notice and interrupt if the correction is wrong, but short enough not to interrupt workflow. + +### fetch.prune and fetch.prunetags + +When teammates delete branches on the remote, stale refs accumulate in your local repository. These settings clean them up: + +```ini +[fetch] + prune = true + prunetags = true +``` + +Now `git fetch` silently removes local branches that no longer exist upstream, and does the same for tags. For a Hugo theme repo, old release tags get cleaned up on the server, and `prunetags` means they don't linger in your local `git tag` output. + +## When Conflicts Happen: `merge.conflictstyle` and `rerere` + +Two settings that make merge conflicts less painful. + +### merge.conflictstyle = zdiff3 + +Conflict markers normally show you two sides: + +``` +<<<<<<< HEAD +your code +======= +their code +>>>>>>> branch +``` + +You see what you wrote and what they wrote, but not what you both started from. The `zdiff3` conflict style shows the ancestor: + +``` +<<<<<<< HEAD +your code +||||||| base +original code +======= +their code +>>>>>>> branch +``` + +The `||||||| base` section is what both sides changed from. Now you can see the full story: you changed this line to X, they changed it to Y, and the original was Z. Intent becomes obvious. + +```ini +[merge] + conflictstyle = zdiff3 +``` + +### rerere.enabled and rerere.autoupdate + +`rerere` stands for "reuse recorded resolution." When you resolve a conflict manually, git remembers the resolution. The next time you hit the same conflict: + +```ini +[rerere] + enabled = true + autoupdate = true +``` + +Git resolves it automatically. This is invaluable when rebasing a content branch over a main that includes a submodule pointer update. The first time there's a conflict in the submodule reference, you resolve it. On a second branch with the same conflict, `rerere` handles it silently, and `autoupdate` stages the resolution so you don't have to `git add` it manually. + +## Looking Around: Branch Display, Logs, and Diffs + +Four settings that make reading your repository history faster. + +### branch.sort and column.ui + +```ini +[branch] + sort = -committerdate + +[column] + ui = auto +``` + +By default, `git branch` lists branches alphabetically. Useless past ten branches. The `-committerdate` sort shows newest first, so the branch you're probably about to switch to is at the top. + +`column.ui = auto` displays branches in multiple columns when your terminal is wide enough, cutting down on scrolling through a long list. + +### log.abbrevCommit and log.follow + +```ini +[log] + abbrevCommit = true + follow = true +``` + +`abbrevCommit` shows short SHAs (7 chars) instead of full 40-character hashes. Cleaner logs, faster to read. + +`follow` tracks files through renames. When you run `git log -- path/to/article.md` and that file was once named `old-article.md`, log doesn't break, it follows the file through the rename and shows the full history. + +### diff.mnemonicPrefix, diff.renames, and diff.wordRegex + +```ini +[diff] + mnemonicPrefix = true + renames = true + wordRegex = [^[:space:]] +``` + +`mnemonicPrefix` changes the diff headers from `a/` and `b/` to more descriptive labels like `i/` (index), `w/` (working tree), `o/` (object), `c/` (commit). More information at a glance. + +`renames = true` detects file renames and shows them as `file.old => file.new` instead of a delete and a create. Cleaner diffs. + +`wordRegex` defines what counts as a "word" in word-level diffs (`git diff --word-diff`). The pattern `[^[:space:]]` treats any non-whitespace as a word, which means punctuation gets its own boundaries, useful for prose-heavy files like Markdown articles. + +## Shorthand That Earns Its Place: Aliases + +I keep aliases minimal on purpose. Aliases that hide what git is doing are noise; these two are worth the keystroke savings. + +### lg: Pretty-print log with graph + +```ini +[alias] + lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all +``` + +Running `git lg` shows a colored graph with commit hashes, dates, messages, authors, and branch pointers: + +``` +* abc1234 - (3 hours ago) Add git config article - Danilo M. (HEAD -> master) +* def5678 - (1 day ago) Fix theme CSS - Danilo M. +|\ +| * ghi9012 - (2 days ago) WIP: new feature - Danilo M. (content/draft) +|/ +* jkl3456 - (5 days ago) Bump theme submodule - Danilo M. (origin/master) +``` + +Much better than plain `git log`. + +### sw: Switch shorthand + +```ini +[alias] + sw = switch +``` + +`git sw main` is faster than `git switch main`, and `git sw -c feature/new` creates and switches in one command. + +## A Typical Day + +Here's how these settings work together in practice. + +Morning: sync with the repo. `git fetch` fires silently in the background, `fetch.prune` and `prunetags` cleaning up any deleted branches and old tags without you thinking about it. + +I'm starting the week's Hugo article. Cut a new content branch: + +```bash +git sw -c content/git-config-deep-dive +``` + +No typing `--set-upstream` later. `push.autoSetupRemote` has me covered. + +Write, commit. The commit is GPG-signed automatically. No extra steps. + +```bash +git commit -m "Add first draft of git config article" +``` + +Push when done: + +```bash +git push +``` + +No upstream error. Just works. + +Later, the main branch gets a theme submodule update. I rebase my work on top: + +```bash +git fetch +git rebase main +``` + +There's a conflict in the submodule pointer, the theme repo moved forward. `merge.conflictstyle = zdiff3` shows me exactly what changed. I resolve it once. + +Later, a second branch has the same submodule conflict. `rerere` remembers my resolution and applies it automatically with `rerere.autoupdate`. No re-resolving. + +Before merging back to main, check the graph: + +```bash +git lg +``` + +Pretty output shows the timeline clearly. + +Merge to main: + +```bash +git switch main +git merge content/git-config-deep-dive +``` + +If there's a conflict here (unlikely given we rebased), `zdiff3` shows the ancestor context. + +Done. All the settings worked together transparently. + +## The Full Config + +Here's the complete block as it sits in my `~/.gitconfig`: + +```ini +[user] + name = Danilo M. + email = danix@danix.xyz + signingkey = YOUR_KEY_ID_HERE + +[pull] + rebase = true + +[push] + autoSetupRemote = true + +[commit] + gpgsign = true + +[help] + autocorrect = 10 + +[fetch] + prune = true + prunetags = true + +[merge] + conflictstyle = zdiff3 + +[rerere] + enabled = true + autoupdate = true + +[branch] + sort = -committerdate + +[column] + ui = auto + +[log] + abbrevCommit = true + follow = true + +[diff] + mnemonicPrefix = true + renames = true + wordRegex = [^[:space:]] + +[alias] + lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all + sw = switch +``` + +Copy what you need. Leave what doesn't fit your workflow. + +## A Config That Evolves + +This isn't the "correct" git configuration, it's the one that fits how I work. I've been refining it for years, and it'll keep evolving as I hit new friction points and discover new settings. The point isn't to follow mine exactly, but to think about what's slowing you down and look for the git setting that fixes it. + +If you use any of these settings, or if you've found others that changed your workflow, let me know in the comments. I'm always curious how other people configure their tools. diff --git a/content/en/articles/playing-with-colors/index.md b/content/en/articles/playing-with-colors/index.md index 9085d6a..b6c05c9 100644 --- a/content/en/articles/playing-with-colors/index.md +++ b/content/en/articles/playing-with-colors/index.md @@ -18,6 +18,6 @@ I was having a look at some color palettes for _**I'm not gonna tell ya**_, and It's actually very simple, there's a large preview where you can modify each color on the fly, and then you can send them to a fake page preview. that's it. -I put it on <a href="https://github.com/danixland/palette-viewer" target="_blank" rel="noopener noreferrer">github</a>, just in case you want to give it a look. +I put it on [github](https://github.com/danixland/palette-viewer), just in case you want to give it a look. Let me know what you think about it. Cheers ;)
\ No newline at end of file diff --git a/content/en/articles/poker-time/index.md b/content/en/articles/poker-time/index.md index dd64777..67064e4 100644 --- a/content/en/articles/poker-time/index.md +++ b/content/en/articles/poker-time/index.md @@ -8,6 +8,3 @@ categories = [ "Photography"] tags = [ "poker", "feste", "gioco"] +++ -<figure style="width: 500px" class="wp-caption aligncenter"><img loading="lazy" style="margin-right: auto;margin-left: auto" src="http://danixland.net/wp-content/uploads/2010/12/wpid-2010-12-19-21.45.121.jpg" alt="image" width="500" height="375" /><figcaption class="wp-caption-text">seratina relax a base di poker.. ovviamente senza soldi veri :-) il modo migliore per passare le serate quando non si ha voglia di uscire..</figcaption></figure> - -
\ No newline at end of file diff --git a/content/en/articles/pure-nerdgasm/index.md b/content/en/articles/pure-nerdgasm/index.md index 0326fd0..6be196a 100644 --- a/content/en/articles/pure-nerdgasm/index.md +++ b/content/en/articles/pure-nerdgasm/index.md @@ -7,9 +7,5 @@ excerpt = "An EPIC video of two floppy disks playing the imperial march.. nerdga image = "/uppies/2011/10/vader.jpg" categories = [ "Blogging"] tags = [ "web", "floppy disks", "imperial march", "nerdgasm", "nerds", "star wars", "youtube"] -+++ - -<figure class="wp-block-embed-youtube aligncenter wp-block-embed is-type-rich is-provider-embed-handler wp-embed-aspect-4-3 wp-has-aspect-ratio"> - -<div class="wp-block-embed__wrapper"> -</div><figcaption>can’t get nerdier than this…</figcaption></figure>
\ No newline at end of file +draft = true ++++
\ No newline at end of file diff --git a/content/en/articles/r-i-p-steve-jobs/index.md b/content/en/articles/r-i-p-steve-jobs/index.md index 0a04ed9..b155316 100644 --- a/content/en/articles/r-i-p-steve-jobs/index.md +++ b/content/en/articles/r-i-p-steve-jobs/index.md @@ -9,4 +9,4 @@ categories = [ "Blogging"] tags = [ "Steve Jobs"] +++ -<figure id="attachment_3691" aria-describedby="caption-attachment-3691" style="width: 1024px" class="wp-caption aligncenter"><img loading="lazy" class="wp-image-3691 size-large" src="https://danix.xyz/wp-content/uploads/2011/10/jobs-1024x741.jpg" alt="" width="1024" height="741" srcset="https://danix.xyz/wp-content/uploads/2011/10/jobs-1024x741.jpg 1024w, https://danix.xyz/wp-content/uploads/2011/10/jobs-300x217.jpg 300w, https://danix.xyz/wp-content/uploads/2011/10/jobs-768x556.jpg 768w, https://danix.xyz/wp-content/uploads/2011/10/jobs.jpg 1500w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption id="caption-attachment-3691" class="wp-caption-text">Today a truly beautiful mind has left our world. Today is a very sad day.</figcaption></figure>
\ No newline at end of file +{{< image src="/uppies/2011/10/jobs.jpg" alt="Steve Jobs" caption="Today a truly beautiful mind has left our world. Today is a very sad day." >}}{{< /image >}}
\ No newline at end of file diff --git a/content/en/articles/responsibility/index.md b/content/en/articles/responsibility/index.md index b82273a..9b9aed3 100644 --- a/content/en/articles/responsibility/index.md +++ b/content/en/articles/responsibility/index.md @@ -8,8 +8,4 @@ categories = [ "Blogging", "Self Reflection"] tags = [ "life", "responsibility"] +++ -<blockquote class="wp-block-quote"> - <p> - Accept responsibility for your life. Know that it is you who will get you where you want to go, no one else. - </p> -</blockquote>
\ No newline at end of file +> Accept responsibility for your life. Know that it is you who will get you where you want to go, no one else.
\ No newline at end of file diff --git a/content/en/repository/index.md b/content/en/repository/index.md index cbab271..96a41ed 100644 --- a/content/en/repository/index.md +++ b/content/en/repository/index.md @@ -1,20 +1,40 @@ +++ title = "Slackware Repository" date = 2026-04-17T00:00:00Z -draft = true +++ +This is a **Slackware64-current** repository, my packages are built on and managed for slackware64-current. When I release a package that can build on the latest stable version of Slackware, I'll try to publish it to [slackbuilds.org](https://slackbuilds.org/), but if the package comes from this repository, you can assume it's for `-current` only. + ## Quick Start -Add the repository to your Slackware system: +To add the repository to your Slackware system you'll need [slackpkg+](https://slakfinder.org/slackpkg+.html), edit `/etc/slackpkg/slackpkgplus.conf` and use **"danix"** as the repository name: + +```bash +# Add repository to the PKGS_PRIORITY +PKGS_PRIORITY=( multilib danix alien restricted slackers) +# Add danix to the REPOPLUS array +REPOPLUS=( slackpkgplus restricted alien multilib slackers hyprwm danix ) +# Lastly, define the "danix" MIRRORPLUS entry +MIRRORPLUS['danix']=https://packages.danix.xyz/ +``` + +You can have my repository alongside other repos. + +Now that it is configured you can simply update the list and search for my packages directly using `slackpkg`. ```bash -# Add repository configuration (example command) -wget -O - https://danix.xyz/packages/slackware.asc | gpg --import -echo "deb https://danix.xyz/packages/slackware/ stable main" >> /etc/apt/sources.list.d/danix.list -apt-get update +# update the packages signatures +slackpkg update gpg +# update the packages lists +slackpkg update +# search for a package +slackpkg search <package name> +# install a package +slackpkg install <package name> ``` + + ## Installation ### Prerequisites @@ -25,15 +45,15 @@ apt-get update ### Steps -1. Download and import the repository GPG key -2. Add the repository to your package manager configuration +1. Add the repository to your slackpkg+ configuration +2. import the GPG key for my repository 3. Update your package lists 4. Install packages as needed ### Repository URL ``` -https://danix.xyz/packages/slackware/ +https://packages.danix.xyz/ ``` ## Usage @@ -41,20 +61,22 @@ https://danix.xyz/packages/slackware/ ### Installing a Package ```bash -apt-get install package-name +slackpkg install package-name ``` ### Updating Packages ```bash -apt-get update -apt-get upgrade +slackpkg update +slackpkg upgrade +# to update all packages, including the Slackware system ones: +slackpkg upgrade-all ``` ### Searching for Packages ```bash -apt-cache search keyword +slackpkg search keyword ``` ## Available Packages |
