Monaspace
Monaspace
Do you like it ? I do …
Install macOS
brew tap homebrew/cask-fonts
brew install font-monaspace
Any Comments ?
sha256: 9f088f3023c2e5c26817ccddbfb49ea25dd6f08d0ba3ac6e7ca9038f0d2e2547
sha256: 2b87a252a3d912530dd8c20df6bee7f6cbc4ede0074fdf217e318aab39d9736c
Do you like it ? I do …
brew tap homebrew/cask-fonts
brew install font-monaspace
sha256: 9f088f3023c2e5c26817ccddbfb49ea25dd6f08d0ba3ac6e7ca9038f0d2e2547
Need some S3 Storage for Reasons ? Here a few Lines, how to Setup and enable TLS.
login as root for the whole installation. Or use sudo/doas if preferred.
apt update && apt upgrade -y
reboot if needed
Let’s add User as we don’t wanna run it as root
useradd -r minio-user -s /sbin/nologin
Download, set execute permission and move it
Today, the 55th Release of OpenBSD was announced. My Upgrade Script is available here.
see the Post on Undeadly for more Details, or the OpenBSD Page …
doas su -
cd /root
ftp https://blog.stoege.net/scripts/.helpers
ftp https://blog.stoege.net/scripts/upgrade_to_74.sh
chmod u+x upgrade_to_74.sh
do the Upgrade
… will be released next week (23. Oct 2023). Why not have a look at the upcomming OS and prepare a VM for Software Development ?
grab a fresh VM and Install OpenBSD 7.4
os version
puffy74# sysctl kern.version
kern.version=OpenBSD 7.4 (GENERIC.MP) #1396: Sun Oct 8 09:20:40 MDT 2023
deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
empty vm
puffy74# pkg_info
quirks-6.159 exceptions to pkg_add rules and cache
puffy74# pkg_add go rust python3
quirks-6.159 signed on 2023-10-07T10:09:24Z
go-1.21.1: ok
rust-1.72.1:nghttp2-1.56.0: ok
rust-1.72.1:nghttp3-0.15.0: ok
rust-1.72.1:ngtcp2-0.19.1: ok
rust-1.72.1:curl-8.3.0p0: ok
rust-1.72.1:libssh2-1.11.0: ok
rust-1.72.1: ok
python3-3.10p2:xz-5.4.4: ok
python3-3.10p2:sqlite3-3.42.0: ok
python3-3.10p2:libiconv-1.17: ok
python3-3.10p2:gettext-runtime-0.22.2: ok
python3-3.10p2:libffi-3.4.4: ok
python3-3.10p2:bzip2-1.0.8p0: ok
python3-3.10p2:python-3.10.13: ok
python3-3.10p2: ok
show packages
did you ever heared of Jetporch, short Jet ? Don’t worry, you’re not the only one ;) Jet Project of Jet is being led by Michael DeHaan, the original creator of Ansible. So, expect something like Ansible, faster, written in rust … same same, but different.
grab a fresh machine and patch it
export DEBIAN_FRONTEND=noninteractive
apt-get clean
apt-get autoclean
apt-get update -y
apt-get upgrade -yq
apt-get dist-upgrade -yq
apt-get autoremove -y
jet needs rustc 1.64. Debian install 1.63 from packages :(
cd /some/path/you/want
poetry new mypackage
poetry add requests
cat << 'EOF' > mypackage/__init__.py
print("importing", __name__)
EOF
cat << 'EOF' > mypackage/main.py
print("importing", __name__)
def test1():
print("test1")
def test2(name: str):
print("hello", name)
def test3(name: str, age:int):
print(f"Hello {name} at age {age}")
if __name__ == "__main__":
print("This is a Library or Package. You should import it into your Code and not run it directly ...")
EOF
poetry build
(mypackage-py3.11) stoege@host:~/git/demo/mypackage> tree
.
├── README.md
├── dist
│ ├── mypackage-0.1.0-py3-none-any.whl
│ └── mypackage-0.1.0.tar.gz
├── mypackage
│ ├── __init__.py
│ └── main.py
├── poetry.lock
├── pyproject.toml
└── tests
└── __init__.py
4 directories, 8 files
you have a package called “mypackage-0.1.0” created. As ’tar.gz and ‘.whl’ File
cat <<'EOF'> layouts/shortcodes/table.html
{{ $htmlTable := .Inner | markdownify }} {{ $class := .Get 0 }} {{ $old := "<table>" }}
{{ $new := printf "<table class=\"%s\">" $class }} {{ $htmlTable :=
replace $htmlTable $old $new }} {{ $htmlTable | safeHTML }}
</table>
EOF
add this to your Markdown File …
| a | b | c |
| - | - | - |
| bli | bla | blu |
| green | blue | red |
a | b | c |
---|---|---|
bli | bla | blu |
green | blue | red |
| a | b | c |
| :- | :- | :- |
| bli | bla | blu |
| green | blue | red |
a | b | c |
---|---|---|
bli | bla | blu |
green | blue | red |
| a | b | c |
| -: | -: | -: |
| bli | bla | blu |
| green | blue | red |
a | b | c |
---|---|---|
bli | bla | blu |
green | blue | red |
sha256: b0f3682d811304f9d60e0eb42ce92d7f28de15d6dbc0a9c35d1ce7937b442a60
let’s assume you’re behing a Corp Proxy which enforce TLS Inspection, you don’t have the Proxy Cert and you want to Upgrade your Boxes …
… and of course, you do this in the LAB and for Research only and not your Productiv Environment!
apt-get upate
W: Failed to fetch https://packages.sury.org/php/dists/bookworm/InRelease Certificate verification failed: The certificate is NOT trusted.
The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: xx.xx.xx.xx yyyy]
touch /etc/apt/apt.conf.d/99verify-peer.conf
echo >>/etc/apt/apt.conf.d/99verify-peer.conf "Acquire { https::Verify-Peer false }"
apt-get update
apt-get upgrade
sha256: 40c39ed441b4690a8644cd63bfd2e6987f06a70c4f922eca14de5dcc27d4fb35
Small Example how to Store Data in JSON, and Query them afterwards like a NOSQL DB. Have a look at TinyDB if you wanna see more.
from tinydb import TinyDB, Query
from pprint import pprint
# Create or load a database file
db = TinyDB('db.json')
# insert some sample data
def insert():
# Insert data
db.insert({'name': 'John', 'age': 30})
db.insert({'name': 'Alice', 'age': 25, 'hobbies': 'sleep'})
db.insert({'name': 'Max', 'age': 20, 'hobbies': ['sleep', 'play', 'eat']})
# show all entries
def show_all():
all_records = db.all()
pprint(all_records)
# entries with hobbies
def show_entries_with_hobbies():
User = Query()
result = db.search(User.hobbies.exists())
pprint(result)
# entries without hobbies
def show_entries_without_hobbies():
User = Query()
result = db.search(~User.hobbies.exists())
pprint(result)
# show entries with hobbies and older than 22 years
def show_entries_with_hobbies_and_older_than_22():
User = Query()
result = db.search((User.hobbies.exists()) & (User.age > 22))
pprint(result)
if __name__ == "__main__":
# Add
insert()
# show
print("\n-- ALL --")
show_all()
print("\n-- with Hobbies --")
show_entries_with_hobbies()
print("\n-- without Hobbies --")
show_entries_without_hobbies()
print("\n-- with Hobbies and older than 22 --")
show_entries_with_hobbies_and_older_than_22()
you need to install tinydb. use a virtual env like .venv, poetry or whatever you like
gave a try with a FastAPI Template, https://github.com/rochacbruno/fastapi-project-template.git
clone the repo
git clone https://github.com/rochacbruno/fastapi-project-template.git gugus1234
cd gugus1234
i’d like to have poetry as virtual env manager
make switch-to-poetry
had to rename some string in pyproject and different files …
mv project_name gugug1234
gsed -i 's/a-flask-test/gugus1234/' pyproject.toml
gsed -i 's/project_name/gugus1234/' pyproject.toml
gsed -i 's/project_name/gugus1234/g' gugus1234/cli.py gugus1234/app.py gugus1234/config.py gugus1234/security.py
poetry shell
poetry lock
poetry install
let’s create admin user