Skip to content

Instantly share code, notes, and snippets.

View Brainiarc7's full-sized avatar

Dennis E. Mungai Brainiarc7

View GitHub Profile
@flisboac
flisboac / fix-intel_wifi_aer-avell_g1513_fire_v3
Last active February 12, 2023 15:58
Temporary fix for AER's excessive `severity=Corrected` logging for Intel Wireless (Avell G1513 Fire V3) (Arch Linux)
silly gist hack, why do we need you? :(
@kmhofmann
kmhofmann / building_tensorflow.md
Last active March 2, 2024 18:37
Building TensorFlow from source

Building TensorFlow from source (TF 2.3.0, Ubuntu 20.04)

Why build from source?

The official instructions on installing TensorFlow are here: https://www.tensorflow.org/install. If you want to install TensorFlow just using pip, you are running a supported Ubuntu LTS distribution, and you're happy to install the respective tested CUDA versions (which often are outdated), by all means go ahead. A good alternative may be to run a Docker image.

I am usually unhappy with installing what in effect are pre-built binaries. These binaries are often not compatible with the Ubuntu version I am running, the CUDA version that I have installed, and so on. Furthermore, they may be slower than binaries optimized for the target architecture, since certain instructions are not being used (e.g. AVX2, FMA).

So installing TensorFlow from source becomes a necessity. The official instructions on building TensorFlow from source are here: ht

@porjo
porjo / hwaccel.md
Last active July 16, 2020 04:00
Hardware accelerated video encoding with ffmpeg

Using ffmpeg-3.1.6-1.fc25.x86_64 on Fedora 25, available from rpmfusion-free repo. It has been built with va-api support.

The following ffmpeg invocation works for me.

ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 \
   -i input.mkv -vf 'format=nv12,hwupload' -map 0:0 -map 0:1 -threads 4 \
   -acodec copy -vcodec h264_vaapi -qp:v 23 \
   output.mp4
@churro-s
churro-s / LetsEncrypt_HTTPS_plex.MD
Last active February 25, 2024 11:52
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
@yashi
yashi / gst-dynamic-pad.c
Last active May 10, 2021 02:25
An Example for GStreamer Dynamic Pad (Decodebin)
#include <gst/gst.h>
static gboolean bus_call (G_GNUC_UNUSED GstBus *bus, GstMessage *msg, gpointer data)
{
GMainLoop *loop = (GMainLoop *) data;
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_EOS:
g_print ("End of stream\n");
@tondrej
tondrej / backlit.sh
Last active February 26, 2018 04:04
Clevo backlit keyboard
#!/bin/bash
BLACK=000
BLUE=001
RED=010
MAGENTA=011
GREEN=100
AQUA=101
YELLOW=110
WHITE=111
@cnlohr
cnlohr / htc_vive_watchman_codes
Last active June 22, 2017 19:40
HTC Vive Watchman Hacking Codes!
So, the way this goes is I post my AVR code, then I post what the HTC Vive does.
The output is: POST 0: (# of bytes) (IMU Timecode MSBs) (All raw light data)
(All raw light data ends with [3 bytes, LSB timecode] [OTA CRC (probably ignore)])
Events (TIME): (LED CODE 1)/(TIME CODE 1/TIMECODE 2)/(LED CODE 2)/(TIME CODE 3/TIMECODE 4)...
//NOTICE: The funky encoding of the numbers, and the fact that paramters are read from the end of the data going forward.
//We know we're done when the # of parameters read is (# of bytes left*2)-1
@Brainiarc7
Brainiarc7 / pbis_centos7.txt
Created November 4, 2015 08:15 — forked from vikas027/pbis_centos7.txt
Fix PowerBroker Identity Service (formerly Likewise) on CentOS 7
PBIS (PowerBroker Identity Service) throws some errors while installing v8.2.2 (latest as of 25 June 2015) rpm.
[root@centos7 ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@centos7 ~]# ./pbis-open-8.2.2.2993.linux.x86_64.rpm.sh install (This is filtered output)
...
...
Error: /usr/bin/systemctl enable /etc/pbis/redhat/lwsmd.service returned 1
Failed to issue method call: Unit /etc/pbis/redhat/lwsmd.service does not exist.
@tobert
tobert / smartctl-a-hdd
Created July 7, 2015 21:10
smartctl -a on an HDD and SSD
atobey@brak ~ $ sudo smartctl -a /dev/sda
smartctl 6.4 2015-06-04 r4109 [x86_64-linux-4.0.1-1-ARCH] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: SEAGATE
Product: ST9500430SS
Revision: DS04
User Capacity: 500,107,862,016 bytes [500 GB]
Logical block size: 512 bytes
@Brainiarc7
Brainiarc7 / PKGBUILD
Created August 17, 2014 00:23
Correct PKGBUILD for libeap on Arch Linux
pkgname=libeap
pkgver=1.5.1
pkgrel=2
pkgdesc="WiMAX EAP Library"
arch=('i686' 'x86_64')
url="http://linuxwimax.org"
license=('BSD')
depends=('openssl')
source=('http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-wireless/wpa_supplicant/files/wpa_supplicant-0.7.3-generate-libeap-peer.patch'
'http://hostap.epitest.fi/releases/wpa_supplicant-0.7.3.tar.gz')