Skip to content

Instantly share code, notes, and snippets.

View olssonm's full-sized avatar
🖥️
Working on some cool stuff

Marcus Olsson olssonm

🖥️
Working on some cool stuff
View GitHub Profile
@olssonm
olssonm / after.sh
Created August 23, 2023 16:36
Enable older PHP-versions in Laravel Homestead
# Synchronize the state of FPM-services for said PHP-version
sudo systemctl enable php7.4-fpm
sudo service php7.4-fpm restart
@olssonm
olssonm / sshproxy.sh
Last active April 7, 2021 14:06
SSH proxy with curl
# Enabling proxy
ssh -D 8080 -f -C -N username@server
# Tunnelling via proxy
curl -v --socks5-hostname 0:8080 icanhazip.com
# Killing process
ps -C ssh
kill {PID}
@olssonm
olssonm / stripe.sh
Created February 11, 2021 10:39
Local testing of Stripe webhooks for host-domains
stripe listen --forward-to 192.168.10.10:80/webhook/stripe --headers "host:hostdomain.test"
@olssonm
olssonm / pixelmator.sh
Created December 23, 2020 08:49
Set the scroll in Pixelmator Pro to be "Normal"
defaults write com.pixelmatorteam.pixelmator.x scrollToZoomDirectionInverted -bool true
@olssonm
olssonm / AppServiceProvider.php
Created October 30, 2020 08:39
Set localized time via Carbon in Laravel
<?php
public function register()
{
// Prefered method
\Carbon\Carbon::setUTF8(true);
\Carbon\Carbon::setLocale(config('app.locale'));
setlocale(LC_TIME, config('app.locale'));
// If a specific language-pack is installed/to be used
@olssonm
olssonm / available-domains-se-eng.txt
Last active January 7, 2024 07:00
List of available English one-word-domains with the .se TLD. Updated @ 2024-01-07 08:00.
understanding.se
literature.se
organization.se
month.se
failure.se
population.se
category.se
finding.se
responsibility.se
county.se
# 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
olssonm / numbers-csv-parse.php
Created November 7, 2019 07:54
Quick way to parse a CSV-file exported from Apple Numbers (using default UTF-8 formatting).
$data = array_map(function($v) {
return str_getcsv($v, ";");
}, file($file));
@olssonm
olssonm / ngrok.sh
Created September 5, 2019 12:53
Route ngrok to custom local host
./ngrok http 192.168.10.10:80 --host-header=SITE
@olssonm
olssonm / import.php
Created November 6, 2018 07:01
Import a SQL-file/dump in Laravel
<?php
use DB;
DB::unprepared(file_get_contents(storage_path('file.sql')));