Skip to content

Instantly share code, notes, and snippets.

@benduran
benduran / Set MTU size in WSL to fix discrepancies between VPN clients on Windows Host and the WSL machine.md
Created March 15, 2022 20:49
Set MTU size in WSL to fix discrepancies between VPN clients on Windows Host and the WSL machine

Update MTU without entering a password¶

This corrects issues you might have with various VPN Clients having discrepancies with MTU size between WSL and the Windows Host.

Create a file /usr/local/sbin/mtu and add the following:

#!/bin/bash

ip link set dev eth0 mtu 1400
@Nillth
Nillth / Convert-PemtoX509.ps1
Last active August 1, 2024 15:13
PowerShell function to Convert PEM files to X509 (PFX) Certificate
<#
.NOTES
===========================================================================
Created by: Marc Collins ([email protected])
Organization: Qlik Professional Services
Filename: Convert-PemtoX509.ps1
===========================================================================
.DESCRIPTION
Converts PEM files to X509 Certificates
Can be used with QlikClient.pems
@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active May 2, 2025 14:52
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active May 11, 2025 03:31
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@elovelan
elovelan / Get-ParameterValues.ps1
Created October 10, 2018 19:05 — forked from Jaykul/Get-ParameterValues.ps1
Rather better than `$PSBoundParameters`
function Get-ParameterValues {
<#
.Synopsis
Get the actual values of parameters which have manually set (non-null) default values or values passed in the call
.Description
Unlike $PSBoundParameters, the hashtable returned from Get-ParameterValues includes non-empty default parameter values.
NOTE: Default values that are the same as the implied values are ignored (e.g.: empty strings, zero numbers, nulls).
.Link
https://gist.github.com/Jaykul/72f30dce2cca55e8cd73e97670db0b09/
.Link
@JohnRoos
JohnRoos / Invoke-RestMethod with cookie and header.ps1
Last active June 19, 2024 18:30
Invoke-RestMethod with cookies and headers
@gasparnagy
gasparnagy / SetupStepArgumentConverterForAssist.cs
Created December 21, 2015 08:05
Configure SpecFlow v2 Assist Table helpers to use [StepArgumentTransformation] extensions
/// <summary>
/// Sets the step argument conversion infrasuructure as default for CreateSet and CreateInstance
/// </summary>
/// <remarks>
/// This method has to be called once, in a static ctor for example. Note: this way of setting is not
/// supported for parallel execution.
/// </remarks>
private static void SetupStepArgumentConverterValueRetriever()
{
var assistService = TechTalk.SpecFlow.Assist.Service.Instance;

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

function! RandomNumber(limit)
let components = split(reltimestr(reltime()), '\.')
let microseconds = components[-1] + 0
return microseconds % a:limit
endfunction
function! RandomScheme()
let choices = []
for fname in split(globpath(&runtimepath, 'colors/*.vim'), '\n')
let name = fnamemodify(fname, ':t:r')
@jokecamp
jokecamp / gist:2c1a67b8f277797ecdb3
Last active March 25, 2025 14:49
Powershell HMAC SHA 256 Example
# Powershell HMAC SHA 256
$message = 'Message'
$secret = 'secret'
$hmacsha = New-Object System.Security.Cryptography.HMACSHA256
$hmacsha.key = [Text.Encoding]::ASCII.GetBytes($secret)
$signature = $hmacsha.ComputeHash([Text.Encoding]::ASCII.GetBytes($message))
$signature = [Convert]::ToBase64String($signature)