Skip to content

Instantly share code, notes, and snippets.

View z4yx's full-sized avatar
☢️

Yuxiang Zhang z4yx

☢️
View GitHub Profile
@zingaburga
zingaburga / sve2.md
Last active April 10, 2024 06:21
ARM’s Scalable Vector Extensions: A Critical Look at SVE2 For Integer Workloads

ARM’s Scalable Vector Extensions: A Critical Look at SVE2 For Integer Workloads

Scalable Vector Extensions (SVE) is ARM’s latest SIMD extension to their instruction set, which was announced back in 2016. A follow-up SVE2 extension was announced in 2019, designed to incorporate all functionality from ARM’s current primary SIMD extension, NEON (aka ASIMD).

Despite being announced 5 years ago, there is currently no generally available CPU which supports any form of SVE (which excludes the [Fugaku supercomputer](https://www.fujitsu.com/global/about/innovation/

@lilydjwg
lilydjwg / gh-check
Last active March 18, 2024 04:43
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
@geekman
geekman / myusbgadget
Created January 17, 2017 02:47
Pi Zero multiple USB gadgets minimal example
#!/bin/bash -e
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir g && cd g
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
@takeshixx
takeshixx / hb-test.py
Last active March 9, 2024 13:37
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@bekce
bekce / README.md
Created February 21, 2017 13:36
ldap server with mysql backend

I wanted to build an LDAP server that queries a MySQL server to fetch users and check their passwords. It is mainly used for old software that does not work with custom OAuth2 providers. Redmine is an example of this.

Instructions:

  1. Create the database and table with insert.sql
@klange
klange / _.md
Last active December 2, 2023 20:36
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@darencard
darencard / gdrive_download
Created August 1, 2017 18:58
Script to download files from Google Drive using Bash
#!/usr/bin/env bash
# gdrive_download
#
# script to download Google Drive files from command line
# not guaranteed to work indefinitely
# taken from Stack Overflow answer:
# http://stackoverflow.com/a/38937732/7002068
gURL=$1
@jeamland
jeamland / gist:11284662
Created April 25, 2014 10:20
Bluetooth LE on OS X via Python
import select
import socket
import sys
import objc
from PyObjCTools import AppHelper
objc.loadBundle("CoreBluetooth", globals(),
bundle_path=objc.pathForFramework(u'/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Frameworks/CoreBluetooth.framework'))
@tgarc
tgarc / be8.patch
Last active July 14, 2019 07:07
Patch GCC ARM Embedded Toolchain for big-endian targets (simply git apply be8.patch in top directory)
From 9ba6f4c25c50ce80c9195c45df7fab9d1e1c8152 Mon Sep 17 00:00:00 2001
From: "tdos.apone" <toemossgarcia@gmail.com>
Date: Thu, 10 Dec 2015 11:03:09 -0600
Subject: [PATCH 1/2] initial big-endian attempt
---
build-toolchain.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/build-toolchain.sh b/build-toolchain.sh
/*
* linux 2.6.37-3.x.x x86_64, ~100 LOC
* gcc-4.6 -O2 semtex.c && ./a.out
* 2010 sd@fucksheep.org, salut!
*
* update may 2013:
* seems like centos 2.6.32 backported the perf bug, lol.
* jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist.
*/