Skip to content

Instantly share code, notes, and snippets.

@DrTom
DrTom / mac_os_upgrade.md
Last active October 30, 2023 10:31
Migrate or Upgrade MacPorts etc after Mac OS Upgrade

Upgrade Mac OS and all related Development Tools

In short: reinsall everything which has been compiled in or linked against libraries the old system.

Upgrade Mac OS

  1. Upgrade OS
  2. Install or Upgrade XCode
@DrTom
DrTom / madek-api-hfg-meeting.md
Last active December 6, 2022 09:02
Madek API HfG
sudo port install ruby-build
ruby-build 2.7.2 ~/.rubies/ruby-2.7.2

New Audits for leihs

Problems "Existing Audits"

  • based on Model lifecycle methods, aka Hooks, in leihs legacy
    • works only in leihs legacy
    • works only when using certain methods of the models
  • reliability questionable
@DrTom
DrTom / dev_talk_fake_tables.md
Last active September 23, 2020 09:00
Fake it till you make it

Fake it till you make it - Extend functionality of your legacy application with fake tables

Concrete example: leihs legacy knows about roles for users. We would like to extend this to include roles for groups. But we can not change code of leihs legacy. Solution: we add new functionality but make leihs legacy belive the DB schema has not changed.

Principle Idea

  1. Add new tables for new functionality, i.e. group_roles
  2. Rename existing table, i.e. user_roles to direct_user_roles.
  3. Create a view user_roles with custom AGGREGATEs using direct_user_roles and group_roles.
  4. Optinally: make the views, i.e. `user_roles`` writable with triggers.
@DrTom
DrTom / MacPort PostgreSQL setup.md
Last active December 28, 2023 09:35
MacPort PostgreSQL setup

PostgreSQL Server Setup on Mac OS with MacPorts

export VERSION=15

Install

port info postgresql${VERSION}-server
port install postgresql${VERSION}-server

Ubuntu 18.04

ruby-install ruby 2.3.8 
apt-get install libssl1.0-dev
ruby-install --no-install-deps ruby 2.3.8
gem install bundler -v 1.3

Mac OS

ruby-install ruby 2.2.10 -- --with-openssl-lib=/opt/local/lib/openssl-1.0 --with-openssl-include=/opt/local/include/openssl-1.0

@DrTom
DrTom / TimeMachine Backups on NAS.md
Last active December 18, 2022 01:05
TimeMachine Backups to my Homegrown SBM BTRFs Raid1 Ubuntu NAS

TimeMachine Backups to my Homegrown Samba BTRFs Raid1 Ubuntu NAS

  • works pretty much like the original TimeCapsule
  • perfoms auto backups whenever I am in the lokal network (VPN not tested)
  • no need to mount a SMB share or something (mount point is not shown in Finder)

Samba Config

class TimestampsWithTimeZone < ActiveRecord::Migration
def change
res = execute <<-SQL.strip_heredoc
SELECT table_name from INFORMATION_SCHEMA.views WHERE table_schema = ANY (current_schemas(false));
SQL
view_names = res.to_a.map(&:first).map(&:to_a).map(&:second)

Keybase proof

I hereby claim:

  • I am DrTom on github.
  • I am drtom (https://keybase.io/drtom) on keybase.
  • I have a public key whose fingerprint is D180 BE89 E69F 6399 711D 1590 E293 459C B10B 0442

To claim this, I am signing this object: