Skip to content

Instantly share code, notes, and snippets.

View honsa's full-sized avatar
💭
I am just a human

honsa.ch honsa

💭
I am just a human
View GitHub Profile
@honsa
honsa / ngrok-selfhosting-setup.md
Created April 27, 2023 16:38 — forked from lyoshenka/ngrok-selfhosting-setup.md
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

laragon-multi-php-version-via-package-manager

Manage your php version via Laragon PHP UI switcher with help of powershell package manager.

For this sake ill be using https://github.com/mlocati/powershell-phpmanager) package manage to handle multi version instead of download the zip file manually. The reason why i want to using this package manager is because it easy for me to add new extension like how linux and mac do. For example, installing imagick on windows is such a hassle. Not to mention if you keep switching your laptop or pc it could make it hard to just install all back without any semi or automated script laying around.

@honsa
honsa / valet.conf
Created March 15, 2022 15:34 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@honsa
honsa / nginx-tuning.md
Created November 30, 2021 20:00 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@honsa
honsa / light-shader.shader
Created October 11, 2020 11:02 — forked from hiulit/light-shader.shader
Godot 3 light interact with shader
shader_type canvas_item;
uniform vec4 dawn_color : hint_color = vec4(0.86, 0.70, 0.70, 1.0);
uniform vec4 day_color : hint_color = vec4(1.0, 1.0, 1.0, 1.0);
uniform vec4 dusk_color : hint_color = vec4(0.59, 0.66, 0.78, 1.0);
uniform vec4 night_color : hint_color = vec4(0.07, 0.09, 0.38, 1.0);
uniform float brightness : hint_range(0.0, 10.0, 0.01) = 1.0;
uniform float contrast : hint_range(0.0, 10.0, 0.01) = 1.0;
uniform float saturation : hint_range(0.0, 10.0, 0.01) = 1.0;
@honsa
honsa / install-chrome-headless.sh
Created August 26, 2020 12:44 — forked from ipepe/install-chrome-headless.sh
Installing headless chrome on Ubuntu.
#!/bin/bash
# from https://chromium.woolyss.com/
# and https://gist.github.com/addyosmani/5336747
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:canonical-chromium-builds/stage
sudo apt-get update
sudo apt-get install chromium-browser
chromium-browser --headless --no-sandbox http://example.org/
@honsa
honsa / native_js_drag_and_drop_helper.js
Created August 18, 2020 13:18 — forked from druska/native_js_drag_and_drop_helper.js
Create the `simulateDragDrop` function which can be used to simulate clicking and dragging one DOM Node onto another
function simulateDragDrop(sourceNode, destinationNode) {
var EVENT_TYPES = {
DRAG_END: 'dragend',
DRAG_START: 'dragstart',
DROP: 'drop'
}
function createCustomEvent(type) {
var event = new CustomEvent("CustomEvent")
event.initCustomEvent(type, true, true, null)
@honsa
honsa / Saitek X52 Pro Flight Control System - Windows.joy
Created April 18, 2020 10:26 — forked from rafaelmartins/Saitek X52 Pro Flight Control System - Windows.joy
Saitek X52 Pro settings for X-Plane 11 (Windows) - Just download this file to 'X-Plane 11/Resources/joystick configs'
I
1100 version
JOY
OS: Windows
Name: Saitek X52 Pro Flight Control System
Display: Saitek X52 Pro
Assignments:
--------------------------------------------------------------
@honsa
honsa / xampp_php7_xdebug.md
Created March 1, 2019 08:58 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup