June of 2021
Projects⚑
-
New: Introduce seedling self-hosted map project.
I love maps, as well as traveling and hiking. This project aims to create a web interface that let's me interact with the data gathered throughout my life. I'd like to:
- Browse the waypoints and routes that I've done.
- Create routes and export the gpx.
- Be able to search through the data
- Plan trips
-
New: Add the Life seedling project.
Life is a real time sandbox role game where you play as yourself surviving in today's world.
-
New: Add bruty to the dormant plant projects.
bruty is a Python program to bruteforce dynamic web applications with Selenium.
Coding⚑
Python⚑
-
Improvement: Add textual as interesting library to explore.
textual: Textual is a TUI (Text User Interface) framework for Python using Rich as a renderer.
Click⚑
- Improvement: Explain how to change the command line help description.
Configure Docker to host the application⚑
-
New: Explain how to use watchtower to keep docker containers updated.
With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.
-
Correction: Explain how to run the watchtower checks immediately.
With the
--run-once
flag
FastAPI⚑
- New: Explain how to make redirections with fastapi.
- New: Explain how to run a FastAPI server in the background for testing purposes.
Pytest⚑
-
New: Explain how to set a timeout for your tests.
Using pytest-timeout.
-
New: Explain how to rerun tests that fail sometimes.
With pytest-rerunfailures that is a plugin for pytest that re-runs tests to eliminate intermittent failures. Using this plugin is generally a bad idea, it would be best to solve the reason why your code is not reliable. It's useful when you rely on non robust third party software in a way that you can't solve, or if the error is not in your code but in the testing code, and again you are not able to fix it.
feat(python_snippets#Create combination of elements in groups of two): Explain how to create combination of elements in groups of two
>>> list(itertools.combinations('ABC', 2)) [('A', 'B'), ('A', 'C'), ('B', 'C')]
Python Snippets⚑
-
New: Explain how to convert html code to readable plaintext.
pip install html2text
import html2text html = open("foobar.html").read() print(html2text.html2text(html))
-
New: Explain how to parse a datetime from a string.
from dateutil import parser parser.parse("Aug 28 1999 12:00AM") # datetime.datetime(1999, 8, 28, 0, 0)
Python Mysql⚑
- New: Explain how to interact with MySQL databases with Python.
-
Correction: Correct the syntax of the left joins.
Instead of using
ON users.id == addresses.user_id
, useON users.id = addresses.user_id
Selenium⚑
- New: Explain how to use selenium with python.
-
New: Explain how to Set timeout of a response.
driver.set_page_load_timeout(30)
-
New: Explain how to fix when Chromedriver hangs up unexpectedly.
os.environ["DBUS_SESSION_BUS_ADDRESS"] = "/dev/null"
DevOps⚑
Infrastructure Solutions⚑
Jobs⚑
-
New: Explain how to rerun failed cronjobs.
If you have a job that has failed after the 6 default retries, it will show up in your monitorization forever, to fix it, you can manually trigger the job.
kubectl get job "your-job" -o json \ | jq 'del(.spec.selector)' \ | jq 'del(.spec.template.metadata.labels)' \ | kubectl replace --force -f -
Continuous Integration⚑
-
New: Explain how to troubleshoot the error: pathspec master did not match any file.
Remove all git hooks with
rm -r .git/hooks
.
Monitoring⚑
Elasticsearch Exporter⚑
-
New: Introduce the prometheus elasticsearch exporter.
The elasticsearch exporter allows monitoring Elasticsearch clusters with Prometheus.
Explain how to install it, configure the grafana dashboards and the alerts.
-
Improvement: Add more elasticsearch alerts.
Measure the search latency, search rate and create alerts on the garbage collector, json parser and circuit breaker errors
-
New: Add alert on low number of healthy master nodes.
Software Architecture⚑
Domain Driven Design⚑
-
Improvement: Add warning when migrating old code.
You may be tempted to migrate all your old code to this architecture once you fall in love with it. Truth being told, it's the best way to learn how to use it, but it's time expensive too! The last refactor I did required a change of 60% of the code. The upside is that I reduced the total lines of code a 25%.
Operative Systems⚑
Linux⚑
Linux Snippets⚑
-
New: Explain how to split a file into many with equal number of lines.
split -l 200000 filename
-
New: Explain how to identify what a string or file contains.
Using pywhat
dunst⚑
-
New: Introduce dunst.
Dunst is a lightweight replacement for the notification daemons provided by most desktop environments. It’s very customizable, isn’t dependent on any toolkits, and therefore fits into those window manager centric setups we all love to customize to perfection.
elasticsearch⚑
-
Correction: Explain how to restore only some indices.
curl -X POST "{{ url }}/_snapshot/{{ backup_path }}/{{ snapshot_name }}/_restore?pretty" -H 'Content-Type: application/json' -d' { "indices": "{{ index_to_restore }}", }'
Arts⚑
Writing⚑
Grammar and Orthography⚑
-
New: Explain what collocations are and how to avoid the word very.
Collocation refers to a natural combination of words that are closely affiliated with each other. They make it easier to avoid overused or ambiguous words like "very", "nice", or "beautiful", by using a pair of words that fit the context better and that have a more precise meaning.
-
New: Explain what can you use instead of I know.
Using "I know" may not be the best way to show the other person that you've got the information. You can take the chance to use other words that additionally gives more context on how you stand with the information you've received, thus improving the communication and creating a bond.
Cooking⚑
- New: Introduce the cooking art.
Cooking Basics⚑
- New: Refactor the perfect technique to boil an egg.
-
New: Explain how to boil chickpeas when you've forgotten to soak them.
Add a level teaspoon of baking soda to the pot and cook them as usual