Self-hosting LanguageTool

Summary LanguageTool is a free online proofreading service for English, Spanish, and 20 other languages. Instantly check your text for grammar and style mistakes. It’s a free alternative to similar sites/services like Grammarly. While I’m not sure that Grammarly is a Privacy Nightmare, I don’t like the idea of sending everything I write to a third party service for inspection. The free version of LanguageTool has a much better reputation, although that may be because it’s less well-known. It’s also nice that it’s an open-source project that publishes the code. ...

August 31, 2022 · Chuck

Hardening SSH

Summary It’s about time I get a standard sshd_config file that doesn’t rely on sane defaults. Disabling Password-based Authentication You should disable password-based authentication altogether. Make sure to only do this once you have verified that you can log in with an account that can escalate to root - or that you have an alternate way of getting back onto your machine. To lock down your server, edit your /etc/sshd/sshd_config and set the following options: ...

August 15, 2022 · Chuck

Beets Config

If you don’t know already, beets is a command line python program meant to automatically sort music. If you do know already, how have you set up your config file? Here’s mine: directory: /mnt/chawley/Music library: /home/chawley/musiclibrary.blb import: # write metadata to music files write: yes # move imported files from source to the music directory move: yes copy: no delete: no # use auto-tagging where possible # do not require confirmation on strong matches autotag: yes timid: no resume: ask incremental: no none_rec_action: ask log: quiet: no # enable with command line option quiet_fallback: skip default_action: apply singletons: no languages: [] detail: no flat: no # use the release-date of the original (first) release of an album? original_date: yes # on multi-disk releases, assign track numbers for the whole album. # If "per disk", make sure tracknames do not collide ("paths" setting). per_disc_numbering: no # files matching these patterns are deleted from source after import clutter: ["Thumbs.DB", ".DS_Store", "*.m3u", ".pls", "*.jpg"] # files/directories matching one of these patterns are ignored during import ignore: [".*", "*~", "System Volume Information"] # Paths ---------------------------------------------------------------------- # Paths and filenames for music files # relative to music directory paths: default: $albumartist - $year - $album/$albumartist - $track - $title singleton: Non-Album/$artist - $title comp: $album ($year)/$track - $artist - $title # replace special characters in generated filenames replace: '[\\/]': _ '^\.': _ '[\x00-\x1f]': _ '[<>:"\?\*\|]': _ '\.$': _ '\s+$': '' path_sep_replace: _ # filename for the album art art_filename: cover # results in "cover.jpg" max_filename_length: 0 # unlimited # General -------------------------------------------------------------------- # use mutliple threads during import threaded: yes timeout: 5.0 verbose: no # User Interface ------------------------------------------------------------- color: yes list_format_item: %upper{$artist} - $album - $track. $title list_format_album: %upper{$albumartist} - $album time_format: '%Y-%m-%d %H:%M:%S' terminal_encoding: utf8 ui: terminal_width: 80 length_diff_thresh: 10.0 # Auto Tagger ---------------------------------------------------------------- match: strong_rec_thresh: 0.1 # match 90% or better for auto import medium_rec_thresh: 0.25 rec_gap_thresh: 0.25 max_rec: missing_tracks: medium unmatched_tracks: medium distance_weights: source: 2.0 artist: 3.0 album: 3.0 media: 1.0 mediums: 1.0 year: 1.0 country: 0.5 label: 0.5 catalognum: 0.5 albumdisambig: 0.5 album_id: 5.0 tracks: 2.0 missing_tracks: 0.9 unmatched_tracks: 0.6 track_title: 3.0 track_artist: 2.0 track_index: 1.0 track_length: 2.0 track_id: 5.0 preferred: countries: [] media: [] original_year: no ignored: [] track_length_grace: 10 track_length_max: 30 Save it in $HOME/.config/beets/config.yaml ...

August 14, 2022 · Chuck

Uncomplicated Firewall / Docker Workaround

To get UFW to work well with Docker, you have to add some rules to the bottom of /etc/ufw/after.rules # BEGIN UFW AND DOCKER *filter :ufw-user-forward - [0:0] :ufw-docker-logging-deny - [0:0] :DOCKER-USER - [0:0] -A DOCKER-USER -j ufw-user-forward -A DOCKER-USER -j RETURN -s 10.0.0.0/8 -A DOCKER-USER -j RETURN -s 172.16.0.0/12 -A DOCKER-USER -j RETURN -s 192.168.0.0/16 -A DOCKER-USER -p udp -m udp --sport 53 --dport 1024:65535 -j RETURN -A DOCKER-USER -j ufw-docker-logging-deny -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -d 192.168.0.0/16 -A DOCKER-USER -j ufw-docker-logging-deny -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -d 10.0.0.0/8 -A DOCKER-USER -j ufw-docker-logging-deny -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -d 172.16.0.0/12 -A DOCKER-USER -j ufw-docker-logging-deny -p udp -m udp --dport 0:32767 -d 192.168.0.0/16 -A DOCKER-USER -j ufw-docker-logging-deny -p udp -m udp --dport 0:32767 -d 10.0.0.0/8 -A DOCKER-USER -j ufw-docker-logging-deny -p udp -m udp --dport 0:32767 -d 172.16.0.0/12 -A DOCKER-USER -j RETURN -A ufw-docker-logging-deny -m limit --limit 3/min --limit-burst 10 -j LOG --log-prefix "[UFW DOCKER BLOCK] " -A ufw-docker-logging-deny -j DROP COMMIT Adding Rules Then you can add rules. Always add rules with comments. Examples below: ...

