-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update dependency and publish newsletters
- Loading branch information
1 parent
d4bf91d
commit 08f2d9e
Showing
1 changed file
with
279 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,279 @@ | ||
# [Activism](antiracism.md) | ||
|
||
* New: Recomendar el episodio de podcast el diario de Jadiya. | ||
|
||
[Diario de Jadiya](https://deesonosehabla.com/episodios/episodio-2-jadiya/) ([link al archivo](https://dts.podtrac.com/redirect.mp3/dovetail.prxu.org/302/7fa33dd2-3f29-48f5-ad96-f6874909d9fb/Master_ep.2_Jadiya.mp3)): es algo que todo xenófobo debería de escuchar, es un diario de una chavala saharaui que formó parte del programa de veranos en familias españolas. | ||
|
||
## [Free Software](free_software.md) | ||
|
||
* New: Recomendar el artículo El software libre también necesita jardineros. | ||
|
||
- [El software libre también necesita jardineros](https://escritura.social/astrojuanlu/el-software-libre-tambien-necesita-jardineros) | ||
|
||
# Life Management | ||
|
||
## Time management | ||
|
||
### [Calendar Management](calendar_management.md) | ||
|
||
* New: [Add calendar event notification system tool.](calendar_management.md#calendar-event-notification-system) | ||
|
||
Set up a system that notifies you when the next calendar event is about to start to avoid spending mental load on it and to reduce the possibilities of missing the event. | ||
|
||
I've created a small tool that: | ||
|
||
- Tells me the number of [pomodoros](task_tools.md#pomodoro) that I have until the next event. | ||
- Once a pomodoro finishes it makes me focus on the amount left so that I can prepare for the event | ||
- Catches my attention when the event is starting. | ||
|
||
## Knowledge Management | ||
|
||
### [Analytical web reading](analytical_web_reading.md) | ||
|
||
* New: Introduce Analytical web reading. | ||
|
||
One part of the web 3.0 is to be able to annotate and share comments on the web. This article is my best try to find a nice open source privacy friendly tool. Spoiler: there aren't any :P | ||
|
||
The alternative I'm using so far is to process the data at the same time as I underline it. | ||
|
||
- At the mobile/tablet you can split your screen and have Orgzly on one tab and the browser in the other. So that underlining, copy and paste doesn't break too much the workflow. | ||
- At the eBook I underline it and post process it after. | ||
|
||
The idea of using an underlining tool makes sense in the case to post process the content in a more efficient environment such as a laptop. | ||
|
||
The use of Orgzly is kind of a preprocessing. If the underlining software can easily export the highlighted content along with the link to the source then it would be much quicker | ||
|
||
The advantage of using Orgzly is also that it works today both online and offline and it is more privacy friendly. | ||
|
||
On the post I review some of the existent solutions | ||
|
||
# Coding | ||
|
||
## Languages | ||
|
||
### [Bash snippets](bash_snippets.md) | ||
|
||
* New: [Self delete shell script.](bash_snippets.md#self-delete-shell-script) | ||
|
||
Add at the end of the script | ||
|
||
```bash | ||
rm -- "$0" | ||
``` | ||
|
||
`$0` is a magic variable for the full path of the executed script. | ||
|
||
* New: [Add a user to the sudoers through command line.](bash_snippets.md#add-a-user-to-the-sudoers-through-command-line-) | ||
|
||
Add the user to the sudo group: | ||
|
||
```bash | ||
sudo usermod -a -G sudo <username> | ||
``` | ||
|
||
The change will take effect the next time the user logs in. | ||
|
||
This works because `/etc/sudoers` is pre-configured to grant permissions to all members of this group (You should not have to make any changes to this): | ||
|
||
```bash | ||
%sudo ALL=(ALL:ALL) ALL | ||
``` | ||
|
||
* New: [Error management done well in bash.](bash_snippets.md#error-management-done-well-in-bash) | ||
|
||
If you wish to capture error management in bash you can use the next format | ||
|
||
```bash | ||
if ( ! echo "$EMAIL" >> "$USER_TOTP_FILE" ) then | ||
echo "** Error: could not associate email for user $USERNAME" | ||
exit 1 | ||
fi | ||
``` | ||
|
||
### [Bash testing](bats.md) | ||
|
||
* New: Introduce bats. | ||
|
||
Bash Automated Testing System is a TAP-compliant testing framework for Bash 3.2 or above. It provides a simple way to verify that the UNIX programs you write behave as expected. | ||
|
||
A Bats test file is a Bash script with special syntax for defining test cases. Under the hood, each test case is just a function with a description. | ||
|
||
```bash | ||
@test "addition using bc" { | ||
result="$(echo 2+2 | bc)" | ||
[ "$result" -eq 4 ] | ||
} | ||
@test "addition using dc" { | ||
result="$(echo 2 2+p | dc)" | ||
[ "$result" -eq 4 ] | ||
} | ||
``` | ||
|
||
Bats is most useful when testing software written in Bash, but you can use it to test any UNIX program. | ||
|
||
References: | ||
- [Source](https://github.com/bats-core/bats-core) | ||
- [Docs](https://bats-core.readthedocs.io/) | ||
|
||
### [Python Snippets](python_snippets.md) | ||
|
||
* New: [Fix variable is unbound pyright error.](python_snippets.md#fix-variable-is-unbound-pyright-error) | ||
|
||
You may receive these warnings if you set variables inside if or try/except blocks such as the next one: | ||
|
||
```python | ||
def x(): | ||
y = True | ||
if y: | ||
a = 1 | ||
print(a) # "a" is possibly unbound | ||
``` | ||
The easy fix is to set `a = None` outside those blocks | ||
```python | ||
def x(): | ||
a = None | ||
y = True | ||
if y: | ||
a = 1 | ||
print(a) # "a" is possibly unbound | ||
``` | ||
# [DevOps](immich.md) | ||
* New: [Keyboard shortcuts.](immich.md#keyboard-shortcuts) | ||
You can press `?` to see the shortcuts. Some of the most useful are: | ||
- `f`: Toggle favourite | ||
- `Shift+a`: Archive element | ||
## Infrastructure as Code | ||
### [Ansible Snippets](ansible_snippets.md) | ||
* New: [Avoid arbitrary disk mount.](ansible_snippets.md#avoid-arbitrary-disk-mount) | ||
Instead of using `/dev/sda` use `/dev/disk/by-id/whatever` | ||
* New: [Get the user running ansible in the host.](ansible_snippets.md#get-the-user-running-ansible-in-the-host-) | ||
If you `gather_facts` use the `ansible_user_id` variable. | ||
## Infrastructure Solutions | ||
### [AWS](aws.md) | ||
* New: [Get the role used by the instance.](aws.md#get-the-role-used-by-the-instance) | ||
# Operating Systems | ||
## Linux | ||
### [Linux Snippets](linux_snippets.md) | ||
* New: [Rotate image with the command line.](linux_snippets.md#rotate-image-with-the-command-line-) | ||
If you want to overwrite in-place, `mogrify` from the ImageMagick suite seems to be the easiest way to achieve this: | ||
```bash | ||
mogrify -rotate -90 *.jpg | ||
mogrify -rotate 90 *.jpg | ||
``` | ||
* New: [Configure desktop icons in gnome.](linux_snippets.md#configure-desktop-icons-in-gnome) | ||
Latest versions of gnome dont have desktop icons [read this article to fix this](https://gitlab.gnome.org/GNOME/nautilus/-/issues/158#instructions) | ||
### [detox](detox.md) | ||
* New: Introduce detox. | ||
detox cleans up filenames from the command line. | ||
Installation: | ||
```bash | ||
apt-get install detox | ||
``` | ||
Usage: | ||
```bash | ||
detox * | ||
``` | ||
### [mkdocs](mkdocs.md) | ||
* New: [Center images.](mkdocs.md#center-images) | ||
In your config enable the `attr_list` extension: | ||
```yaml | ||
markdown_extensions: | ||
- attr_list | ||
``` | ||
On your `extra.css` file add the `center` class | ||
```css | ||
.center { | ||
display: block; | ||
margin: 0 auto; | ||
} | ||
``` | ||
Now you can center elements by appending the attribute: | ||
~~~markdown | ||
![image](../_imatges/ebc_form_01.jpg){: .center} | ||
~~~ | ||
### [Wireguard](wireguard.md) | ||
* New: [Improve logging.](wireguard.md#improve-logging) | ||
WireGuard doesn’t do any logging by default. If you use the WireGuard Linux kernel module (on kernel versions 5.6 or newer), you can turn on WireGuard’s dyndbg logging, which sends log messages to the kernel message buffer, kmsg. You can then use the standard dmesg utility to read these messages. Also, many Linux systems have a logging daemon like rsyslogd or journald that automatically captures and stores these messages. | ||
First, enable WireGuard `dyndbg` logging with the following commands: | ||
```bash | ||
modprobe wireguard | ||
echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control | ||
``` | ||
Once you do that, you’ll be able to see WireGuard log messages in the kernel message facility, if your system is set up with `rsyslogd`, `journald`, or a similar logging daemon. With `rsyslogd`, check the `/var/log/kern.log` or `/var/log/messages` file. With `journald`, run `journalctl -ek`. | ||
* New: [Monitor wireguard.](wireguard.md#monitor-wireguard) | ||
- https://www.procustodibus.com/blog/2021/01/how-to-monitor-wireguard-activity/ | ||
- https://techoverflow.net/2021/12/31/how-to-check-if-wireguard-client-peer-is-connected/ | ||
# Arts | ||
## Writing | ||
### [Digital Gardens](digital_garden.md) | ||
* New: [Add the not by AI badge.](digital_garden.md#add-the-not-by-ai-badge) | ||
[Not by AI](https://notbyai.fyi/) is an initiative to mark content as created by humans instead of AI. | ||
To automatically add the badge to all your content you can use the next script: | ||
```bash | ||
echo "Checking the Not by AI badge" | ||
find docs -iname '*md' -print0 | while read -r -d $'\0' file; do | ||
if ! grep -q not-by-ai.svg "$file"; then | ||
echo "Adding the Not by AI badge to $file" | ||
echo "[![](not-by-ai.svg){: .center}](https://notbyai.fyi)" >>"$file" | ||
fi | ||
done | ||
``` | ||
You can see how it's used in this blog by looking at the `Makefile` and the `gh-pages.yaml` workflow. |