Skip to content

Instantly share code, notes, and snippets.

View frdmn's full-sized avatar
🦀

Jonas Friedmann frdmn

🦀
View GitHub Profile
@frdmn
frdmn / bash_aliases
Last active November 13, 2023 17:47
Nginx and PHP-FPM configuration + default virtual host
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.restart='mysql.stop && mysql.start'
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log'
@frdmn
frdmn / manual_bed_tramming_gcode.md
Created April 3, 2023 06:53
Gcode commands for manual bed leveling / tramming

Gcode commands for manual bed leveling / tramming (Ender 3)

The commands below assume a build plate of 235 x 235 mm.

Preparation

Disable endstops (Z-Limit)

M211 S0 
@frdmn
frdmn / index.md
Last active March 16, 2023 15:43
Raspberry Pi 4B with Prusa MK3s / Einsy RAMBo headers

Raspberry Pi 4B with Prusa MK3s / Einsy RAMBo headers

The guide below describes how to connect a Raspberry Pi 4B to the Prusa i3 MK3s main board (Einsy RAMBo) board with its builtin RPi headers and an additional step-down / buck converter. The buck converter is necessary, since the Einsy headers do not provide enough amps to power anything bigger than a Raspberry Pi Zero W.

Parts needed

Wiring

@frdmn
frdmn / index.md
Created March 8, 2023 14:13
Disable power save mode for wireless interfaces on Raspbian 10/Buster
vi /usr/lib/systemd/system/wifi_disable_powersave.service
[Unit]
Description=Disable WiFi power save mode
After=sys-subsystem-net-devices-wlan0.device

[Service]
@frdmn
frdmn / README.md
Last active January 5, 2023 10:51
Victor's macOS Client information parser
  1. Download the client-information and move it to /usr/local/bin/client-information:

    wget https://gist.githubusercontent.com/frdmn/5eeebc05c61c7a00450aee8b81be824c/raw/520d3e9ae9ec80710344119e1780939fa843130b/client-information -O /usr/local/bin/client-information
    bash +x /usr/local/bin/client-information
    
  2. Configure the scheduler to periodically run the script:

@frdmn
frdmn / reminder_to_close_window.yaml
Created November 21, 2021 16:20
Improved version of @home-IoT/hass-blueprints:reminder_to_close_window.yaml
#
# Home Assistant Automation Blueprint
#
# Sends two notifications to close a window or door after opening it,
# if the temperature outside is below a certain degree.
#
# Revision 3
# Roozbeh Farahbod, Jan. 2021
# Jonas Friedmann, Nov. 2021
#
@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox
@frdmn
frdmn / mysqldump-progress-single-db.sh
Last active October 27, 2021 11:32 — forked from o5/dump.sh
MySQL / MariaDB Dump Helper
#!/usr/bin/env bash
# MySQL / MariaDB Dump Helper
# ===========================
# FEATURES: Progress bar with ETA, support multiple databases (dump into separated files) and password as argument
# REQUIREMENTS:
# =============
# GNU Core Utilities, mysql, mysqldump, pv (https://github.com/icetee/pv)
@frdmn
frdmn / keys.pub
Created August 18, 2020 12:53
frdmn@github - keys.pub
BEGIN MESSAGE.
EEGErlKyZxOo4VB kevDbZUEJAKrBDB R20P7l03WuMQcBL YELNpEd6pHSK0Ng
rELQG5zby40L7QO FwKs4uB8e83TCKq 6Xr2MZHgg6oYWic lco69PQeA8YqJel
dc4vyMPo8DNbKMT IfoxAFXppc4Frfl 8OE60qwf1IcLNGn gAHSdzQRYfjwayL
bgm5HNUb0f7EJJV DvyzY9wmIdIvIMx mGPQj.
END MESSAGE.
@frdmn
frdmn / reddit-outage-refresh.user.js
Created December 31, 2013 01:44
Reddit outage refresh - UserScript which adds auto refresh on the "we took too long to make this page for you - try again and hopefully we will be fast enough this time." outage page of Reddit. No need for firing CMD+R anymore.
// ==UserScript==
// @name Reddit outage refresher
// @version 0.1
// @author frdmn
// @match http://www.reddit.com/*
// ==/UserScript==
var xpathResult = document.evaluate("(//text()[contains(., 'try again and hopefully we will be fast enough this time.')])[1]", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
var node=xpathResult.singleNodeValue;
if (node!=null) {