Skip to content

Instantly share code, notes, and snippets.

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@olih
olih / jq-cheetsheet.md
Last active May 3, 2024 17:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active May 4, 2024 16:50
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@latkin
latkin / regexinfo.ps1
Last active April 1, 2022 01:43
Regex matching helper
<#
Dumps capture group locations and names/numbers
Example:
> regexinfo 'Jenny: 555-867-5309' '(?<name>\w+):\s+(?<phone>(?:(?<area>\d{3})-)?(\d{3}-\d{4}))'
[Jenny]: [[555]-[867-5309]]
| || |
| || 1
| |area
| phone
@SeeminglyScience
SeeminglyScience / Enter-PSSessionWithEdit.ps1
Last active May 4, 2023 03:27
Proof of concept for "psedit" working outside of PSES.
function Enter-PSSessionWithEdit {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string] $ComputerName
)
end {
$enterEventName = 'RemoteSessionEditor.Enter'
if (-not $Host.Runspace.Events.GetEventSubscribers($enterEventName)) {
using namespace System.Collections.Generic; using namespace System.Text
Add-Type -TypeDefinition '
using System;
using System.Runtime.InteropServices;
using System.Text;
public class WindowTools
{
public delegate bool EnumWindowsProc(IntPtr hWnd, int lParam);
@JustinGrote
JustinGrote / ModuleFast.ps1
Last active July 24, 2023 16:26
Bootstrap Script for a High Performance Module Installer
using namespace System.Net.Http
#requires -version 7.2
# This is the bootstrap script for Modules
[CmdletBinding(PositionalBinding = $false)]
param (
#Specify a specific release to use, otherwise 'latest' is used
[string]$Release = 'latest',
#Specify the user
[string]$User = 'JustinGrote',
#Specify the repo
@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active April 23, 2024 12:18
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