Skip to content

Instantly share code, notes, and snippets.

View trishmapow's full-sized avatar
🐍
__import__('ctypes').string_at(0)

Christopher Malau trishmapow

🐍
__import__('ctypes').string_at(0)
View GitHub Profile
@trishmapow
trishmapow / obs-hwaccel.sh
Last active May 12, 2023 06:10 — forked from feedsbrain/ffmpeg-qsv.sh
Compiling FFMpeg with Intel Quick Sync in Ubuntu 20.04
#!/bin/bash
# Taken from: https://red-full-moon.com/make-hevc-qsv-env-first-half/
sudo apt update
sudo apt dist-upgrade
sudo apt install cmake make autoconf automake libtool g++ bison libpcre3-dev pkg-config libtool libdrm-dev xorg xorg-dev openbox libx11-dev libgl1-mesa-glx libgl1-mesa-dev libpciaccess-dev libfdk-aac-dev libvorbis-dev libvpx-dev libx264-dev libx265-dev ocl-icd-opencl-dev pkg-config yasm libx11-xcb-dev libxcb-dri3-dev libxcb-present-dev libva-dev libmfx-dev intel-media-va-driver-non-free opencl-clhpp-headers
mkdir ~/git && cd ~/git
git clone https://github.com/intel/libva
cd libva
@trishmapow
trishmapow / ubuntu-vnc-activate-remote.sh
Created December 15, 2022 02:06 — forked from samba/ubuntu-vnc-activate-remote.sh
Activate VNC support in Ubuntu, from command-line (for active sessions)
#!/bin/sh
# This assumes you have access to the system via SSH already, and need
# remote VNC access as the same user, and you want only the primary display.
export DISPLAY=:0
# Encoded password with http://www.motobit.com/util/base64-decoder-encoder.asp
export VNC_PASSWORD="dm5jX3Bhc3N3b3JkNzE=" # vnc_password71
export VNC_PASSWORD="dm5jX3Bhc3M=" # vnc_password (a character limit is enforced?)
# Sadly many common VNC clients don't support encryption.
Processor Passmark scores
J4115 - 2715 10W
J4125 - 3054 10W
J5005 - 3080 10W
N4100 - 2451 6W
Z8350 - 915
Prices in AUD
LarkBox - J4115, 6/128, uSD, USB-C, 3.0x2
5.1V 1.0A 5.1W
30000mAh power bank discharging
80% 09:47
75% 11:01
66% 12:53
46% 17:10
~103Wh
charging
8.8V 2.1A 18.5W
@trishmapow
trishmapow / exchanges.py
Last active August 18, 2018 15:09
Nimiq Exchange Info
import requests
from bs4 import BeautifulSoup
from tabulate import tabulate
data = []
try:
ex = requests.get("https://coinmarketcap.com/currencies/nimiq/#markets",
timeout=10)
price = requests.get("https://api.coinmarketcap.com/v2/ticker/2916?convert=BTC",
timeout=10)
@trishmapow
trishmapow / Q_rsqrt.c
Last active May 14, 2017 11:00
Fast Inverse Square Root (Quake III Arena)
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // Store physical representation of bits
i = 0x5f3759df - ( i >> 1 ); // Make an initial guess