Skip to content

Instantly share code, notes, and snippets.

@Scherlac
Scherlac / ssh-copy.ps1
Last active December 4, 2023 21:40
This is a powershell script to copy the ssh key to a remote host
<#
.SYNOPSIS
This is a powershell script to copy the ssh key to a remote host
.DESCRIPTION
This is a powershell script to copy the ssh key to a remote host
@hpchang
hpchang / Good taste.md
Last active May 11, 2019 09:27 — forked from santisbon/Good taste.md
What makes good taste?

On Good Taste

Linus Torvalds in an interview talked about the idea of good taste in code or what I like to call elegance. As one might expect from two slides meant to make a point during a talk, he omits a lot of details to keep it short and simple. This post digs into the specifics of his example (deleting an element from a list) and adds another example (inserting an element in a list) including working code.

Example from Linus

This is an example of removing an element from a singly-linked list. It's one of the first data structures you learn about when you start learning about computer science and programming. The reason it doesn't show particularly good taste is because we have that condition at the end where we take a different action depending on whether the element we want to remove is at the beginning of the list or somewhere in the middle.

![Bad taste](http://

@lnattrass
lnattrass / get_tds_cert.py
Last active June 28, 2024 20:35
A terrible way to connect to MS SQL Server and dump the certificate as a PEM
import sys
import pprint
import struct
import socket
import ssl
from time import sleep
# Standard "HELLO" message for TDS
prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20,
0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00,
@Rangozhang
Rangozhang / .tmux.conf
Last active May 13, 2023 05:46 — forked from atelic/tmux.conf
A vim-friendly tmux config
# change prefix to Ctrl-a (like in gnu-screen)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# start with window 1 (instead of 0)
set -g base-index 1