Leon Stafford (NEW TABS) http://leonstafford.gitlab.io/ Thu, 25 Apr 2019 19:00:25 +0000 en-US hourly 1 https://www.classicpress.net/?v=4.9.10-cp-1.0.1 OpenBSD, httpd & WordPress: Making it work https://leonstafford.gitlab.io/openbsd-httpd-wordpress-making-it-work/ Thu, 25 Apr 2019 18:34:22 +0000 https://leonstafford.gitlab.io/?p=501 Continue reading "OpenBSD, httpd & WordPress: Making it work"

]]>
In OpenBSD fashion, this is not going to be a copy-pasta recipe for installing WordPress on OpenBSD and having no idea how you got there. Instead, it aims to be a self-help guide, addressing the common gotchas you are likely to encounter.

We won’t go through the stuff that works easily (acme-client(1), package installation, etc). You already know where to find that info!

Here are the issues you may encounter that are not so intuitive.

I look forward to suggestions/corrections to any fallacies I’m spreading!

Rewrite rules

Using links like index.php?p=1 or sticking everything under /posts/ are not viable permalink solutions. c’mon, this isn’t the Arch linux wiki!

Unfortunately, there seems to be an issue (still present as of 6.5), that prevent at least one needed CGI variable to be passed from httpd.

Luckily the fix from Tim Baumgard still works on -current: https://github.com/tbaumgard/openbsd-httpd-rewrite

You may also need to fiddle with your location and match directives, so that wp-admin gets rewritten to wp-admin/index.php  and that the php files are passed to the fastcgi socket.

Keep an eye on your rewrites between upgrades and know where to look when they stop working.

Static files

Where Nginx will detect and serve static files, you will likely need to stop httpd sending them all to PHP.  location match directives for CSS, image types, fonts, etc telling them not to be rewritten is my solution, but produces unwieldly  httpd.conf files.

Symlinks

If you’re developing a theme/plugin and need to symlink it to various sites, ensure it’s accessible within www’s chroot and link to it relatively. ie, there is probably no /home/bobina/myplugin/ within your /var/www/ dir.

Connection timeouts

If working on multiple sites, you’ll likely be including them from the main httpd.conf file. What you may not realise is that the default timeout settings, even if not present in the main conf file, are not able to be overridden in the included confs.

Database connections

Use an IP vs localhost or a socket to make life easier.

More chroot

Don’t forget that your website knows nothing outside of it’s chroot (even if PHP-FPM still does). So hosts and resolv.conf are likely needed to be copied to your chroot, easy to forget after updating/switching network configs.

WP-CLI

Much easier than in sudo land, allow your user to run WP-CLI as www. For DB touching commands, it’s less of a concern, but when you action filesystem changes as a non-web user, you can face unexpected permissions issues.

 

]]>
Huawei E3372 USB 3G/4G modem under OpenBSD 6.4 https://leonstafford.gitlab.io/huawei-e3372-usb-3g-4g-modem-under-openbsd-6-4/ Thu, 13 Dec 2018 15:54:59 +0000 https://leonstafford.gitlab.io/?p=458 Continue reading "Huawei E3372 USB 3G/4G modem under OpenBSD 6.4"

]]>
Notes on getting connected to 3G/4G in Thailand on the dtac prepaid SIM

obsd# gammu identify
Device               : /dev/cuaU0
Manufacturer         : Huawei
Model                : E3372 (E3372)
Firmware             : 22.329.63.00.74
IMEI                 : 866785033700732
SIM IMSI             : 520050314388175

Example smsd.conf

loglevel = 7

user = _smsd

pidfile = /var/run/smsd/smsd.pid
infofile = /var/run/smsd/smsd.info

logfile = /var/log/smsd/smsd.log

[GSM1]
device = /dev/cuaU0

init = AT^CURC=0

# For this one I have set incoming=no so it doesn't pull
# the existing messages off the phone.
incoming = no
rtscts = no
baudrate = 115200
eventhandler = /home/leon/smstoolsevents.sh
send_delay = 20

And a simple script to log events /home/leon/smstoolsevents.sh



#!/bin/ksh

# script to react to events, like receiving an SMS

echo '' >> /home/leon/logsmsevents
echo 'received a message' >> /home/leon/logsmsevents


smsd log with above settings gives the following when smsd is restarted:

2018-12-13 12:24:38,6, GSM1: Modem is registered to a roaming partner network                                                                                                             [79/2614]
2018-12-13 12:24:38,2, smsd: Smsd mainprocess is awaiting the termination of all modem handlers. PID: 830.                                                                                        
2018-12-13 12:24:38,2, GSM1: Modem handler 0 terminated. PID: 61548, was started 18-12-13 12:15:24, up 9 min.                                                                                     
2018-12-13 12:24:38,2, smsd: Smsd mainprocess terminated. PID: 830, was started 18-12-13 12:15:24, up 9 min.                                                                                      
2018-12-13 12:24:38,2, smsd: Smsd v3.1.21 started.
2018-12-13 12:24:38,2, smsd: Running as _smsd:_smsd (590:590).
2018-12-13 12:24:38,7, smsd: Running startup_check (shell): /var/spool/sms/incoming/smsd_script.FZMA0a /tmp/smsd_data.sP5YHd                                                                      
2018-12-13 12:24:38,7, smsd: Done: startup_check (shell), execution time 0 sec., status: 0 (0)
2018-12-13 12:24:38,4, smsd: File mode creation mask: 022 (0644, rw-r--r--).
2018-12-13 12:24:38,5, GSM1: Modem handler 0 has started. PID: 50667.
2018-12-13 12:24:38,5, GSM1: Using check_memory_method 1: CPMS is used.
2018-12-13 12:24:38,5, smsd: Outgoing file checker has started. PID: 80713.
2018-12-13 12:24:38,7, smsd: All PID's: 80713,50667
2018-12-13 12:24:38,6, GSM1: Checking device for incoming SMS
2018-12-13 12:24:38,6, GSM1: Checking if modem is ready
2018-12-13 12:24:39,7, GSM1: -> AT
2018-12-13 12:24:39,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:39,7, GSM1: <- OK
2018-12-13 12:24:39,6, GSM1: Pre-initializing modem
2018-12-13 12:24:39,7, GSM1: -> ATE0
2018-12-13 12:24:39,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:39,7, GSM1: <- OK                                                                                                                                                                
2018-12-13 12:24:39,7, GSM1: -> AT+CMEE=1;+CREG=2
2018-12-13 12:24:40,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:40,7, GSM1: <- OK
2018-12-13 12:24:40,6, GSM1: Checking if modem needs PIN
2018-12-13 12:24:40,7, GSM1: -> AT+CPIN?
2018-12-13 12:24:40,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:40,7, GSM1: <- +CPIN: READY OK
2018-12-13 12:24:40,6, GSM1: Initializing modem
2018-12-13 12:24:40,7, GSM1: -> AT^CURC=0
2018-12-13 12:24:41,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:41,7, GSM1: <- OK
2018-12-13 12:24:41,7, GSM1: -> AT+CSQ
2018-12-13 12:24:41,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:41,7, GSM1: <- +CSQ: 22,99 OK
2018-12-13 12:24:41,6, GSM1: Signal Strength Indicator: (22,99) -69 dBm (Excellent), Bit Error Rate: not known or not detectable                                                                  
2018-12-13 12:24:41,6, GSM1: Checking if Modem is registered to the network
2018-12-13 12:24:41,7, GSM1: -> AT+CREG?
2018-12-13 12:24:42,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:42,7, GSM1: <- +CREG: 2,5,"792D","04947221" OK
2018-12-13 12:24:42,6, GSM1: Modem is registered to a roaming partner network
2018-12-13 12:24:42,6, GSM1: Location area code: 792D, Cell ID: 7221
2018-12-13 12:24:42,7, GSM1: -> AT+CSQ
2018-12-13 12:24:42,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:42,7, GSM1: <- +CSQ: 21,99 OK
2018-12-13 12:24:42,6, GSM1: Signal Strength Indicator: (21,99) -71 dBm (Excellent), Bit Error Rate: not known or not detectable                                                                  
2018-12-13 12:24:42,6, GSM1: Selecting PDU mode
2018-12-13 12:24:42,7, GSM1: -> AT+CMGF=0
2018-12-13 12:24:42,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:42,7, GSM1: <- OK
2018-12-13 12:24:43,7, GSM1: -> AT+CGSN
2018-12-13 12:24:43,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:43,7, GSM1: <- 866785033700732 OK                                                                                                                                        [26/2614]
2018-12-13 12:24:43,5, GSM1: IMEI: 866785033700732
2018-12-13 12:24:43,7, GSM1: -> AT+CIMI
2018-12-13 12:24:43,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:43,7, GSM1: <- 520050314388175 OK
2018-12-13 12:24:43,5, GSM1: IMSI: 520050314388175
2018-12-13 12:24:43,6, GSM1: Checking if reading of messages is supported
2018-12-13 12:24:43,7, GSM1: -> AT+CPMS?
2018-12-13 12:24:44,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:44,7, GSM1: <- +CPMS: "ME",0,20,"ME",0,20,"ME",0,20 OK
2018-12-13 12:24:44,6, GSM1: Checking memory size
2018-12-13 12:24:44,7, GSM1: -> AT+CPMS?
2018-12-13 12:24:44,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:44,7, GSM1: <- +CPMS: "ME",0,20,"ME",0,20,"ME",0,20 OK
2018-12-13 12:24:44,6, GSM1: Used memory is 0 of 20
2018-12-13 12:24:44,6, GSM1: No SMS received
2018-12-13 12:24:54,6, GSM1: Checking device for incoming SMS
2018-12-13 12:24:54,6, GSM1: Checking if modem is ready
2018-12-13 12:24:54,7, GSM1: -> AT
2018-12-13 12:24:55,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:55,7, GSM1: <- OK
2018-12-13 12:24:55,6, GSM1: Pre-initializing modem
2018-12-13 12:24:55,7, GSM1: -> ATE0
2018-12-13 12:24:55,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:55,7, GSM1: <- OK
2018-12-13 12:24:55,7, GSM1: -> AT+CMEE=1;+CREG=2
2018-12-13 12:24:56,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:56,7, GSM1: <- OK
2018-12-13 12:24:56,6, GSM1: Initializing modem
2018-12-13 12:24:56,7, GSM1: -> AT^CURC=0
2018-12-13 12:24:56,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:56,7, GSM1: <- OK
2018-12-13 12:24:56,7, GSM1: -> AT+CSQ
2018-12-13 12:24:57,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:57,7, GSM1: <- +CSQ: 21,99 OK
2018-12-13 12:24:57,6, GSM1: Signal Strength Indicator: (21,99) -71 dBm (Excellent), Bit Error Rate: not known or not detectable                                                                  
2018-12-13 12:24:57,6, GSM1: Checking if Modem is registered to the network
2018-12-13 12:24:57,7, GSM1: -> AT+CREG?
2018-12-13 12:24:57,7, GSM1: Command is sent, waiting for the answer. (10)
2018-12-13 12:24:57,7, GSM1: <- +CREG: 2,5,"792D","04947221" OK
2018-12-13 12:24:57,6, GSM1: Modem is registered to a roaming partner network
2018-12-13 12:24:57,6, GSM1: Selecting PDU mode
2018-12-13 12:24:57,7, GSM1: -> AT+CMGF=0
2018-12-13 12:24:57,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:57,7, GSM1: <- OK
2018-12-13 12:24:57,6, GSM1: Checking memory size
2018-12-13 12:24:58,7, GSM1: -> AT+CPMS?
2018-12-13 12:24:58,7, GSM1: Command is sent, waiting for the answer. (5)
2018-12-13 12:24:58,7, GSM1: <- +CPMS: "ME",0,20,"ME",0,20,"ME",0,20 OK
2018-12-13 12:24:58,6, GSM1: Used memory is 0 of 20
2018-12-13 12:24:58,6, GSM1: No SMS received

and continues to poll

Now, we need to set up pppd. Assuming that no received activation SMS is due to not registering on the data network yet, so leaving smsd running and will attempt the ppd setup

Much talk is had about HiLink mode vs Stick mode.

I decided to figure out what mine was being detected as:

obsd# usbdevs
Controller /dev/usb0:
addr 01: 8086:0000 Intel, xHCI root hub
addr 02: 12d1:1442 HUAWEI_MOBILE, HUAWEI_MOBILE
addr 03: 05ac:12aa Apple Inc., iPod
Controller /dev/usb1:
addr 01: 8086:0000 Intel, EHCI root hub
addr 02: 8087:8000 Intel, Rate Matching Hub
addr 03: 04f3:012d ELAN, Touchscreen
addr 04: 04ca:7036 SC20A38485AA4C8E3D, Integrated Camera

