Skip to content

Instantly share code, notes, and snippets.

View nehcuoh's full-sized avatar
🎯
Focusing

nehcuoh nehcuoh

🎯
Focusing
  • @Excetied
  • Shanghai China
View GitHub Profile
@Badel2
Badel2 / spectre.c
Last active March 12, 2023 00:18
Spectre attack example implementation
/* https://spectreattack.com/spectre.pdf */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@jaybobo
jaybobo / kibana-querying.md
Last active March 2, 2022 15:51
Using Kibana (Lucene query string syntax)

#Kibana gh The lucene query type uses LUCENE query string syntax to find matching documents or events within Elasticsearch.

Examples
status field contains active
status:active

title field contains quick or brown
title:(quick brown)

@epicserve
epicserve / redis_key_sizes.sh
Last active February 21, 2024 18:30
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}