Skip to content

Instantly share code, notes, and snippets.

Avatar

Axel Pardemann axelitus

View GitHub Profile
@axelitus
axelitus / port-exclusions
Last active Sep 15, 2021
Port exclusions to allow port redirection to WSL2
View port-exclusions
# Run commands in an elevated prompt
# Stop WinNAT
net stop winnat
# Docker
netsh int ipv4 add excludedportrange protocol=tcp startport=50000 numberofports=50 # Docker - extend range as needed
# Laravel Sail services
netsh int ipv4 add excludedportrange protocol=tcp startport=3000 numberofports=10 # BrowserSync
@axelitus
axelitus / build.sh
Created Apr 24, 2019
Nord Jetbrains plugin build script
View build.sh
#!/bin/bash
function main() {
echo "Creating plugin package..."
local root=$(clean_folder $(dirname $(realpath "$0")))
local path=$(prepare_package "$root")
local output="$root/nord-jetbrains.jar"
local jar=$(which jar)
if [ ! -z "$jar" ]; then
View .bash_aliases_upgrade_alias
alias upgrade="time (sudo apt update && sudo apt list --upgradable && echo -n \"Do you want to continue? [y]n: \" && read answer && if [[ -z \"\$answer\" || \"\$answer\" != \"\${answer#[Yy]}\" ]]; then (echo -e \"\e[32mUpdating packages... \e[0m\" && sudo apt full-upgrade -y); else echo -e \"\e[33mThe update has been cancelled. No change has been made. \e[0m\"; fi)"
@axelitus
axelitus / Homestead.yaml
Last active Aug 3, 2018
Homestead configuration example using vmware_esxi provider
View Homestead.yaml
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: vmware_esxi
esxi_hostname: esxi_hypervisor
esxi_username: homestead
esxi_password: "file:~/.secrets/vmware_esxi.pwd"
esxi_disk_store: storage1
@axelitus
axelitus / homestead.rb
Created Aug 3, 2018
Modified homestead script file to include vmware_esxi provider specific configurations
View homestead.rb
# Main Homestead Class
class Homestead
def self.configure(config, settings)
# Set The VM Provider
ENV['VAGRANT_DEFAULT_PROVIDER'] = settings['provider'] ||= 'virtualbox'
# Configure Local Variable To Access Scripts From Remote Location
script_dir = File.dirname(__FILE__)
# Allow SSH Agent Forward from The Box
@axelitus
axelitus / fonts.conf
Created May 22, 2018
Font config to fix display of book "Docker for PHP Developers" by Paul Redmond in Linux
View fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="family" qual="any"><string>ArialMT</string></test>
<edit name="family" mode="assign" binding="same"><string>Arial</string></edit>
</match>
<match target="pattern">
<test name="family" qual="any"><string>TimesNewRomanPSMT</string></test>
<edit name="family" mode="assign" binding="same"><string>Times New Roman</string></edit>
@axelitus
axelitus / named-uri-regex
Created Aug 24, 2012
Named regex to match and split URI's according to IETF's STD 66
View named-uri-regex
^(?#scheme)(?:(?P<scheme>[A-Za-z][A-Za-z0-9+\-.]*):)?
(?:(?#authority)//
(?#userinfo)(?:(?P<userinfo>.+)@)?
(?#host)(?P<host>(?:(?#named|IPv4)[A-Za-z0-9\-._~%]+|(?#IPv6)\[[A-Fa-f0-9:.]+\]|(?#IPvFuture)\[v[A-Fa-f0-9][A-Za-z0-9\-._~%!$&'()*+,;=:]+\])?)
(?#port)(?::(?P<port>[0-9]+))?
)?
(?#path)(?:/?(?P<path>(?:[A-Za-z0-9\-._~%!$&'()*+,;=@]+/?)*))?
(?#query)(?:\?(?P<query>[A-Za-z0-9\-._~%!$&'()*+,;=:@/?]*))?
(?#fragment)(?:\#(?P<fragment>[A-Za-z0-9\-._~%!$&'()*+,;=:@/?]*))?$
@axelitus
axelitus / gist:2045001
Created Mar 15, 2012
[PHP] FuelPHP: New Controller
View gist:2045001
<?php
/**
* Name
*
* Description
*
* @package Package
* @extends Controller
*/