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 / pmset
Created November 14, 2019 08:05
# 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 / macos-disable-resize
Last active April 18, 2024 14:26
Disable resizing of the macOS dock
defaults write com.apple.dock size-immutable -bool true; killall Dock
@olssonm
olssonm / definer.sh
Created June 16, 2017 09:14
Remove definer constraints on a a MySQL-dump in macOS
sed -i '' 's/DEFINER=`[^`][^`]*`@`[^`][^`]*`//g' filename.sql
@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
@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 / sv-locale.sh
Last active December 4, 2022 17:58
Install Swedish language pack on Ubuntu
#Update package lists
sudo apt-get update
#Fetch language pack
sudo apt-get install language-pack-sv
#Check available languages, sv_SE.utf8
locale -a
#Generate locale
@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