Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#define da_append(xs, x) \
do { \
if ((xs)->count >= (xs)->capacity) { \
if ((xs)->capacity == 0) (xs)->capacity = 256; \
else (xs)->capacity *= 2; \
(xs)->items = realloc((xs)->items, (xs)->capacity*sizeof(*(xs)->items)); \
} \
@peppergrayxyz
peppergrayxyz / qemu-vulkan-virtio.md
Last active December 26, 2024 17:28
QEMU with VirtIO GPU Vulkan Support

QEMU with VirtIO GPU Vulkan Support

With its latest reales qemu added the Venus patches so that virtio-gpu now support venus encapsulation for vulkan. This is one more piece to the puzzle towards full Vulkan support.

An outdated blog post on clollabora described in 2021 how to enable 3D acceleration of Vulkan applications in QEMU through the Venus experimental Vulkan driver for VirtIO-GPU with a local development environment. Following up on the outdated write up, this is how its done today.

Definitions

Let's start with the brief description of the projects mentioned in the post & extend them:

@spundun
spundun / gist:f01346a8d8789be861597690c7a849b8
Last active December 26, 2024 17:28 — forked from Usulyre/Vulkan virtio driver for Chrome OS crostini
How to install vulkan drivers on Debian on Crostini

Compiling/installing the experimental mesa virtio-venus-experimental driver-(below done with new linux container)

In chrome browser type or paste

chrome://flags

type in "search flags" box "crostini" without quotes.

@ctolsen
ctolsen / curl_to_ab.py
Last active December 26, 2024 17:27
"Copy to cURL" in Chrome to Apache Bench command
#!/usr/bin/env python3
import sys
import os
def curl_to_ab(curl_cmd: list, num: int=200, cur: int=4) -> str:
"""
Translate a cURL command created by Chrome's developer tools into a
command for ``ab``, the ApacheBench HTTP benchmarking tool.
@jeremycochoy
jeremycochoy / fft-ios.swift
Created February 7, 2020 20:41
How to use Apple's Accelerate FFT in swift
//
// MIT LICENSE: Copy past as much as you want :)
//
// Your signal, array of length 1024
let signal: [Float] = (0 ... 1024)
// --- INITIALIZATION
// The length of the input
length = vDSP_Length(signal.count)
@nuckle
nuckle / README.md
Last active December 26, 2024 17:26
Simple user script to make reddit chats usable in browsers on mobile devices

What does this script do?

Also publised at greasyfork

Note: this script has been migrated to a browser extension format

Well, it fixes reddit chat (chat.reddit.com) for mobile devices.

Tested only for DMs (no group chats, channels or threads)

@HelgeSverre
HelgeSverre / gist:33361e8a283624dfbbd6
Created January 12, 2015 14:47
Tetris Powershell Song
powershell [Console]::Beep(658, 125); [Console]::Beep(1320, 500); [Console]::Beep(990, 250); [Console]::Beep(1056, 250); [Console]::Beep(1188, 250); [Console]::Beep(1320, 125); [Console]::Beep(1188, 125); [Console]::Beep(1056, 250); [Console]::Beep(990, 250); [Console]::Beep(880, 500); [Console]::Beep(880, 250); [Console]::Beep(1056, 250); [Console]::Beep(1320, 500); [Console]::Beep(1188, 250); [Console]::Beep(1056, 250); [Console]::Beep(990, 750); [Console]::Beep(1056, 250); [Console]::Beep(1188, 500); [Console]::Beep(1320, 500); [Console]::Beep(1056, 500); [Console]::Beep(880, 500); [Console]::Beep(880, 500); sleep -m 250; [Console]::Beep(1188, 500); [Console]::Beep(1408, 250); [Console]::Beep(1760, 500); [Console]::Beep(1584, 250); [Console]::Beep(1408, 250); [Console]::Beep(1320, 750); [Console]::Beep(1056, 250); [Console]::Beep(1320, 500); [Console]::Beep(1188, 250); [Console]::Beep(1056, 250); [Console]::Beep(990, 500); [Console]::Beep(990, 250); [Console]::Beep(1056, 250); [Console]::Beep(1188, 500); [
@WebSofter
WebSofter / ecosystem.config.json
Created October 28, 2019 13:47
Run laravel artisian serve script via pm2
{
"apps": [{
"name": "laravel-app",
"script": "artisan",
"args": ["serve", "--host=0.0.0.0", "--port=3333"],
"instances": "1",
"wait_ready": true,
"autorestart": false,
"max_restarts": 1,
"interpreter" : "php",
@sheepla
sheepla / 小さな道具を組み合わせてWayland環境でスクリーンショット/スクリーンキャストを撮る.md
Last active December 26, 2024 17:25
小さな道具を組み合わせてWayland環境でスクリーンショット/スクリーンキャストを撮る

📸小さな道具を組み合わせてWayland環境でスクリーンショット/スクリーンキャストを撮る

長らくX11とi3wmを使っていたが、重い腰を上げてWaylandに入門してみた。

Hyprland、Sway等、wl-toolsベースのWaylandコンポジタを使用している場合、スクリーンショット/スクリーンキャストを撮るには、grimwf-recorder 等のツールを使う。 小さなユーティリティを柔軟に組み合わせて目的を達成するやり方が面白かったのでここにメモする。

各種ユーティリティをインストールする

@s0j0hn
s0j0hn / mandros3.py
Created April 16, 2020 16:07 — forked from xassiz/mandros.py
Reverse MSSQL shell
import sys
import requests
import threading
import base64
from html.parser import HTMLParser
from http.server import BaseHTTPRequestHandler, HTTPServer
'''
Description: Reverse MSSQL shell through xp_cmdshell + certutil for exfiltration
Author: @xassiz