Skip to content

Instantly share code, notes, and snippets.

View sftsk's full-sized avatar

Lukas Jakob Hafner sftsk

View GitHub Profile
@sftsk
sftsk / ipv6-pi.md
Last active February 6, 2023 07:40
Enable ipv6 on Raspberry Pi
@sftsk
sftsk / nginx-multisite-fix.conf
Last active June 21, 2022 11:38
fix nginx multisite redirect loop using roots/bedrock
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) /wp$2 last;
rewrite ^(/[^/]+)?(/.*\.php) /wp$2 last;
}
@sftsk
sftsk / lets-mac.md
Last active June 17, 2022 12:04
Let's Encrypt macOS Server

Taken from https://community.letsencrypt.org/t/complete-guide-to-install-ssl-certificate-on-your-os-x-server-hosted-website/15005?source_topic_id=33254&source_topic_id=40061

Introduction

If like me you are, among other many tasks, a system administrator of a website hosted on OS X server, chances are your are not fully comfortable with what to do precisely in order to get your website running with a valid SSL certificate. After some struggle, I would like to share my experience on the installation of let’s encrypt certificate.

The target audience of this article is people with a minimum IT skills (I assume you know how to open the terminal and some basic knowledge of shell commands), already having a configured and running website hosted on OS X and managed with the Server App. Also this article assumes you will generate the certificate on the machine hosting the server itself.

Note: The following procedure was successfully installed on two similar server, both are Mac mini running on OS X Mavericks (10

@sftsk
sftsk / calendarpi.md
Last active May 12, 2021 21:19
Raspberry Pi Google Calendar Screen

Using a raspberry pi to display Google Calendars

This explains the set up of our very basic status screen to displays Google calendars here at booncon.

Install the raspberry pi

Download and put the most current https://www.raspberrypi.org/downloads/raspbian/ image to an SD Card. On OSX that works great with http://www.tweaking4all.com/hardware/raspberry-pi/macosx-apple-pi-baker/, just use the restore option and select the unzipped image file.

Set up the operation system basics

After the first boot, the raspi-config utility should load up.

@sftsk
sftsk / site.conf
Created August 31, 2017 09:36
local by flywheel config for bedrock multisite
server {
server_name _;
return 302 $scheme://domain.dev$request_uri;
}
server {
server_name ~^(.*)\.domain\.dev$ domain.dev;
root /app/public/;
index index.php index.html index.htm;
@sftsk
sftsk / wc-bc-connector.md
Last active December 2, 2020 11:22
WooCommerce <-> Business Central Connector

WooCommerce <-> Business Central Connector

General Setup Connector

  • Custom WordPress/ WooCommerce Plugin + Custom Business Central Extension
  • Items/ Customers gets synced whenever changes within ERP
    • Status page within WooCommerce to see what needs to be synced + log
  • Customers log into WooCommerce, through customer number they are connected with their ERP customer
    • When they log in an offer gets created in the ERP (though an API in real time), through that they are getting their net prices with all discounts etc. (website first shows list prices and then loads net prices through ajax call)
  • As they put items into the cart, they get get added to the offer
@sftsk
sftsk / launch.json
Last active December 18, 2019 16:47
XDebug with Local & Bedrock
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
@sftsk
sftsk / snippets.js
Created August 2, 2019 10:26
js snippets :)
# if click on table get text
document.querySelectorAll("#ccTableCollapse td").forEach(function(company) {
company.onclick = function(){alert(this.textContent);};
})