Based on the above, it looks like we’re already operating in Stick mode, with 12d1:1442, else assuming the support in umsm in OpenBSD for this device is handling the USB modeswitching automagically…

Setting up the pppd stuff

I have

/etc/ppp/peers/e3372:

cuaU0
115200
debug
noauth
nocrtscts
:10.254.254.1
ipcp-accept-remote
defaultroute
user isp@cingulargprs.com
demand
active-filter 'not udp port 123'
persist
idle 600
connect "/usr/sbin/chat -v -f /etc/ppp/dtac-chat"

/etc/ppp/dtac-chat:

TIMEOUT 10
REPORT CONNECT
ABORT BUSY
ABORT 'NO CARRIER'
ABORT ERROR
'' ATZ OK AT&F OK
AT+CGDCONT=1,"IP","www.dtac.co.th" OK
ATD*99***1# CONNECT

/etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
isp@cingulargprs.com    *       CINGULAR1

Finally, run

ifconfig ppp0 create (should be showing in ifconfig now) and then

pppd e3372 call

This doesn’t give me much, so I tail /var/log/daemon, resulting in:

Dec 13 13:09:29 obsd pppd[80914]: pppd 2.3.5 started by leon, uid 0
Dec 13 13:09:29 obsd pppd[80914]: ioctl(TIOCSETD): Device not configured

A clue, when I try to manually talk to the modem, cu -s 115200 -l cuaU0, I get device is busy. So I stop the smsd daemon and try again:

This time, it connects, but nothing is given back…whereas previously, I think I was able to type commands over the serial connection…

To isolate the cause, I duplicated the peers/e3372 file with another with just these lines

/etc/ppp/peers/dummytest

cuaU0
115200
debug

which got me one more line in the output:

Dec 13 13:40:24 obsd pppd[46299]: pppd 2.3.5 started by leon, uid 0
Dec 13 13:40:27 obsd pppd[46299]: Serial connection established.
Dec 13 13:40:28 obsd pppd[46299]: ioctl(TIOCSETD): Device not configured

I’m also seeing the device being disconnected at hangup and then re-detected:

Dec 13 13:40:32 obsd /bsd: ucom0 detached
Dec 13 13:40:32 obsd /bsd: umsm0 detached
Dec 13 13:40:32 obsd /bsd: umsm1 detached
Dec 13 13:40:39 obsd /bsd: umsm0 at uhub0 port 2 configuration 1 interface 0 "HUAWEI_MOBILE HUAWEI_MOBILE" rev 2.10/1.02 addr 2                                                                   
Dec 13 13:40:39 obsd /bsd: umsm0 detached
Dec 13 13:40:39 obsd /bsd: umsm0 at uhub0 port 2 configuration 1 interface 0 "HUAWEI_MOBILE HUAWEI_MOBILE" rev 2.10/1.02 addr 2                                                                   
Dec 13 13:40:39 obsd /bsd: ucom0 at umsm0
Dec 13 13:40:39 obsd /bsd: umsm1 at uhub0 port 2 configuration 1 interface 1 "HUAWEI_MOBILE HUAWEI_MOBILE" rev 2.10/1.02 addr 2

So will continue adjusting that file or the ones it links to and see if we get any more output…

Trying cu again, allowed some commands to come back from the modem, but no input was accepted:

obsd# cu -s 115200 -l cuaU0
Connected to /dev/cuaU0 (speed 115200)

^RSSI:20

^HCSQ:"LTE",48,35,86,14

^RSSI:1

^HCSQ:"LTE",11,0,96,0

+CGREG: 5,"792D","04947221"

+CREG: 5,"792D","04947221"

^RSSI:20

^HCSQ:"LTE",48,37,91,18

^RSSI:20

^HCSQ:"LTE",48,36,91,16

^RSSI:21

^HCSQ:"LTE",50,36,86,14

....


^HCSQ:"LTE",54,41,111,16

^RSSI:1

^HCSQ:"LTE",11,0,106,0

+CGREG: 5,"007C","00B19502"

+CREG: 5,"007C","00B19502"

^RSSI:25

^HCSQ:"LTE",58,47,116,14

+CGREG: 1,"007C","00B19502"

+CREG: 1,"007C","00B19502"

^XLEMA:1,2,112,0,1,fff

^XLEMA:2,2,911,0,1,fff

^NWTIME:18/12/13,06:20:04+28,00


^EONS:0

+CGREG: 1,"792D","04947220"

+CREG: 1,"792D","04947220"

^RSSI:20

^HCSQ:"LTE",48,39,71,22

+CGREG: 5,"792D","04947220"

+CREG: 5,"792D","04947220"

^XLEMA:1,2,112,0,1,fff

^XLEMA:2,2,911,0,1,fff

^NWTIME:18/12/13,06:20:08+28,00


^EONS:0

This would appear that it’s getting real messages from the network.

About to reboot, then try under Ubuntu live CD. Then try to get to the bottom of the

ioctl(TIOCSETD): Device not configured

Looking at https://gist.github.com/artizirk/20acc2ab07fe6cad9fcc

Will install socat and try sending some AT commands to get a better picture

socat - /dev/cuaU0

ATI
Manufacturer: huawei

Model: E3372

Revision: 22.329.63.00.74

IMEI: 866785033700732

+GCAP: +CGSM,+DS,+ES



OK

AT + CSQ


+CSQ: 20,99
# signal strength (over 19 is excellent)



AT ^ CARDLOCK?


^CARDLOCK: 2,10,0

# shows modem is enabled

AT ^ FHVER


^FHVER:"E3372H-607 22.329.63.00.74,CL2E3372HM Ver.A"

AT ^ VERSION?


^VERSION:BDT:Apr 08 2018, 12:13:47

^VERSION:EXTS:22.329.63.00.74

^VERSION:INTS:

^VERSION:EXTD:WEBUI_17.100.20.02.74_HILINK

^VERSION:INTD:

^VERSION:EXTH:CL2E3372HM Ver.A

^VERSION:INTH:

^VERSION:EXTU:E3372

^VERSION:INTU:

^VERSION:CFG:1004

^VERSION:PRL:

^VERSION:OEM:

^VERSION:INI:



OK

Finally, booted up an Ubuntu live image, which did the switchmode to “HiLink”, adding a new device to ifconfig

This modified the device, as then booting back into OpenBSD, we have the cdce0 ethernet device showing. Adding a simple /etc/hostname.cdce0 with dhcp up and a sh /etc/netstart/ and we’re all good.

]]>
Getting Snipcart custom data attributes into WordPress + Elementor Pricing Table https://leonstafford.gitlab.io/getting-snipcart-custom-data-attributes-into-wordpress-elementor-pricing-table/ Sat, 24 Nov 2018 16:02:29 +0000 https://leonstafford.gitlab.io/?p=462 Continue reading "Getting Snipcart custom data attributes into WordPress + Elementor Pricing Table"

]]>
After shunning pagebuilders in WordPress long enough, I gave Elementor a try for a landing page layout and found it quite useful. I also realized how terribly far behind Gutenberg is!

So, Elementor got me 90% of the way there, as is often the case in WordPress – simple, until it isn’t!

Custom code in the theme’s functions.php got the last piece of the puzzle:

function wp2static_snipcart_callback($buffer) {
   $html_output = $buffer;

   $dom = new DOMDocument();
   $dom->loadHTML($html_output);

   $finder = new DomXPath($dom);
   $classname="elementor-price-table__button";
   $nodes = $finder->query("//*[contains(@class, '$classname')]");

   $yearly_buy_button = $nodes->item(1);

   $yearly_buy_button->setAttribute('class','elementor-price-table__button elementor-button elementor-size-md snipcart-add-item');                                                                
   $yearly_buy_button->setAttribute('data-item-name','PowerPack, unlimited sites, yearly');
   $yearly_buy_button->setAttribute('data-item-id','powerpack-unlimited-yearly');
   $yearly_buy_button->setAttribute('data-item-url','https://securityandperformance.com/');
   $yearly_buy_button->setAttribute('data-item-price','99.00');
   $yearly_buy_button->setAttribute('data-item-payment-interval','Year');
   $yearly_buy_button->setAttribute('data-item-payment-interval-count','1');

   $unlimited_buy_button = $nodes->item(2);

   $unlimited_buy_button->setAttribute('class','elementor-price-table__button elementor-button elementor-size-md snipcart-add-item');                                                             
   $unlimited_buy_button->setAttribute('data-item-name','PowerPack, unlimited sites, lifetime');
   $unlimited_buy_button->setAttribute('data-item-id','powerpack-unlimited-lifetime');
   $unlimited_buy_button->setAttribute('data-item-url','https://securityandperformance.com/');
   $unlimited_buy_button->setAttribute('data-item-price','299.00');

   return $dom->saveHTML();
}

add_filter( 'the_content', 'wp2static_snipcart_callback' );

// duplicate with wp_styles for loaded CSS in frontend
function insite_inspect_scripts() {
global $wp_scripts; echo PHP_EOL.’’.PHP_EOL;
}

add_action( ‘wp_print_scripts’, ‘insite_inspect_scripts’ );
]]>
Low footprint tech hub https://leonstafford.gitlab.io/low-footprint-tech-hub/ Mon, 12 Nov 2018 16:13:18 +0000 https://leonstafford.gitlab.io/?p=465 Continue reading "Low footprint tech hub"

]]>
Aiming to create very low-cost, low-footprint self-contained workstations that can be deployed to areas lacking resources.

A place you go to invest in knowledge and develop skills

“The Knowledge Bank Network”

Functions:

  • knowledge bank
    • offline WikiPedia, StackOverflow
  • entertainment
    • public domain movies, music, books, games
  • communications
    • share one connection

Ideas to explore:

raspberryPi control unit, acting as router, NAS – OpenBSD – dhcp – pf to share connection – local web server – shows network status – portal to documentation

10 / 100 witches – should be an abundance – how much power do they consume?

  • solar panels
  • inverter

Lowest possible power consumption target to minimize amount of solar/wind required

]]>
Keep Your Core Strong – Know Your BSD/Linux Tools https://leonstafford.gitlab.io/keep-your-core-strong-know-your-bsd-linux-tools/ Wed, 07 Nov 2018 16:14:31 +0000 https://leonstafford.gitlab.io/?p=467 Continue reading "Keep Your Core Strong – Know Your BSD/Linux Tools"

]]>
Just as the sage advice from The Pragmatic Programmer on mastering one text editor makes so much sense for those of us whose majority of work is rearranging bits on the digital titanic, the same holds true for knowing your operating system and investing in solid tooling for your other main productive tasks.

Opinionated preface – Open source or GTFO

The world’s resources are quickly depleting. A growing population having to work sh!tty jobs for sh!tty companies selling sh!tty stuff is not sustainable and kinda hard to keep respecting yourself as a highly paid developer building yet another duplicated piece of software on VC funds.

If the aim is to advance humanity and avoid depleting all the resources as population explodes, then we should be looking to re-use and not create uneccessarily. Open source software that’s been continually refined since the 60’s/70’s is continually being optimized and is able to run well on older hardware.

We don’t need another One Laptop Per Child venture creating future ewaste when we already have an abundance of capable hardware. Let’s stop making batteries full of costly/harful chemicals and get more solar to continue running old laptops after their batteries have died.

On with the show – the core utilities I invest in learning well

This page serves a purpose to me as storing minimal configuration notes. I strive to not become dependent on too much customisation for the reasons:

  • portability: the benefit of these tools are their ubiquitousness, I want the ability to grab any available device and quickly be productive without a day of setup or requiring of internet to pull down convoluted dotfiles libraries
  • learn the tool well: you may be working around the original design of the software. If it’s really not there, consider contributing it to the project, or if it doesn’t belong there, look for another modular program to handle that responsibility

OpenBSD

Slow is smooth and smooth is fast. Forgoing the bells, whistles and kitchen sink included in most Linux distros, OpenBSD has been planned with security and quality in mind. You’re not forced to read the docs, but you’ll soon realize it’s the most efficient path forward.

Amazing support for older architectures and a great welcoming community.

Japanese support

Install relevant fcitx packages

Install ja-sazanami-ttf

edit $HOME/.config/fcitx/profile, changing anthy:False to anthy:True

set shortcut key in $HOME/.config/fcitx/config

set XMODIFIERS in .xsession, along with fcitx-autostart before cwm

xset fontpath

Vim

My minimal .vimrc

set ts=2 sw=2 expandtab ruler nu noswapfile colorcolumn=80                      
syntax on                                                                       
colorscheme delek                                                               
                                                                                
autocmd Filetype php setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4       
autocmd Filetype js setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2        
                                                                                
highlight ExtraWhitespace ctermbg=red guibg=red                                 
match ExtraWhitespace /\s\+$/   

