remove old site (finally !!!)

This commit is contained in:
jacekpoz 2024-05-21 00:59:58 +02:00
parent 979f370ab4
commit 03117b3fd4
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
11 changed files with 0 additions and 349 deletions

View file

@ -1,5 +0,0 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++

View file

@ -1 +0,0 @@
piss blob

View file

@ -1,9 +0,0 @@
+++
title = 'About'
date = 2023-11-12T23:23:47+01:00
draft = false
+++
hello :-)
I like foss and stuff

View file

@ -1,115 +0,0 @@
+++
title = 'My git workflow'
date = 2023-11-12T19:10:04+01:00
draft = false
+++
## TL;DR (if you use nix)
[git module](https://codeberg.org/jacekpoz/niksos/src/branch/master/modules/cli/git.nix) (uses home-manager) and [the config](https://codeberg.org/jacekpoz/niksos/src/branch/master/hosts/niks/configuration.nix#L323-L330)
[ssh module](https://codeberg.org/jacekpoz/niksos/src/branch/master/modules/services/ssh.nix) and [the config](https://codeberg.org/jacekpoz/niksos/src/branch/master/hosts/niks/configuration.nix#L434-L472)
---
Over the past few months I helped a few people learn git so I decided to put this together instead of explaining my workflow each time.
Hopefully this can serve as a simple git guide to get started quickly or as a reference to come back to if you forget something.
I don't use any git wrappers, the cli is enough for me. If you know of a good one let me know, I might try it and add it here.
---
I aliased `git` to `g` in my [zsh config](https://codeberg.org/jacekpoz/niksos/src/branch/master/modules/cli/zsh.nix#L31), which is what I use in all the examples below.
First the basics:
- `g init` initializes the repo in `.`; make sure you create a new one for your repo,
- `g clone forge:username/repo` will download that repository into `./repo`,
- `g remote add origin forge:username/repo` is how you connect the local repo to your preferred git forge (more in [remotes](#remotes)),
- `g add .` adds all the changes you made so far (more in [adding](#adding)),
- `g commit -m "commit message"` creates a commit with whatever you added prior (more in [commits](#commits)),
- `g push` pushes all the commits to the forge (it ignores added but uncommited changes),
- `g status` shows you the current status (added files, unpushed commites, etc.) and handy commands on how to change it.
If you run all these right now you'll get an error akin to this:
```
user@example.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
```
which means you need to generate and setup an ssh key.
## SSH key
`ssh-keygen -t ed25519 -f ~/.ssh/<keyfile>` is what I usually do. Some people might recommend making a single key for all git forges, I keep them separate, you do you.
After running the above you'll be asked to enter a passphrase or leave it empty for no passphrase. I recommend **always** setting a strong passphrase (could be generated with [KeePassXC](https://keepassxc.org)) and adding it to a password manager like the aforementioned. Copying and pasting that passphrase isn't a big deal, having your unlocked key stolen is.
After doing that you'll have 2 files, `~/.ssh/<keyfile>` (the private key) and `~/.ssh/<keyfile>.pub` (the public key). As the name suggests, **DO NOT** share the first one with anyone, it must be kept secure. If that leaks and isn't protected by a password, or the password is cracked, whoever has the file can modify the git history as you.
Now you want to add your public key to your preferred git forge. Here's how to do that on [github](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account), [gitlab](https://docs.gitlab.com/ee/user/ssh.html#add-an-ssh-key-to-your-gitlab-account) and [codeberg](https://docs.codeberg.org/security/ssh-key/#add-the-ssh-key-to-codeberg) (which should work for all forgejo instances). All of these instructions are pretty similar and you should be able to figure it out after the first time.
What we need to do now is tell git which ssh key to use when connecting to our preferred forge.
## Remotes
On my machine I alias all the remotes in my ssh config which both makes them shorter and allows me to add the ssh key to that forge. The nix config is at the top but if you don't use nix this is what you add for each remote to either `/etc/ssh/ssh_config` or (preferably) `~/.ssh/config`:
```
Host example
HostName git.example.com
User git
IdentityFile /path/to/private_key
```
For an example, this is what I'd do for codeberg:
```
Host codeberg
HostName codeberg.org
User git
IdentityFile ~/.ssh/codeberg
```
and change my git remote: `g remote set-url origin codeberg:nickname/repo` (if you added it already).
Now you should finally be able to push your changes! That wasn't so bad, was it? This workflow might not be ideal to you but it's simple and convenient enough for me and I think it should be alright for new users.
The purpose of this post isn't to be a general git guide, it's a reference I (and hopefully others) can go back to. For a general git guide that goes much more in depth than this I can't recommend the [official git book](https://git-scm.com/book/en/v2) enough. This post covers a very small part of the second chapter of that book. If you also want a (maybe not so quick) reference for various git subcommands check their manpages, e.g. `man git-add` for `g add`.
Now, if all you want to do is push a few commits to a repo, this should be enough and you can stop reading. If you want to learn interactive adding, reverting your changes, signing your commits with a GPG key and more, read on!
## Adding
`g add` accepts a [glob pattern](https://en.wikipedia.org/wiki/Glob_(programming)#Unix-like) meaning that you can e.g. `g add *.c` to add all files ending with `.c` in the current directory. Passing a single file name of course also works.
`g add -p` gives you access to the interactive mode, which displays hunks (a part of the changes) that you can add `y`, discard `n`, split `s` or manually edit `e` into smaller hunks. It also accepts a glob pattern, just like the normal `g add`. The interactive mode might offer more functionality but I found these 4 options to be enough for almost anything.
## Commits
`g commit` without any flags will let you edit the commit message in your editor of choice. It can be set with either `g config --global core.editor "my_editor"` or with the environment variable `GIT_EDITOR`. If you're on nix and use home-manager check my git module.
`g log` gives you all commits in the current repo. Each commit description starts with something like `commit b155c8912bb2347e030e723a2b37f1a60cb0fe15`. That big mess of characters is the commit hash, its identifier which you will use to refer to that commit. Usually you can type the first few characters of that hash and it should also work. When in doubt use your shell's autocompletion (most likely using the tab key). `g log` has *a lot* of flags, either read its manpage or toy around with the help of autocompletion.
If you want to see the state of your repo at a specific commit use `g checkout`.
Now that we know how to view and refer to a specific commit, we can learn how to revert the changes made in that commit. The terminology on this one is really confusing, I have to check it almost every time I need to revert a commit:
- `g reset --hard commit_hash` will remove that commit and **remove all the changes in that commit locally** — to get them back you have to rewrite them by hand; most of the time not necessary,
- `g revert commit_hash` will create a revert commit — the exact opposite of the one you're reverting, bringing you back to the state before it,
- `g reset --soft commit_hash` will remove that commit but keep its changes, allowing you to make further changes, add and commit them again; in practice this is the one I use the most.
To ammend further changes to the last commit you can add the changes and use `g commit --ammend`. It's probably a faster equivalent to `g reset --soft`, I just happen to have learned the former first and got used to it.
If you want to sign your commits with a GPG key, verifying that you're actually their author, you want to make git aware of your public key. To do that, run `g config --global user.signingkey my_public_gpg_key` and install a pinentry frontend. I use the qt one and can recommend it. If you have no idea what I'm talking about, skip this section. This isn't necessary and your contributions most likely won't be rejected because your commits aren't signed.
---
If you got stuck on some part, find this too hard or have any suggestions for this post, feel free to contact me. All my public contact information is on the sidebar at the top of all pages, I'd be more than happy to help you out. :-)

View file

@ -1,31 +0,0 @@
{
pkgs ? import <nixpkgs> {},
...
}: let
risotto-src = pkgs.fetchFromGitHub {
owner = "jacekpoz";
repo = "risotto";
rev = "7c8cdd97cca30c49f0c13cf2e049f43b39b49d75";
hash = "sha256-CX4aLTY1Z6E0QoRQIUOmfhG1gGCCnLqwBiLjhVMSpY8=";
};
in pkgs.stdenv.mkDerivation {
name = "jacekpoz.pl";
version = "0.1";
src = ./.;
buildInputs = with pkgs; [
hugo
];
dontConfigure = true;
buildPhase = ''
cp -r $src/* .
cp -r ${risotto-src} ./themes/risotto
${pkgs.hugo}/bin/hugo
'';
installPhase = ''
mkdir -p $out
cp -r ./public/* $out/
'';
}

View file

@ -1,40 +0,0 @@
baseURL = "https://jacekpoz.pl/"
theme = "risotto"
languageCode = "en-us"
title = "jacekpoz"
author = "jacekpoz"
copyright = "© 2023 by jacekpoz"
[params]
[params.theme]
palette = "tokyo-night-dark"
[params.about]
title = "jacekpoz"
description = "piss blob"
logo = "jacekpoz.svg"
[[params.socialLinks]]
logo = "email.svg"
title = "Email"
url = "mailto:jacekpoz@proton.me"
[[params.socialLinks]]
logo = "matrix.svg"
title = "Matrix"
url = "https://matrix.to/#/@jacekpoz:jacekpoz.pl"
[menu]
[[menu.main]]
identifier = "posts"
name = "posts"
url = "/posts/"
weight = 1
[[menu.main]]
identifier = "about"
name = "about"
url = "/about"
weight = 2

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="windows-1252"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg fill="#ffffff" height="32px" width="32px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 75.294 75.294" xml:space="preserve">
<g>
<path d="M66.097,12.089h-56.9C4.126,12.089,0,16.215,0,21.286v32.722c0,5.071,4.126,9.197,9.197,9.197h56.9 c5.071,0,9.197-4.126,9.197-9.197V21.287C75.295,16.215,71.169,12.089,66.097,12.089z M61.603,18.089L37.647,33.523L13.691,18.089 H61.603z M66.097,57.206h-56.9C7.434,57.206,6,55.771,6,54.009V21.457l29.796,19.16c0.04,0.025,0.083,0.042,0.124,0.065 c0.043,0.024,0.087,0.047,0.131,0.069c0.231,0.119,0.469,0.215,0.712,0.278c0.025,0.007,0.05,0.01,0.075,0.016 c0.267,0.063,0.537,0.102,0.807,0.102c0.001,0,0.002,0,0.002,0c0.002,0,0.003,0,0.004,0c0.27,0,0.54-0.038,0.807-0.102 c0.025-0.006,0.05-0.009,0.075-0.016c0.243-0.063,0.48-0.159,0.712-0.278c0.044-0.022,0.088-0.045,0.131-0.069 c0.041-0.023,0.084-0.04,0.124-0.065l29.796-19.16v32.551C69.295,55.771,67.86,57.206,66.097,57.206z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View file

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
fill="none"
height="32"
width="32"
viewBox="0 0 32 32"
version="1.1"
id="svg113"
sodipodi:docname="jacekpoz revolt.svg"
inkscape:version="1.2 (dc2aedaf03, 2022-05-15)"
inkscape:export-filename="jacekpoz revolt.png"
inkscape:export-xdpi="1800"
inkscape:export-ydpi="1800"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs117" />
<sodipodi:namedview
id="namedview115"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:deskcolor="#505050"
showgrid="false"
inkscape:zoom="37.28125"
inkscape:cx="9.0796312"
inkscape:cy="16"
inkscape:window-width="2560"
inkscape:window-height="1399"
inkscape:window-x="1920"
inkscape:window-y="41"
inkscape:window-maximized="1"
inkscape:current-layer="g111" />
<clipPath
id="a">
<path
d="m0 0h32v32h-32z"
id="path90" />
</clipPath>
<g
clip-path="url(#a)"
id="g111">
<path
d="m31.1028 20.9925c0 2.0091-.5252 3.4351-1.3444 4.4745-.8271 1.0495-2.0166 1.7841-3.4762 2.2907-2.9616 1.0282-6.7719 1.0379-10.1824 1.0379-3.4093 0-7.27255-.0094-10.28664-1.0393-1.48698-.5081-2.7015-1.2447-3.54601-2.2958-.83532-1.0397-1.370401-2.4634-1.370401-4.468 0-3.748.807291-8.3097 3.108411-11.90376 2.26699-3.54072 6.01294-6.19919 12.09464-6.19919 5.7647 0 9.4692 2.66321 11.7712 6.23125 2.3312 3.6131 3.2318 8.1799 3.2318 11.8717z"
fill="#fbc546"
stroke="#000"
stroke-width="1.7935"
id="path93" />
<g
clip-rule="evenodd"
fill-rule="evenodd"
id="g109">
<path
d="m19.4545 22.4125c.4709 0 .8531.3822.8531.8531 0 .471-.3822.8532-.8531.8532h-6.8253c-.4709 0-.8531-.3822-.8531-.8532 0-.4709.3822-.8531.8531-.8531z"
fill="#593604"
id="path95" />
<path
d="m27.1329 19.853c0-.9427-.7636-1.7063-1.7063-1.7063-1.0426 0-2.3701 0-3.4126 0-.9428 0-1.7064.7636-1.7064 1.7063 0 .9428.7636 1.7064 1.7064 1.7064h3.4126c.9427 0 1.7063-.7636 1.7063-1.7064z"
fill="#ed6b44"
id="path97" />
<path
d="m11.7761 19.853c0-.9427-.7636-1.7063-1.7064-1.7063-1.04251 0-2.37002 0-3.41258 0-.94274 0-1.70631.7636-1.70631 1.7063 0 .9428.76357 1.7064 1.70631 1.7064h3.41258c.9428 0 1.7064-.7636 1.7064-1.7064z"
fill="#ed6b44"
id="path99" />
<path
d="m 6.498,18.9998 c 1.0178,0 1.9938,-0.4044 2.7139,-1.1236 0.7192,-0.72 1.1236,-1.696 1.1236,-2.7139 0,-0.2841 0,-0.5707 0,-0.8548 0,-2.1201 -1.7191,-3.8392 -3.8392,-3.8392 -8e-4,0 -8e-4,0 -0.0017,0 -1.01781,0 -1.99382,0.4044 -2.71389,1.1236 -0.71921,0.72 -1.12361,1.696 -1.12361,2.7139 v 0.8548 c 0,2.1201 1.71912,3.8392 3.8392,3.8392 z"
fill="#ffffff"
id="path101" />
<path
d="m 5.21658,14.7256 c 0,-0.9376 0.76017,-1.6978 1.69782,-1.6978 h 0.017 c 0.9376,0 1.6978,0.7602 1.6978,1.6978 v 0.0026 c 0,0.9376 -0.7602,1.6978 -1.6978,1.6978 -0.0059,0 -0.0111,0 -0.017,0 -0.93765,0 -1.69782,-0.7602 -1.69782,-1.6978 0,-9e-4 0,-0.0017 0,-0.0026 z"
fill="#000000"
id="path103" />
<path
d="m 25.5857,18.9998 c -1.0178,0 -1.9939,-0.4044 -2.7139,-1.1236 -0.7192,-0.72 -1.1236,-1.696 -1.1236,-2.7139 0,-0.2849 0,-0.5716 0,-0.8565 0,-1.0179 0.4044,-1.9939 1.1236,-2.7139 0.72,-0.7192 1.6961,-1.1236 2.7139,-1.1236 h 0.0034 c 1.0178,0 1.9938,0.4044 2.7139,1.1236 0.7192,0.72 1.1236,1.696 1.1236,2.7139 v 0.8548 c 0,2.1201 -1.7191,3.8392 -3.8392,3.8392 -9e-4,0 -9e-4,0 -0.0017,0 z"
fill="#ffffff"
id="path105" />
<path
d="m 26.8671,14.7256 c 0,-0.9376 -0.7602,-1.6978 -1.6978,-1.6978 -0.006,0 -0.0111,0 -0.017,0 -0.9377,0 -1.6978,0.7602 -1.6978,1.6978 v 0.0026 c 0,0.9376 0.7601,1.6978 1.6978,1.6978 h 0.017 c 0.9376,0 1.6978,-0.7602 1.6978,-1.6978 0,-9e-4 0,-0.0017 0,-0.0026 z"
fill="#000000"
id="path107" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="32px"
height="32px"
viewBox="0 0 520 520"
style="enable-background:new 0 0 520 520;"
xml:space="preserve"
sodipodi:docname="matrix.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs123" /><sodipodi:namedview
id="namedview121"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:deskcolor="#505050"
showgrid="false"
inkscape:zoom="1.3965359"
inkscape:cx="187.60706"
inkscape:cy="338.33717"
inkscape:window-width="2560"
inkscape:window-height="1404"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1"
showguides="false" />
<path
d="M13.7,11.9v496.2h35.7V520H0V0h49.4v11.9H13.7z"
id="path114"
style="stroke-width:15;stroke-dasharray:none;stroke:#ffffff;stroke-opacity:1;fill:#ffffff;fill-opacity:1" />
<path
d="M166.3,169.2v25.1h0.7c6.7-9.6,14.8-17,24.2-22.2c9.4-5.3,20.3-7.9,32.5-7.9c11.7,0,22.4,2.3,32.1,6.8 c9.7,4.5,17,12.6,22.1,24c5.5-8.1,13-15.3,22.4-21.5c9.4-6.2,20.6-9.3,33.5-9.3c9.8,0,18.9,1.2,27.3,3.6c8.4,2.4,15.5,6.2,21.5,11.5 c6,5.3,10.6,12.1,14,20.6c3.3,8.5,5,18.7,5,30.7v124.1h-50.9V249.6c0-6.2-0.2-12.1-0.7-17.6c-0.5-5.5-1.8-10.3-3.9-14.3 c-2.2-4.1-5.3-7.3-9.5-9.7c-4.2-2.4-9.9-3.6-17-3.6c-7.2,0-13,1.4-17.4,4.1c-4.4,2.8-7.9,6.3-10.4,10.8c-2.5,4.4-4.2,9.4-5,15.1 c-0.8,5.6-1.3,11.3-1.3,17v103.3h-50.9v-104c0-5.5-0.1-10.9-0.4-16.3c-0.2-5.4-1.3-10.3-3.1-14.9c-1.8-4.5-4.8-8.2-9-10.9 c-4.2-2.7-10.3-4.1-18.5-4.1c-2.4,0-5.6,0.5-9.5,1.6c-3.9,1.1-7.8,3.1-11.5,6.1c-3.7,3-6.9,7.3-9.5,12.9c-2.6,5.6-3.9,13-3.9,22.1 v107.6h-50.9V169.2H166.3z"
id="path116"
style="stroke-width:1;stroke-dasharray:none;fill:#ffffff;fill-opacity:1" />
<path
d="M506.3,508.1V11.9h-35.7V0H520v520h-49.4v-11.9H506.3z"
id="path118"
style="stroke-width:15;stroke-dasharray:none;stroke:#ffffff;stroke-opacity:1;fill:#ffffff;fill-opacity:1" />
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

@ -1 +0,0 @@
Subproject commit 7c8cdd97cca30c49f0c13cf2e049f43b39b49d75