Skip to content

Instantly share code, notes, and snippets.

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

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

@GetVladimir
GetVladimir / Force-RGB-Color-on-M1-Mac.md
Last active April 18, 2024 02:33
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

@fnky
fnky / ANSI.md
Last active April 18, 2024 02:33
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@leocomelli
leocomelli / git.md
Last active April 18, 2024 02:32
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@ts-sz
ts-sz / reset-proxmox-cluster.sh
Created September 29, 2021 18:21 — forked from nderjung/reset-proxmox-cluster.sh
Reset proxmox cluster
#/bin/bash -xe
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
sqlite3 /var/lib/pve-cluster/config.db "delete from tree where name = 'corosync.conf';"
@stuartw1
stuartw1 / install-openvpn3-kali.sh
Last active April 18, 2024 02:26
install openvpn3 and dependencies on Kali Linux
#!/bin/bash
# The following commands should install openvpn3 successfully on Kali Linux as of 2023-10-11
# Please check libssl1.1 version is newest at https://packages.debian.org/bullseye/amd64/libssl1.1
# PM me if broken and I will update
# Thanks to the following for bug reports / additions
# asingh-lp, Pyr0technicien
# update packages
sudo apt update
@tothi
tothi / ms-msdt.MD
Last active April 18, 2024 02:22
The MS-MSDT 0-day Office RCE Proof-of-Concept Payload Building Process

MS-MSDT 0-day Office RCE

MS Office docx files may contain external OLE Object references as HTML files. There is an HTML sceme "ms-msdt:" which invokes the msdt diagnostic tool, what is capable of executing arbitrary code (specified in parameters).

The result is a terrifying attack vector for getting RCE through opening malicious docx files (without using macros).

Here are the steps to build a Proof-of-Concept docx:

  1. Open Word (used up-to-date 2019 Pro, 16.0.10386.20017), create a dummy document, insert an (OLE) object (as a Bitmap Image), save it in docx.
@en4rab
en4rab / ssh-fingerprints-2023.csv
Created April 13, 2023 17:10
Top 1,000 Duplicate SSH Fingerprints on the Internet from Shodan Apr 2023
1a:0d:78:24:96:30:e4:91:ee:1c:48:b6:1c:ca:c2:c7 455170
d8:0e:4d:d3:d7:00:d7:aa:8f:69:9f:ec:af:90:b3:16 132730
2f:1c:34:c9:4c:56:12:6c:ce:f2:10:ee:0f:3e:41:fe 44924
6d:d5:3a:e0:17:75:7a:61:8f:85:c0:fc:b2:59:69:db 38746
8b:75:88:08:41:78:11:5b:49:68:11:42:64:12:6d:49 31444
78:e3:c6:d0:2d:4c:f8:3e:87:8c:bf:34:d6:72:6f:46 20839
c4:7a:4e:5c:36:d0:12:42:1b:3f:2d:96:28:ec:4e:5d 17815
3e:75:5f:41:69:d1:67:42:5e:d1:03:db:c8:04:90:84 17149
e5:f0:4b:35:d1:61:e4:c1:4d:6c:76:41:30:fb:53:ff 16576
18:f1:bf:c6:bd:54:0c:d6:8d:5c:d8:88:9a:76:81:24 15983
@cliffordp
cliffordp / auto-open-ghl-chat-widget.js
Last active April 18, 2024 02:18
Automatically open (and keep open) the GoHighLevel chat widget
<script>
// For a HighLevel webpage (funnel or website) that is meant to be a dedicated chatting area.
// Copy all of this and paste into your custom code, such as in the Footer Tracking area.
// This snippet: https://gist.github.com/cliffordp/1428be81a842d5b93c793d2d5b967007
// Source demo: https://10xmarketing.ai/10x-chatbot-widget
function openChatWidget() {
// Check if Chat Widget exists.
if (window.leadConnector && window.leadConnector.chatWidget) {
// If it exists, open it.
window.leadConnector.chatWidget.openWidget();
@Digital39999
Digital39999 / kickPusherTypes.ts
Last active April 18, 2024 02:17
Keep in mind that some of those might also be partial.
export type PusherEvents = {
// 'channel.id';
channel: {
FollowersUpdated: {
followersCount: string | number
channel_id: number
username: unknown
created_at: number
followed: boolean
}