Skip to content

Instantly share code, notes, and snippets.

View rigred's full-sized avatar

Rigo rigred

View GitHub Profile
@rigred
rigred / rocm_5.0_matrix.md
Created February 18, 2022 20:13
ROCM 5.0 AMD GPU feature matrix
cap gfx000 gfx803 gfx900 gfx906 gfx908 gfx90a gfx1010 gfx1011 gfx1012 gfx1030
HasMFMA_bf16_1k 0 0 0 0 0 1 0 0 0 0
HasAddLshl 0 0 1 1 1 1 1 1 1 1
HasAtomicAdd 0 0 0 0 1 1 0 0 0 0
HasCodeObjectV3 0 1 1 1 1 1 1 1 1 1
HasDirectToLds 0 1 1 1 1 1 1 1 1 1
HasExplicitCO 0 0 1 1 1 1 1 1 1 1
HasExplicitNC 0 0 0 0 0 0 1 1
@rigred
rigred / README.md
Last active January 22, 2021 10:35
Script to set date/time of macbook without a battery

Copy the launch daemon file named com.startup.script.plist in /Library/LaunchDaemons. Then set the permissions for it

sudo chmod +x /Library/LaunchDaemons/com.startup.script.plist
sudo chown root:wheel /Library/LaunchDaemons/com.startup.script.plist

Next copy the shell script updatetime.sh in /usr/local/bin/. Make it executable with sudo chmod +x /usr/local/bin/updatetime.sh and owned by root:wheel with sudo chown root:wheel /usr/local/bin/updatetime.sh.

Enable and launch the Daemon with:

@rigred
rigred / get_playtime.js
Created June 5, 2020 11:38
Get playtime of a youtube playlist
var list = document.getElementsByClassName('ytd-thumbnail-overlay-time-status-renderer');
var time = 0;
function toS(hms) {
var a = hms.split(':');
while (a.length < 3) {
a.unshift(0);
}
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
return seconds;
Doing md4 for 3s on 16 size blocks: 21912727 md4's in 3.00s
Doing md4 for 3s on 64 size blocks: 16415248 md4's in 3.00s
Doing md4 for 3s on 256 size blocks: 9205399 md4's in 3.00s
Doing md4 for 3s on 1024 size blocks: 3410651 md4's in 3.00s
Doing md4 for 3s on 8192 size blocks: 489747 md4's in 3.00s
Doing md4 for 3s on 16384 size blocks: 248924 md4's in 3.00s
Doing md5 for 3s on 16 size blocks: 28673396 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: 16591487 md5's in 3.00s
Doing md5 for 3s on 256 size blocks: 7269859 md5's in 3.00s
Doing md5 for 3s on 1024 size blocks: 2244337 md5's in 3.00s
@rigred
rigred / my.na_filter.txt
Last active February 19, 2020 19:53
Ublock filter to remove my.na login modal from namibian news sites.
www.republikein.com.na###payModal
www.republikein.com.na##.in.fade.modal-backdrop
www.republikein.com.na###pre_load
www.republikein.com.na##script:contains(function run_validate_access(){)
www.az.com.na###payModal
www.az.com.na##.in.fade.modal-backdrop
www.az.com.na###pre_load
www.az.com.na##script:contains(function run_validate_access(){)
@rigred
rigred / PCI-e_bus_bandwidth_calc.md
Last active June 15, 2023 13:10
PCI-e bus bandwidth calculation

How PCI-e bandwidth and actual true data bandwidth can be calculated.

PCI-e 1.x uses an 8/10b encoding scheme, so to send 8 bits of data, 10 bits of encoded data must be transfered. 2 of those bits are there as error checking and correction bits to account for interference which is very common on fast buses. SATA btw also uses 8b/10b encoding, you loose 20% of bandwidth (1-8/10) to get the data across.

PCI-e 1.0 is clocked at 2.5Ghz, it sends 1 bit per clock cycle and each lane corresponds to a 1 bit bi-directional serial channel. Which is kind of neat since here 'Gigatransfers' indicate 1 bit transfered for every clock cycle. This should immediately tell us that unlike FSB which transfers multiple bts per cycle in a parallel fashion, PCI-e is serial, since we are sequentially throwing 1 bit of data per cycle onto the bus and it takes multiple cycles to send a full byte. While on a parallel bus multiple bytes can be sent per cycle.

@rigred
rigred / PKGBUILD rocminfo
Created August 20, 2019 10:36
PKGBUILD for rocminfo 2.7.0
# Maintainer: Jakub Okoński <jakub@okonski.org>
# Maintainer: Rigo Reddig <rigo.reddig@gmail.com>
pkgname=rocminfo
pkgver=2.7.0
pkgrel=1
pkgdesc="ROCm info tools - rocm_agent_enumerator"
arch=(x86_64)
url="https://github.com/RadeonOpenCompute/rocminfo"
license=('NCSA')
makedepends=(git cmake ninja)
@rigred
rigred / PKGBUILD rocm-cmake
Created August 20, 2019 09:52
PKGBUILD rocm-cmake (release)
# Original build: fermyon <antifermion@protonmail.com>
# Maintainer: Jakub Okoński <jakub@okonski.org>
# Maintainer: Rigo Reddig <rigo.reddig@gmail.com>
pkgname=rocm-cmake
pkgver=2.7.0
pkgrel=1
pkgdesc="cmake modules for common build tasks needed for the ROCM software stack"
arch=(x86_64)
url="https://github.com/RadeonOpenCompute/rocm-cmake"
license=(MIT)
@rigred
rigred / PKGBUILD hcc
Created August 20, 2019 09:27
PKGBUILD for ROCm hcc - should be easily updateable with just a pkgver increment and updpkgsums
# Submitter: Olaf Leidinger <oleid@mescharet.de>
# Maintainer: Jakub Okoński <jakub@okonski.org>
# Maintainer: Rigo Reddig <rigo.reddig@gmail.com> ;)
pkgname=hcc
pkgver=2.7.0
pkgrel=1
pkgdesc="HCC is an Open Source, Optimizing C++ Compiler for Heterogeneous Compute"
arch=('x86_64')
url="https://github.com/RadeonOpenCompute/hcc"
license=('NCSAOSL')
@rigred
rigred / brutal_doom_rc10.patch
Last active May 16, 2019 10:35
aur brutal doom RC10 patch
diff --git a/PKGBUILD b/PKGBUILD
index 7522de9..15b800d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,8 @@
# Maintainer: ProfessorKaos64 <mdeguzis@gmail.com>
+# Contributor: zer0def <zer0def on freenode>
# Mod: http://www.moddb.com/mods/brutal-doom
pkgname=brutal-doom
-pkgver=21.2018.02.24