" newly acquired skills
set wildmenu " show search reuslts and such as popups
set path+=** " set path to this folder and all subdirs, ie for searching

git

My minimal .gitconfig


tmux

My minimal .tmux.conf

# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# large history limit
set -g history-limit 999999999

httpd

Ensure you have required files from /etc in /var/www/etc chroot (copy all when lazy)

httpd.conf

basic example

prefork 10

types { include "/usr/share/misc/mime.types" }

server "localhost" {
	listen on * port 80

	directory index "index.php"

	root "/htdocs"

	location "/*.css*" {
		request no rewrite
	}

	location "/*.js*" {
		request no rewrite
	}

	location "/*.png*" {
		request no rewrite
	}

	location "/mystaticsite*" {
		directory index "index.html"
		request no rewrite
	}

	location "/*.php*" {
		fastcgi socket "/run/php-fpm.sock"
	}

	location "/posts*" {
		fastcgi socket "/run/php-fpm.sock"
	}
}

PHP conf

As per https://dev.to/nabbisen/fixing-php72fpm-on-openbsd-64-f0f, we need to manually create the missing pool file in /etc/php-fpm.d/somefile.conf

; Start a new pool named 'www'.
[www]

; specify user
user = www
group = www
listen.owner = www
listen.group = www
listen.mode = 0660

chroot = /var/www

listen = /var/www/run/php-fpm.sock

; allow php execution on any URL
security.limit_extensions = 

; endpoint to monitor PHP FPM
pm.status_path = /status

; define process manager
pm = dynamic
pm.max_children = 9
pm.max_spare_servers = 4
pm.min_spare_servers = 2
pm.start_servers = 3

; help pinpoint slow scripts
slowlog = /var/log/php-slow.log
request_slowlog_timeout = 2s

maria

install server and client packages

run mysql_install_db

reload and run mysql_secure_installation

create a non-root user

connect via 127.0.0.1 vs localhost in WP config

WP

file permissions

TODO: currently 777’ing locally to allow watch script

find /var/www/htdocs -type d -exec chmod 775 {} \;
find /var/www/htdocs -type f -exec chmod 755 {} \;
chmod 400 /var/www/htdocs/wp-config.php

watch files

watch_me_sync.sh

#!/bin/sh                                                                       
while :                                                                         
do                                                                              
    find $HOME/wordpress-static-html-plugin/ -type f ! -path '*/.*' |           
    entr -d  sh $HOME/deploy_changed_file.sh /_                                 
done 

doas

# run WP-CLI from same user as hitting from web
permit persist MYUSERNAME as www cmd wp

deploy_changes_file.sh

#!/bin/sh                                                                       
                                                                                
CHANGED_FILE=$1                                                                 
PROJECT_DIR=$HOME/wordpress-static-html-plugin/                                 
BASENAME=${CHANGED_FILE#"$PROJECT_DIR"}                                         
TARGET_PATH=/var/www/htdocs/wp-content/plugins/wordpress-static-html-plugin/${CHANGED_FILE#"$PROJECT_DIR"}
TARGET_PATH2=/var/www/htdocs/securesite.local/wp-content/plugins/wordpress-static-html-plugin/${CHANGED_FILE#"$PROJECT_DIR"}
TARGET_PATH3=/var/www/htdocs/subdirsite.local/wordpress/wp-content/plugins/wordpress-static-html-plugin/${CHANGED_FILE#"$PROJECT_DIR"}
TARGET_PATH4=/var/www/htdocs/japanesesite.local/wp-content/plugins/wordpress-static-html-plugin/${CHANGED_FILE#"$PROJECT_DIR"}
                                                                                
echo "$BASENAME"                                                                
                                                                                
cp $CHANGED_FILE $TARGET_PATH                                                   
cp $CHANGED_FILE $TARGET_PATH2                                                  
cp $CHANGED_FILE $TARGET_PATH3                                                  
cp $CHANGED_FILE $TARGET_PATH4                                                  
                                                                                
echo '' 

coreutils

Refer to the excellent man pages provided by OpenBSD or take a chance with the docs from whatever other OS you’re using.

My minimal shell profile (bash by default)

# enable viewing media offline
function dla {                                                                  
    # dl searched song to mp3                                                   
    youtube-dl --extract-audio --no-mtime --audio-format mp3 --no-playlist --default-search ytsearch -o "~/Music/%(title)s.%(ext)s" "$*" 
    if [ $? -eq 0 ]; then                                                       
      # send newest file to smplayer playlist                                   
      LATEST_FILE=$(ls -t *.mp3 | head -1)                                      
      smplayer -add-to-playlist "$LATEST_FILE"                                  
    else                                                                        
        echo "failed to download"                                               
    fi                                                                          
} 

# usage
dla some title with spaces no need to surround with quotes

 

]]>
WordCamp Brisbane 2018 – WordPress as a Static Site Generator https://leonstafford.gitlab.io/wordcamp-brisbane-2018-wordpress-as-a-static-site-generator/ https://leonstafford.gitlab.io/wordcamp-brisbane-2018-wordpress-as-a-static-site-generator/#respond Mon, 29 Oct 2018 10:24:00 +0000 https://leonstafford.gitlab.io/?p=13 Continue reading "WordCamp Brisbane 2018 – WordPress as a Static Site Generator"

]]>

In a tired, but inspired state, after attending this weekend’s WordCamp Brisbane 2018.

Got to start with a big shout-out to all of the organizers, volunteers, speakers and attendees – THANK YOU!

I’m far from a WordPress fanboi – I regularly talk people out of using self-hosted WordPress. As a tech industry professional, I feel responsible to not push everyone to use a certain technology unless it makes sense. For someone who isn’t interested in learning development and being responsible for security and performance of their server (or willing to pay someone else to be), I’d much sooner advise them to check-out a hosted platform, be it WordPress.com, SquareSpace, Shopify, etc. For those who do want to get geeky, I’m more often encouraging them to look at modern web frameworks, not try to bend a blogging tool into uncomfortable positions.

I regularly talk people out of using self-hosted WordPress

So why did I go?

I’m passionate about open source software and WordPress is still a
great example of this. It’s definitely helped me earn money over the
years and has allowed many others to get involved in development, with a
low barrier to entry. I also author a WordPress plugin,
which aims to help solve security, performance and cost issues for
users who are already invested in WordPress for their website.

I went to present on static sites and how users can continue to use WordPress for all of its benefits, but take advantage of publishing it out to host as a static site. I mentioned my plugin as one means to this end, but it was primarily a mission in raising awareness of what static sites are and why people should care (spoiler: security, performance and cost!).

My passions and long term goals are to see people embrace
low-resource computing, re-using older hardware with low-footprint but
high productivity software to enable more people to get involved in the
tech community (and try to put an end to the forced obselence practiced
by companies like Apple, pushing users onto new hardware every 2 years –
at great cost to the environment and little benefit to society. More emotions on software bloat and disenchantment within the software industry).

Raising awareness about static websites is one step towards this goal
and with WordPress powering > 30% of the top websites, the amount of
wasted resources is disturbing.

Though nervous about presenting for the first time, I was pleased with the feedback and engagement from the audience via post talk questions and follow up chats throughout the conference and the evening drinks Friday and Saturday nights. To feel you may have given some people reason to “think different” is really fulfilling and motivating to do more.

Why did I love this WordCamp?

The community. This is the resonating reason everyone gave.
An event selflessly organised and volunteered at by users leaves a great
impression. I’m an early riser and found myself helping carry some
boxes with a trio of another plugin developer, a leading WordPress
hosting company engineer and one of the lead WordPress developers from Automattic. That’s just… wow!

There are countless other people to thank for all their efforts.

Whilst my feelings for WordPress, the product, are far from
unconditional love, I’ve got mad love for the community and privileged
to be a part of it!

See the next group at either WordCamp Kuala Lumpur or WordCamp Jakarta!

Find your next WordCamp or Meetup.

]]>
https://leonstafford.gitlab.io/wordcamp-brisbane-2018-wordpress-as-a-static-site-generator/feed/ 0
Tweaking the Bitnami WordPress Stack on AWS LightSail https://leonstafford.gitlab.io/tweaking-the-bitnami-wordpress-stack-on-aws-lightsail/ Wed, 17 Oct 2018 16:16:44 +0000 https://leonstafford.gitlab.io/?p=469 Continue reading "Tweaking the Bitnami WordPress Stack on AWS LightSail"

]]>
Update:

I no longer use Bitnami on AWS LightSail due to the steps required to get sane application behaviour and performance are not worth it. Leaving this up for any searches leading here and will recommend for a similar level of serviced hosting, try DigitalOcean or Vultr.

Tired of clunkily updating a GitHub gist, herein lie my notes used when provisioning an AWS LightSail instance with Bitnami WordPress for quick migration/debugging of an existing user’s WordPress site.

  • copy public key via the virtual terminal in AWS Console
  • set a DNS entry to point dev domain to the instance’s IP
  • access site at dev domain
  • rm bitnami banner
    • sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1
    • sudo /opt/bitnami/ctlscript.sh restart apache
  • SSH in using dev domain
  • enable SSL
    • sudo mkdir /opt/bitnami/letsencrypt
    • cd /opt/bitnami/letsencrypt
    • sudo wget https://dl.eff.org/certbot-auto
    • sudo chmod a+x ./certbot-auto
    • sudo ./certbot-auto
    • sudo ./certbot-auto certonly --webroot -w /opt/bitnami/apps/wordpress/htdocs/ -d example.com
    • sudo ln -s /etc/letsencrypt/live/[DOMAIN]/fullchain.pem /opt/bitnami/apache2/conf/server.crt
    • sudo ln -s /etc/letsencrypt/live/[DOMAIN]/privkey.pem /opt/bitnami/apache2/conf/server.key
    • Make sure that the certificate file name and path is correct. If you receive an error that file already exists, use the below command to rename the files:
    • mv /opt/bitnami/apache2/conf/server.key /opt/bitnami/apache2/conf/serverkey.old
    • mv /opt/bitnami/apache2/conf/server.crt /opt/bitnami/apache2/conf/servercrt.old
    • sudo /opt/bitnami/ctlscript.sh restart apache
  • adjust wp-config to use https
    • sed -i 's/http/https/' /opt/bitnami/apps/wordpress/htdocs/wp-config.php
    • sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/
  • force https in top of file: /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf
    • RewriteEngine On
    • RewriteCond %{HTTPS} !=on
    • RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
  • Restart server to enforce https
    • sudo /opt/bitnami/ctlscript.sh restart apache
  • backup wp-config somewhere
    • sudo cp /opt/bitnami/apps/wordpress/htdocs/wp-config.php /opt/bitnami/apps/wordpress/wp-config-backup-randstring.php
  • disable mod pagespeed
    • sudo vim /opt/bitnami/apache2/conf/pagespeed.conf
    • ModPagespeed on > ModPagespeed off
    • sudo /opt/bitnami/ctlscript.sh restart apache
  • copy existing site’s files into WP dir
  • backup existing wp-config
    • sudo cp /opt/bitnami/apps/wordpress/htdocs/wp-config.php
      /opt/bitnami/apps/wordpress/user-original-wp-config-backup-randstring.php
  • restore Bitnami’s wp-config
  • copy any custom define’s or code from existing wp-config
  • import users DB
    • delete bitnami_wordpress
    • create bitnami_wordpress
    • import .sql
  • rewrite any hard links within DB
    • sudo wp --allow-root search-replace 'OLD.domain.com' 'NEW.wp2static.com'
  • change admin user email and pwd
    • sudo wp --allow-root user update 1 --user_pass="PASSWORD"
  • rewrite any hard links within site (optional, careful of mailto links, etc)
    • find -name '*.css' -exec sed -i 's/OLD.domain.com/NEW.wp2static.com/g' {} +
  • reset file permissions
    • sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/
    • sudo find /opt/bitnami/apps/wordpress/htdocs/ -type f -exec chmod 664 {} \;
    • sudo find /opt/bitnami/apps/wordpress/htdocs/ -type d -exec chmod 775 {} \;
    • also php-fpm restart sudo /opt/bitnami/ctlscript.sh restart php-fpm
  • enable debugging

define( 'WP_DEBUG', true );

tailing WP logs

tail -f /opt/bitnami/apache2/logs/error_log

connect to db

mysql -u bn_wordpress -p bitnami_wordpress # and pwd from wp-config

check plugin options

select * from wp_options where option_name = 'wp-static-html-output-options' \G;

  • working_directory option can persist the old sever’s paths

modify PHP ini

not yet needed, seems to have large max_execution_time already

  • disable opcache
  • disable mod pagespeed
  • use development level error logging
  • increase memory
  • extend max execution time

sudo vim opt/bitnami/php/etc/php.ini

Basic Auth

https://docs.bitnami.com/google/apps/wordpress-multisite/administration/use-htpasswd/

