Skip to content

Instantly share code, notes, and snippets.

View axelitus's full-sized avatar
🎯
Focusing

Axel Pardemann axelitus

🎯
Focusing
View GitHub Profile
@WillianTomaz
WillianTomaz / wsl2-with-1password-info.md
Last active April 22, 2024 04:08
Instructions for using 1Password SSH Agent with WSL2 (on Windows 11)

Saturday, April 22, 2023

How to Use 1Password SSH Agent with WSL2 (on Windows 11)

  • Note:

    • Always look for the official documentation, this tutorial may not suit you as there are new updates to the installation process.
    • References are at the end of the document.
  • Was used:

    • Windows 11 (x64)
    • WSL 2 (Ubuntu 22.04.2 LTS)
@flaki
flaki / docker-to-proxmox.md
Created February 7, 2023 21:36
Importing a Docker container image into Proxmox Linux Containers (LXC)

Importing a Docker container into Proxmox/LXC

Importing the container

For this we are going to be using lxc-create, which comes pre-installed on Proxmox but needs further dependencies to fetch the OCI images from Docker:

apt update && apt -y install skopeo umoci jq
@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@marcmascort
marcmascort / .phpcs.xml
Last active June 30, 2020 11:29
phpcs compatible to phpinsights
<ruleset name="PHP_Codeer" xsi:noNamespaceSchemaLocation="phpcs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<description>The coding standard for PHP_Codeer itself.</description>
<!-- Files -->
<file>bin</file>
<file>src</file>
<!-- Excludes -->
<exclude-pattern>vendor/</exclude-pattern>
@andypa
andypa / pushlock
Created May 9, 2019 11:15
execute composer update and directly commit the composer.lock and push it
alias pushlock='COMPOSER_DISCARD_CHANGES=stash composer update --no-interaction && git add composer.lock && git commit -m "[UPDATE] composer.lock" && git push'
@mhofman
mhofman / HAProxy-transparent-web-services-routing.md
Last active April 4, 2024 01:20
Leverage HAProxy to transparently route requests to web services identified by host name.

Web Service Fronting

Multiple Web properties on a single IP address

Hosting multiple websites on a single public IP address on the standard HTTP(S) ports is relatively easy with popular web servers like Apache, Nginx and lighttpd all supporting Virtual Hosts.
For Web Services which bundle their own HTTP server, things get more complicated, unless their HTTP stack can be shared somehow. More often than not, the application's HTTP stack listens directly on a dedicated TCP port.

Hosting multiple services on a single IP then requires using a fronting server listening on the standard HTTP port, and routing to the right backend service based on the host name or the path sent by the client.
Path based routing is cumbersome, usually requiring either the service to be aware of the path prefix, or a rewrite by the HTTP fronting server of all absolute URLs in the requests and responses.
Hostname based routing is more straightforward. The fronting server can just look at the [HTTP/1.1 Host header](https://tools

@kasperkamperman
kasperkamperman / fixwrongutf8encoding.php
Created July 3, 2018 11:58
Function to fix ut8 special characters displayed as 2 characters (utf-8 interpreted as ISO-8859-1 or Windows-1252)
<?php header('Content-Type: text/html; charset=utf-8'); ?>
<html>
<head>
<title>Fix wrong encoded UTF8 characters</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body>
<pre>
<?php
/* Problem description:
@zakkak
zakkak / .git-commit-template
Last active March 21, 2024 14:26 — forked from adeekshith/.git-commit-template.txt
This commit message template that helps you write great commit messages and enforce it across your team.
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char)
# |<---- Preferably using up to 50 chars --->|<------------------->|
# Example:
# [feat] Implement automated commit messages
# (Optional) Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# (Optional) Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active April 25, 2024 13:38
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages