Skip to content

Instantly share code, notes, and snippets.

View jsturtevant's full-sized avatar
💻
right clicking and viewing the source

James Sturtevant jsturtevant

💻
right clicking and viewing the source
View GitHub Profile
@MarkusObrist
MarkusObrist / git-mergetool-winmerge-setup.sh
Created June 6, 2011 13:28 — forked from adilsoncarvalho/git-mergetool-winmerge-setup.sh
shell script that configures git to use WinMerge as the default tool to handle conflicts
#!/bin/sh
#
# This script will make WinMerge your default tool for diff and merge.
# It must run inside git bash (on Windows)
#
# If your WinMerge is in other place then this one, please edit
WINMERGE_SCRIPT="winmerge-merge.sh"
@jbgo
jbgo / git-recover-branch.md
Last active May 23, 2024 12:29
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 4, 2024 17:58
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@codingoutloud
codingoutloud / make-keys.bat
Last active August 3, 2023 19:05
Handy OpenSSL command-line combinations I've used - they might've been hard to find or come up with, so capturing them here.
@echo off
if _%1_==__ goto USAGE
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/CN=My Cert Name"
openssl pkcs12 -export -out mycert.pfx -inkey mycert.pem -in mycert.pem -passout pass:%1
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer
openssl pkcs12 -in mycert.pfx -nodes -passin pass:%1 | openssl x509 -noout -fingerprint
openssl x509 -in mycert.pem -noout -fingerprint
@cridenour
cridenour / gist:74e7635275331d5afa6b
Last active August 7, 2023 13:52
Setting up Vim as your Go IDE

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

@kstrauss
kstrauss / Additional Notes
Last active December 14, 2021 01:28
Example of publishing simple ETW events (no manifest and therefore EventLog) and consuming them in a realtime fashion
All need the Microsoft.Diagnostics.Tracing.TraceEvent nuget package
Shows how you can both produce some simple ETW events (these are not written to the eventlog)
A couple of ways to consume said events.
1. using standard tooling like perfview, xperf, etc.
2. create your own EventListener class as demonstrated by ProducerAndSimpleListener, which allows you to do pretty much anything
3. listen in realtime as done in RealTimeListener
4. Others do similar things I believe like tx.windows
@guitarrapc
guitarrapc / Get-EtwTraceProvider.ps1
Last active June 16, 2024 15:05
ETW (Event Tracing for Windows) Providers and their GUIDs for Windows 10 x64
#Requires -RunAsAdministrator
#Requires -Version 5.0
# requires Windows 10
Get-EtwTraceProvider | Select-Object SessionName, Guid | sort SessionName
# as Markdown
<#
#Requires -RunAsAdministrator
$result = Get-EtwTraceProvider | sort SessionName
$result | %{"|Name|GUID|";"|----|----|";}{"|$($_.SessionName)|$($_.Guid)|"}
#>
@ianphil
ianphil / DockerNetworkHack.sh
Created June 23, 2016 20:03
I was in meetings all day and used that time to learn a little about Docker Networks.
#
# Learn About Docker Networks
# github/tripdubroot
# Docker version 1.12.0-rc2
# build 906eacd
# experimental
#
# https://docs.docker.com/engine/userguide/networking/dockernetworks/#docker-embedded-dns-server
# https://docs.docker.com/engine/userguide/networking/configure-dns/
# https://github.com/docker/libnetwork/blob/ed311d050fda7821f2e7c53a7e08a0205923aef5/resolver.go
@zaenk
zaenk / .0-packer-ansible-wls.md
Last active June 19, 2024 21:51
Packer, Hyper-V, Ansible, Windows, WLS

Create Linux images on Windows with Packer

Prerequisites:

  • Windows 10 Pro
  • WLS, Ubuntu 16.04 (a.k.a.: Bash on Ubuntu on Windows)
  • Hyper-V
  • Packer (1.0.0, added to path)
  • Ansible (2.3.0, installed on WSL)
  • qemu-img (2.3.0, added to path)
@squat
squat / azure-vxlan.md
Last active April 23, 2021 04:27
Debugging VXLAN issues on Azure

Azure VXLAN Issues

Introduction

Between June 24-25, the nodes in Tectonic clusters running on Azure automatically updated the OS from Container Linux 1353.8.0 to 1409.2.0. After this upgrade, the nodes began to experience increased latency and failure rate in requests. Interestingly, we found that the size of the HTTP request played a role in determining the success of requests to services running on the Kubernetes cluster. We found that setting the client's interface's MTU to 1370 made all requests succeed; incrementing the MTU to 1371 caused the failure of large HTTP requests to resurface. Additionally, enabling TCP MTU probing on the clients ensured all requests would succeed, albeit with increased latency. In order to identify the minimum set of circumstances needed to reproduce the issue, I ran several tests involving different network topologies.