less noisy error log

sudo echo 'ErrorLogFormat "\n \"%M\" \n "' >> /opt/bitnami/apache2/conf/httpd.conf

^ needed re-rediting to affect the CR’s, look to fix

Scratch notes

  • deal with (70007) The timeout specified has expired errors from proxy_fcgi:error:

https://stackoverflow.com/a/38711063/1668057

Timeout 900 ->

in /opt/bitnami/apache2/conf/httpd.conf

https://medium.com/@sbuckpesch/apache2-and-php-fpm-performance-optimization-step-by-step-guide-1bfecf161534

import vim and tmux confs

curl
https://gist.githubusercontent.com/leonstafford/6891b76aeaf43766dd52676d6bed1b08/raw/9979e28a9abf07af94b505d35ff9a4eb3da7cb9f/.tmux.conf
--output ~/.tmux.conf

curl
https://gist.githubusercontent.com/leonstafford/39333da3399adee7e88cb869b4685dff/raw/5e6e7b7fb834d996763da3d358d949d309691350/.vimrc
--output ~/.vimrc

not working without additional domain verification overrides: – enable mail sending (consider Amazon has a limit for LightSail) not verified, erros with – sudo apt install sendmailsudo vim opt/bitnami/php/etc/php.ini – uncomment sendmail_path = "env -i /usr/sbin/sendmail -t -i"sudo /opt/bitnami/ctlscript.sh restart apache

]]>
Business to feed the family https://leonstafford.gitlab.io/business-to-feed-the-family/ Mon, 31 Jul 2017 16:53:15 +0000 https://leonstafford.gitlab.io/?p=320 Continue reading "Business to feed the family"

]]>

Does the greed for extra profit margins cause more damage to the ecosystem?

Business to feed the family

“I made a G today”

“but you made it in a sleazy way”

“Selling crack to the kids”

“I gotta get paid!”

Maybe it’s this “I gotta get paid” part which I hear the most. People tell me how they’d love to work as a volunteer or work on social ventures. Then comes the big “but”, twerking to the tune of “I gotta feed my family”.

Is that really the only concern, to feed the family? Grow a vegie garden in the backyard I know you have. Live in a cheaper house, use public transport, forego the Netflix account.

Does this house you live in make you the person you truly want to be, or are you suffering the fate as the people in Gibran’s dayHave you only comfort, and the lust for comfort, that stealthy thing that enters the house a guest, and then becomes a host, and then a master?

Reducing these living costs is one way to get more freedom to do the things you want to do.

Another is to try to buy your freedom, by making more and more money. This option is more appealing to our sense of greed, though it is rarely without a cost to somebody.

How do you make this money?

Via real estate investing – sitting on a few houses, with the intent of value rising, pushing up rent or purchase prices for those who aim for just one place to live.

By selling goods and services to others? If you can lower the cost of your product, while making more profit, that’s great, but are we talking about your cost in producing the product or the cost to the consumer to buy your thing?

If you know your product’s consumers will pay an extra 10% for your item, without affecting number of sales, it’s a no-brainer, right? Or is it the heart which is lacking from this decision?

That 10% multiplied by all your devices sums to an amount that someone must pay for and that society is going to pay for, one way or another. It’s 10% more your consumer needs to work for, by going to work for a company which has its own ecological footprint, not to mention the transportation cost and the time cost that is taking away from their family and their options to do volunteering. So continues the effect of your greedy decision to squeeze that extra bit of profit out.

But… I have shareholders. It’s my responsibility to make as much profit as possible.

Is that really justifiable to you? Does it sustain your sense of self-integrity?

When you create a corporation with shareholders and a board, how can you ensure that greed doesn’t prevail over you making enough money to feed your family?

Site made with love of these open source tools

The beautifully-crafted OS that forces you to learn how to do things properly.

For better or worse, WordPress powers 30% of the web. ClassicPress reduces some of the bloat.

Text is my material. Learn one text editor well.

Version controlling all the things.

Retaining workspaces on local and remote servers.

Supporting the OpenBSD community with opinionated VMs. €10/yr donated to the OpenBSD Foundation.

To Roman Zolotarev, for helping us Master the Web. My family and friends for enduring my voluntary financial hardship while pursuing my passions.

]]>
Persuasion for humanity https://leonstafford.gitlab.io/persuasion-for-humanity/ Fri, 02 Jun 2017 17:13:30 +0000 https://leonstafford.gitlab.io/?p=336 Continue reading "Persuasion for humanity"

]]>

Not all advertising has to be evil

Persuasion for humanity

Wanting to share your beliefs without imposing on the freedom of others

The healthy option

Compromising on one’s values can slowly eat away at their sense of self, their confidence and their ability not to compromise in future situations. Perhaps this is contributing to global cases of mental health problems, in that we deep down can understand the effects of habitat destruction, but continue to compromise and consume the products which destroy it.

Maybe you’ve come to realise this, you’re now less stressed, confident in yourself and living in a way you believe is beneficial to others.

But, what about your friend? Your family? The rest of the world? You want to help them to feel good about themselves, conserve our shared environment and help others. What’s stopping you?

Don’t tell me what to think!

I know I’ve never appreciated people telling me what to think, let alone what to believe. I imagine most people are the same.

Recently, I encountered a person who, after a minute of chit chat, started to tell me I must believe in Jesus and pray for us all, then proceeded on a 20-minute one-way conversation about aliens, Beyonce, reptillian people and other interesting, though unlikely, theories, such as the Large Hadron Collider being used to open a portal to the demonic underworld.

Whilst a little alarming, I wasn’t otherwise indisposed, so it was interesting to experience this person, so excited about their beliefs. 20 mins was enough though, so to much relief, after they left, my flatmate and I had a chat about it. We’re not the sort of people to say they shouldn’t have believed in what they did, but felt that if their intent was to convert me to their way of thinking, her approach was ineffective.

So, how could this person have better tried to persuade me to her beliefs?

Selling what people want

Using words like selling and advertising still make me feel a little dirty. I think because I see so much of it out there that I feel is against the common interest for humanity. But, if this is the prevalent system able to convince the masses to believe they want product X, then should we not consider leveraging it to promote what we believe in?

TV advertising sounds a little out of date now, but before the internet’s dominance, this was a key way for advertisers to sell to the audience. At least in the United States, some brodcasters used to be required to air some quantity of Public Service Announcements (PSAs). And these usually ended up being broadcast in the times with the least amount of viewers. Because – money.

Financial reasons

What is the reason we aren’t all working for Greenpeace or sharing the harvesting on a kibbutz? Is it our belief that we need an ever unattainable amount of money? Is that why we compromised and took the job with McBurgers. Maybe we believed it was just a temporary gig, so we could just get to a future state where we can live true to our beliefs?

Naomi Klein’s “No Logo” describes the big brand companies becoming “lifestyle companies”, selling the companies image not only to the consumers, but also to their staff. Perhaps with enough colorful t-shirts, social mixers and corporate social responsibility projects, it is possible to keep staff content with not only some money, but also a belief that their sweatshop made products and hip software is for the common good. It did take me many years to walk away from the money (the belief in the products rarely lasted through the interview). I still earn a little from such a gig due to some of that self-compromising already mentioned, but with a clear plan to escape.

Telling friends what they don’t want to hear

With friends, we have a bit more room to tell them what we think is good for them, that they wouldn’t likely accept from a complete stranger. A bit more room, but not a carte blanche to force your beliefs on them.

So, your friend wants to buy a new gadget/car/muscial toothbrush. You want them to not want to do that. How could this be achieved?

 – telling them they’re wrong and an evil person

 – giving them your gadget/car/musical toothbrush

 – do nothing and compromise a little more of yourself

educating them that their freedom to buy it has a real cost/impact on other people’s freedoms

The last one sounds great, but is not an easy task. I’ve used the example of a friend, but this applies to your small tribe of family and social peers as well as to the greater and global community you live in. You don’t want to be unfriended by the world, do you? Better to be wrong and have friends than the be the only sane person who lives alone in a cave.

Just as killing someone who opposes what you believe in is an extreme reaction, so is doing nothing at all. Let’s find somewhere around the middle of that dark-bright divide which is yin yang.

Same mistakes, bigger consequences

Persuading people has been in our toolkit ever since we didn’t want to keep killing the guy standing between us and the watering hole. Historical records of it go back as far as 2285 BC.

Once developed, one can use it for the benefit of others or for their own selfish goals, depending on which way their moral compass is being blown by the spiritual winds.

Not much has changed in human behaviour since those early days of rhetoric, but the world we live in and our depletion of the life sustaining resources in it may now require those with a belief in sustaining life to up their powers of persuasion.

Even if we achieve this great raising of awareness amongst humanity the day before a great meteor wipes us out, we’ll at least have had that one day of beauty.

Site made with love of these open source tools

The beautifully-crafted OS that forces you to learn how to do things properly.

For better or worse, WordPress powers 30% of the web. ClassicPress reduces some of the bloat.

Text is my material. Learn one text editor well.

Version controlling all the things.

Retaining workspaces on local and remote servers.

Supporting the OpenBSD community with opinionated VMs. €10/yr donated to the OpenBSD Foundation.

To Roman Zolotarev, for helping us Master the Web. My family and friends for enduring my voluntary financial hardship while pursuing my passions.

]]>
Short distance relationships https://leonstafford.gitlab.io/short-distance-relationships/ Fri, 02 Jun 2017 14:23:56 +0000 https://leonstafford.gitlab.io/?p=342 Continue reading "Short distance relationships"

]]>

Can’t live with/out them ? live close to them

Short distance relationships

Does living apart from your partner defy the universally accepted love protocols?

Staying withing firing range

Love’s great marksman, Cupid, drew back his arrow, he didn’t get into close quarters range for some Krav Maga nut shots.

TIL – The furthest recorded accurate shot in competitive archery was set at 283.47 metres in 2015. Definitely, people have maintained long distance relationships over greater distances than this. Likewise, other couples can thrive in a little love nest others would find claustrophobic.

Having launched volleys of love arrows at both extremities of this range, I don’t seem to be able to hit my target with the right velocity.

Dropping metaphors, I’ve found my comfort zone in relationships to be somewhere in the middle. Close enough to be in each other’s lives, but not living on top of each other. Having the choice to spend each night together, but the freedom not to have to. We all might benefit from some “me time”, and we mightn’t realise this until we actually have some.

The great unlearning

Growing up in the West, under the surrogate supervision of old cartoons and Disney movies, one may get some values thrust upon them. Certainly, those of kindness and helping others are great. Those which influence our image of the ideal family can cause the most frustration later in life. We may have learned that some of those values, such as the suburban home dream, were driven by the fossil fuel industry, preferring people to commute by car to their place of work. By that token, one might expect advertisers to have pushed independent living over the single household nuclear family.

When my former marriage got to the point of 2 argumentative parents, it took some time to resist these programmed values and make the decision to separate. This separation was only a couple of blocks away and was a great improvement to the situation – 2 happy parents, setting an example of living their own lives. I was at the time in a position to support this financially, not everyone can afford that luxury, but everyone can afford to consider it. Once people have decided what they want, it can make achieving it all the more possible.

No man is an island, but he can pretend he lives on one

In the safe space of the internet, I’ll admit to enjoying singing and dancing around the house. Well, this is the case usually when I’m living in my own bachelor pad. It can cross over to when my partner comes to visit, but when living together in a mutual space, I find these parts of me tend to get pushed to the background. Something to work on for sure – who doesn’t want to dance around the house with their partner? But how many do?

There are those other little things which couples find as friction points when moving in together – do the knives go on the left or the forks? Toilet paper hanging on the outside or inside of the holder? Clothes hung up or folded? First-world problems if ever there were, but points of debate, nonetheless.

Does love require adjustments on each of these points in order to work? Would you not visit your partner in their own home simply because the cutlery arrangement was not to your pre-conditioned liking?

Not too self

Studies of prisoners in extreme isolation have shown that most tend to develop any pre-disposed mental disorders. Rather than locking ourselves away and being alone, living on one’s own while in a loving relationship may help to remind us of who we are. Having your own social group and activities, along with those shared by your partner helps define us.

How did you first meet? How did you fall in love? Where you already living together or did you have your own lives, which was part of the attraction?

Site made with love of these open source tools

The beautifully-crafted OS that forces you to learn how to do things properly.

For better or worse, WordPress powers 30% of the web. ClassicPress reduces some of the bloat.

Text is my material. Learn one text editor well.

Version controlling all the things.

Retaining workspaces on local and remote servers.

Supporting the OpenBSD community with opinionated VMs. €10/yr donated to the OpenBSD Foundation.

To Roman Zolotarev, for helping us Master the Web. My family and friends for enduring my voluntary financial hardship while pursuing my passions.

]]>