August 10, 2022 · Chuck

Linux Terminal Emulators: KiTTY over PuTTY

Summary Do you work on Linux machines? Do you only have a Windows machine from which to connect? Then you’re probably already using PuTTY. Well, step aside PuTTY, there’s a new terminal client in town. KiTTY is a fork of the original PuTTY software, with loads of new features, including a portable version that saves all of your sessions and settings into an INI file in the same folder. Installation Download KiTTY Portable ??? PROFIT! Just kidding. There are no other steps. The download is an exe that’s ready to go. Just double-click on it and enter your connection parameters (should be familiar if you’ve ever used PuTTY) ...

July 28, 2022 · Chuck

Fun with wget

wget multiple files wget -r -l1 -A.mp3 http://aaa.com/directory In the above example, -r and -l1 options together enable 1-level deep recursive retrieval, and -A option specifies lists of file name suffixes to accept during recursive download (.mp3 in this case). ways to wget entire webpage This one works so well, I’ve created an alias for it: wgetMirror='/usr/bin/wget -o wget.log -mkEpnp –wait=9 –user-agent='\''Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'\'' –no-check-certificate' Other options: wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains example.com --no-parent <url> Modify User Agent $ wget -U "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" <url> wget from webdav with authentication wget --http-user=user-id --http-password=password <URL> Reference Download Multiple Files with wget Archiving website with wget Download entire webpage with wget Change the User Agent in wget

February 7, 2022 · Chuck

Doctor Docker (or "How I Learned to Stop Worrying and Tolerate the Container")

Backstory: I’ve been either paying for or using 3rd part apps for Read-It-Later (Pocket), Hosted Bookmarks (Raindrop.io) and an RSS Feedreader (Inoreader) for about a year. In the interest of 1) teaching myself Docker and 2) decoupling from hosted solutions I have finally replaced all three of the above apps with docker containers. I am using Portainer to manage my docker nodes (I have two) and containers. I recommend learning at least the basics on how to build and modify containers via the command line before using a GUI tool to manage them, but Portainer came highly recommended and abstracts a lot of the drudgery into simple point and clicks. ...

November 24, 2021 · Chuck

VS Code for Markdown Notes

My long, winding path to Markdown notes nirvana For years I’ve been looking for a cross-platform markdown editor. There are several good ones out there, but several are not free or they’ve got built-in workflows that I would need to either adapt or fight against. For the last several years my notes have consisted of a single directory of markdown files. I sync these files to various machines with Nextcloud. What I wanted was a way to manage them and perhaps link amongst them, almost like a wiki, which I used previously, but again found myself fighting with different implementations of Markdown and note portability. ...

October 18, 2021 · Chuck

Get off my (digital) lawn

The year was 1994. I was working apartment maintenance and had a healthy interest in computers. I also had a IBM XT knockoff in my apartment connected to a 56K modem. One of the benefits of apartment maintenance is the lost and found that occurs when people move out quickly. Things of value usually get stored in case the owner comes back for them. But certain items become the property of the maintenance staff. ...

December 18, 2020 · Chuck

Ohio Linuxfest 2020 - Nov 06-07 2020 (Virtual)

Friday 2020-11-06 Day One YouTube Stream 11:30 – Warner and Beth Lynn Welcome 12:00 – Baremetal RISC-V Renode – Zak Kohler 12:45 – One Sprint to Drastically Improve Web Accessibility – Robin Clower 13:30 – Delta Ansible: Keeping up with Changes and Deprecations – Andrew Cziryak 14:15 – SSH Tunnels and More – Der Hans https://overthewire.org/wargames/bandit/ https://overthewire.org/wargames/bandit/ 15:00 – FSF Campaigns – Zoë Kooyman, Program Manager; Greg Farough, Campaigns Manager [[OLF2020 - FSF.pdf|Slide Deck]] [[OLF2020 - FSF.pdf|Slide Deck]] 16:00 – UN Sustainable Goals – Dorothy Gordon 16:30 – Exploring trade-offs in S3 file systems – Andrew Gaul 17:15 – We Don’t Compete on Security – Andrew J Krug and Nathan Case 18:00 – Nixie Pixel and CS Geek on the Geek Beacon Community Saturday 2020-11-07 Day Two Youtube Stream ...

November 7, 2020 · Chuck