Skip to content

Instantly share code, notes, and snippets.

@aojea
aojea / README.md
Last active March 2, 2024 13:35
upgrade kind kubernetes cluster
@karanlyons
karanlyons / ZoomDaemon.yara
Last active July 12, 2021 14:07
Fixes for Zoom, RingCentral, Zhumu (and additional white labels) RCE vulnerabilities
private rule Macho
{
meta:
description = "private rule to match Mach-O binaries (copied from Apple's XProtect)"
condition:
uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca
}
rule ZoomDaemon
{
@nlopin
nlopin / cmd-lang.json
Last active April 11, 2020 22:09
Karabiner config: Left CMD → EN, right CMD → RU
{
"title": "Non-modal input language change",
"rules": [
{
"description": "Switch to RU",
"manipulators": [
{
"conditions": [
{
"input_sources": [
@nlopin
nlopin / input_change.json
Created June 24, 2019 13:37
Karabiner: Non modal language switch to RU and EN
{
"title": "Non-modal input language change",
"rules": [
{
"description": "Switch to RU",
"manipulators": [
{
"conditions": [
{
"input_sources": [

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

git log --all --graph --date="format:%d.%m.%Y %H:%M" --pretty="%C(auto,yellow)%h %C(green)%an <%ae> %Cblue%ad %C(auto)%d %C(reset)%s"
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab
@inhies
inhies / sigcatch.go
Last active December 14, 2015 11:38
Snippet showing how to catch common interrupts and use the HUP signal to reload your config on the fly. Note that you can not catch SIGKILL so we don't even try.
c := make(chan os.Signal, 1)
signal.Notify(c)
go func() {
for sig := range c {
switch sig {
case syscall.SIGHUP:
fmt.Println("Reloading config")
if err := parseConfig(); err != nil {
fmt.Println("Error parsing config")
fmt.Println(err)
@jboner
jboner / latency.txt
Last active July 26, 2024 04:31
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD