Skip to content

Instantly share code, notes, and snippets.

@jchrisfarris
jchrisfarris / disable_security_hub_standards.sh
Last active July 8, 2023 17:51
Disable All Security Controls in Security Hub
View disable_security_hub_standards.sh
#!/bin/bash
ROLENAME=$1
if [ -z $ROLENAME ] ; then
echo "usage $0 <ROLENAME>"
exit 1
fi
while read line ; do
@rohansingh
rohansingh / README.md
Created April 5, 2021 13:26
Tidbyt LED matrix pinout
View README.md

These pinouts are formatted for use with SmartMatrix, but the pin numbers will work for any library.

@mwhite
mwhite / git-aliases.md
Last active July 8, 2023 17:43
The Ultimate Git Alias Setup
View git-aliases.md

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@kfatehi
kfatehi / _list-github-pull-requests.md
Last active July 8, 2023 17:41
list pull requests across entire organization
View _list-github-pull-requests.md
@craigmccauley
craigmccauley / ConvertFrom-MarkdownTemplate.ps1
Last active July 8, 2023 17:43
Mermaid diagrams in ADO workaround
View ConvertFrom-MarkdownTemplate.ps1
# This script file regenerates all the generated markdown files.
# This is needed because Azure DevOps (ADO) does not support mermaid charts
# in the preview pane. Once ADO supports this functionality, remove
# this script, delete the generated files, move and rename the template
# files, and update the links that are going to the generated files.
# Requires a directory structure like so
# |- docs
# |- scripts
# |- ConvertFrom-MarkdownTemplate.ps1
# |- templates
@henriksb
henriksb / Powershell download and execute one-liner
Created October 26, 2018 20:01
Quick one-liner to download and execute any file
View Powershell download and execute one-liner
powershell -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'ENTER URL' -OutFile '%appdata%\a.exe'; %appdata%\a.exe"
@manasthakur
manasthakur / plugins.md
Last active July 8, 2023 17:40
Managing plugins in Vim
View plugins.md

Managing plugins in Vim: The basics

Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo. First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git) or simply downloading it as a zip (from its GitHub page).

Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim directory by default). For example, if the layout of a plugin foo is as follows:

foo/autoload/foo.vim
foo/plugin/foo.vim
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@mdgrs-mei
mdgrs-mei / TerminalCats.ps1
Last active July 8, 2023 17:39
Cats on the terminal titles
View TerminalCats.ps1
#Requires -Modules DynamicTitle
$promptJob = Start-DTJobPromptCallback {
if ($null -eq $script:terminalCatPromptFrame) {
$script:terminalCatPromptFrame = 0
}
$script:terminalCatPromptFrame++
$isInError = $false
if ($Error[0]) {
@nledford
nledford / DNS Servers.md
Last active July 8, 2023 17:39
DNS Servers (IPv4, IPv6, DNS Over HTTPS)
View DNS Servers.md
Provider IPv4 IPv6 DNS Over HTTPS DNSSEC
CleanBrowsing
  • 185.228.168.9
  • 185.228.169.9
  • 2a0d:2a00:1::2
  • 2a0d:2a00:2::2
https://doh.cleanbrowsing.org/doh/security-filter/ Yes
Cloudflare
  • 1.1.1.1
  • 1.0.0.1
  • 2606:4700:4700::1111
  • 2606:4700:4700::1001
https://1.1.1.1/dns-query Yes
Google DNS
  • 8.8.8.8
  • 8.8.4.4
  • 2001:4860:4860::8888
  • 2001:4860:4860::8844
https://dns.google.com/resolve Yes
Hurricane Electric
  • 74.82.42.42
  • 2001:470:20::2
Omnispring
  • 208.111.1.1
  • 208.111.1.2
Yes
[Private Internet Access](https://helpdesk.privateinternetaccess.com/hc/en-us/articles/219460397-How-to-change-DNS-settings