Skip to content

Instantly share code, notes, and snippets.

View anon987654321's full-sized avatar

anon987654321

View GitHub Profile
@anon987654321
anon987654321 / 1 - Intro.md
Last active May 31, 2020 11:10
OpenBSD man pages

Alternative restructuring to OpenBSD man pages

Brought to you by Boyz II Man:

Problem

Many newcomers to the OpenBSD project find the man pages hard to follow, and often report they had to resort to 3rd party books instead, in which they learned almost immediately due to their tendency to have a simple, non-technical language.

#!/usr/bin/env zsh
#
# LISTS DIRECTORIES AND FILES
#
# tree [-a]
#
# -a Include files
#
setopt nullglob
#!/usr/bin/env zsh
#
# CLEANS UP TEXT FILES
#
# Dependency check
function die {
print >&2 "$@"
exit 1
}

/etc/rc.d/coolest_app_ever

Commandline works fine:

# doas -u apps sh -c 'cd /home/apps/coolest_app_ever ; /home/apps/.gem/bin/bundle exec
    /home/apps/.gem/bin/pumactl --config-file /home/apps/coolest_app_ever/config/puma.rb start'
Puma starting in single mode...
* Version 4.3.3 (ruby 2.6.6-p146), codename: Mysterious Traveller
* Min threads: 0, max threads: 16
* Environment: production
#!/usr/bin/env zsh
#
# 11038420120702 BACKS UP IMPORTANT FOLDERS
#
# Requires: md5deep64
#
# backup [-t]
#
# -t Simulate backup

Custom CSPs for different hosts

http protocol "https_reverse_proxy" {
  [...]

  # CSPs to help reduce the risk of Cross-Site Scripting
  # https://content-security-policy.com/

  # Hosts that require custom CSPs
  match request header "Host" value "myapp1.com" tag "myapp1"

Relayd feature request

#!/usr/bin/env zsh
#
# REPLACES STRINGS IN TEXT-BASED FILES
#
# replace <old string> <new string>
#
setopt extendedglob
# Dependency check
Script started on Mon Sep 14 23:09:12 2020
dev@dev:~/mystore% rails generate spree:install
[Spree WARNING] Missing migrations.
[Spree WARNING] add_amount_remaining_to_store_credit_events from spree is missing.
[Spree WARNING] add_available_locales_to_stores from spree is missing.
[Spree WARNING] add_available_to_columns_and_remove_display_on_from_payment_methods from spree is missing.
[Spree WARNING] add_available_to_users_and_remove_display_on_from_shipping_methods from spree is missing.
[Spree WARNING] add_index_to_spree_payments_number from spree is missing.
[Spree WARNING] add_join_characters_to_promotion_code_batch from spree is missing.
[Spree WARNING] add_lft_and_rgt_indexes_to_taxons from spree is missing.

Installing Solidus 2.10 on a fresh Rails app

  • Rails 6.0.3.3
  • Ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-openbsd]
  • sqlite3 3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
dev@dev:~/mystore% rails generate spree:install
Running via Spring preloader in process 53310
      create  config/initializers/spree.rb