Skip to content

Instantly share code, notes, and snippets.

Building stuff

Marcus Olsson olssonm

Building stuff
View GitHub Profile
olssonm /
Last active Apr 7, 2021
SSH proxy with curl
# Enabling proxy
ssh -D 8080 -f -C -N username@server
# Tunnelling via proxy
curl -v --socks5-hostname 0:8080
# Killing process
ps -C ssh
kill {PID}
olssonm /
Created Feb 11, 2021
Local testing of Stripe webhooks for host-domains
stripe listen --forward-to --headers "host:hostdomain.test"
olssonm /
Created Dec 23, 2020
Set the scroll in Pixelmator Pro to be "Normal"
defaults write com.pixelmatorteam.pixelmator.x scrollToZoomDirectionInverted -bool true
olssonm / AppServiceProvider.php
Created Oct 30, 2020
Set localized time via Carbon in Laravel
View AppServiceProvider.php
public function register()
// Prefered method
setlocale(LC_TIME, config('app.locale'));
// If a specific language-pack is installed/to be used
olssonm / available-domains-se-eng.txt
Last active Aug 14, 2022
List of available English one-word-domains with the .se TLD. Updated @ 2022-08-14 08:00.
View available-domains-se-eng.txt
View pmset
# Check current values
pmset -g
# Set a pmset values (must be sudo)
pmset -a $key $value
# Scan the pmset log for sleep and wake reasons
pmset -g log|grep -e " Sleep " -e " Wake "
# Try to find reasons for keeping the Mac awake
olssonm / numbers-csv-parse.php
Created Nov 7, 2019
Quick way to parse a CSV-file exported from Apple Numbers (using default UTF-8 formatting).
View numbers-csv-parse.php
$data = array_map(function($v) {
return str_getcsv($v, ";");
}, file($file));
olssonm /
Created Sep 5, 2019
Route ngrok to custom local host
./ngrok http --host-header=SITE
olssonm / import.php
Created Nov 6, 2018
Import a SQL-file/dump in Laravel
View import.php
use DB;
olssonm / allowPaste.js
Created Sep 21, 2018
Enable paste on sites that blocks it
View allowPaste.js
var allowPaste = function(e){
return true;
document.addEventListener('paste', allowPaste, true);