Skip to content

Instantly share code, notes, and snippets.

Avatar

Frank Denis jedisct1

View GitHub Profile
View gist:bfd09ef7f246041b192c196af7a7ac55
diff --git a/src/Compilation.zig b/src/Compilation.zig
index b00f13581..4e21245f4 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -4474,7 +4474,7 @@ fn detectLibCIncludeDirs(
// If linking system libraries and targeting the native abi, default to
// using the system libc installation.
- if (link_system_libs and is_native_abi and !target.isMinGW()) {
+ if ((link_system_libs or target.isDarwin()) and is_native_abi and !target.isMinGW()) {
@jedisct1
jedisct1 / pureftpd shellshock.txt
Last active May 8, 2022
Pure-FTPd + external authentication handler #shellshock POC
View pureftpd shellshock.txt
$ cat > /tmp/handler.sh
#! /bin/bash
echo auth_ok:1
echo uid:42
echo gid:21
echo dir:/tmp
echo end
^D
$ chmod +x /tmp/handler.sh
@jedisct1
jedisct1 / tls-cert-hash.go
Created Nov 29, 2020
Compute the hash of a TLS certificate
View tls-cert-hash.go
package main
import (
"crypto/sha256"
"crypto/x509"
"fmt"
"io/ioutil"
)
func main() {
@jedisct1
jedisct1 / docker-cleanup-resources.md
Created Mar 28, 2019 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

View gerdar3.ru
$ drill -b 4096 any gerdar3.ru
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 18464
;; flags: qr rd ra ; QUERY: 1, ANSWER: 42, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; gerdar3.ru. IN ANY
;; ANSWER SECTION:
gerdar3.ru. 600 IN SOA ns1.spaceweb.ru. dns1.sweb.ru. 2014020929 28800 7200 604800 600
gerdar3.ru. 600 IN MX 60000 newnewnewnewnwnewnewnewnewnewnewnewnewnewnewnewnewnewnewnew.spaceweb.ru.
View relaycheck.sh
#! /bin/sh
CONFIG="/tmp/dnscrypt-proxy.toml"
TEST_SERVER="sdns://AQcAAAAAAAAADTUxLjE1LjEyMi4yNTAg6Q3ZfapcbHgiHKLF7QFoli0Ty1Vsz3RXs1RUbxUrwZAcMi5kbnNjcnlwdC1jZXJ0LnNjYWxld2F5LWFtcw"
DNSCRYPT_PROXY=~/src/dnscrypt-proxy/dnscrypt-proxy/dnscrypt-proxy
PIDFILE="/tmp/dnscrypt-proxy.pid"
relaycheck() {
stamp="$1"
{
View secp256k1.zig
//! Autogenerated: './src/ExtractionOCaml/word_by_word_montgomery' --lang Zig secp256k1 64 '2^256 - 2^32 - 977' --internal-static --public-function-case camelCase --private-function-case camelCase --no-prefix-fiat
//! curve description: secp256k1
//! machine_wordsize = 64 (from "64")
//! requested operations: (all)
//! m = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f (from "2^256 - 2^32 - 977")
//!
//! NOTE: In addition to the bounds specified above each function, all
//! functions synthesized for this Montgomery arithmetic require the
//! input to be strictly less than the prime modulus (m), and also
//! require the input to be in the unique saturated representation.
View gist:23c38853005f5dad07abca35dcddcdc2
const std = @import("std");
const big = std.math.big;
const Allocator = std.mem.Allocator;
const crypto = std.crypto;
const Managed = big.int.Managed;
const Const = big.int.Const;
const Order = std.math.Order;
fn powMod(res: *Managed, b: Const, e: Const, m: Const) !void {
@jedisct1
jedisct1 / Serializing hashes and arrays
Created Mar 31, 2011
msgpack vs json vs igbinary vs php serialize
View Serializing hashes and arrays
* Results
ruby json: 19,777,781 bytes
ruby msgpack: 14,757,439 bytes
php serialize(): 33,777,792 bytes
php igbinary: 18,757,571 bytes
php json_encode: 19,777,781 bytes
msgpack vs json (MRI 1.9.2) speed:
View chinese.txt
------------ 69.64.72.21
------------ 142.54.183.188
1oa1w.zvtbx.cn