Skip to content

Instantly share code, notes, and snippets.

View Brainiarc7's full-sized avatar

Dennis E. Mungai Brainiarc7

View GitHub Profile
@Brainiarc7
Brainiarc7 / install.md
Last active September 23, 2017 09:03 — forked from k1ng440/install.md
Install geth, gubiq, go-dubaicoin on ubuntu

install build tool and go lang

sudo apt-get update
sudo apt-get install build-essential
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install -y golang-go

Go Ethereum

@Brainiarc7
Brainiarc7 / bf3-4-bf1-cpu-perf-fix-via-fps-cap.md
Created July 16, 2017 04:08
Fix for excessive processor load caused by Battlefield titles running on the Frostbite engine: Frame capping via a user provided user.cfg file

Fix for excessive processor load caused by Battlefield titles running on the Frostbite engine:

Ensure that the file user.cfg exists under the main directory of the Battlefield title's installation. The file contains a console command executed on game launch that frame caps the game.

Example:

If Battlefield 4 is installed at D:/Games/origin/BF4,

Then place the file there.

#!/bin/bash
#
# Copyright (c) 2014, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@Brainiarc7
Brainiarc7 / SCTE35 Decoder
Created July 7, 2017 14:12 — forked from alastairmccormack/SCTE35 Decoder
SCTE-35 Parser/Decoder in Python
#!/usr/bin/python
'''
SCTE-35 Decoder
The MIT License (MIT)
Copyright (c) 2014 Al McCormack
@Brainiarc7
Brainiarc7 / pitcairn_linux_clock_fix.md
Created June 25, 2017 02:01 — forked from Francesco149/pitcairn_linux_clock_fix.md
Gain massive GPU performance for Southern Islands AMD GPUs on Linux by removing DPM quirks in the kernel

Gain massive GPU performance for Southern Islands AMD GPUs on Linux by removing DPM quirks in the kernel

I recently found out that my r9 270x GPU was not hitting full clock speeds because it was being throttled by the kernel based on old bug reports on DPM stability. This was an easy fix on gentoo where recompiling the kernel is trivial, but on ubuntu and similar, rebuilding the kernel is not so straightforward, so here's a guide based on ubuntu 16.04 LTS. If you run gentoo or know what you're doing you can just skip to the relevant code.

On my r9 270x, this resulted in an overall improvement in frame-rates of up to 50%: Unigine Valley went from something like 30-40 fps average to 55-60 and osu! (running in wine) went from 0.33 ms (~3000fps) to 0.25ms (~4000fps).

Note that I'm no linux god and all this info was pieced together by googling and asking on forums (credits to the guys at phoronix for pointing me to the quirks code).

If you're using the proprietary amdgpu-pro driver, read until the end of the

<?php
/*
Made by Kudusch (blog.kudusch.de, kudusch.de, @Kudusch)
---------
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
@Brainiarc7
Brainiarc7 / ffmpeg-vp8&9-encode-test-vaapi-intel.md
Last active September 10, 2025 21:59
PSA: You can now use FFmpeg's VAAPI-based VP8 and VP9 encoder on Skylake+ systems on Linux: Tested on Ubuntu 16.04LTS

Build VAAPI with support for VP8/9 decode and encode hardware acceleration on a Skylake validation testbed:

Build platform: Ubuntu 16.04LTS.

First things first:

Install baseline dependencies first

sudo apt-get -y install autoconf automake build-essential libass-dev libtool pkg-config texinfo zlib1g-dev libva-dev cmake mercurial libdrm-dev libvorbis-dev libogg-dev git libx11-dev libperl-dev libpciaccess-dev libpciaccess0 xorg-dev intel-gpu-tools

@Brainiarc7
Brainiarc7 / htc_vive_watchman_codes
Created May 26, 2017 16:38 — forked from cnlohr/htc_vive_watchman_codes
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 / xclip-copy-to-clipboard.md
Created April 26, 2017 17:53
Using xclip to copy terminal content to the clip board on Linux

Using xclip to copy terminal content to the clip board:

Say you want to pipe shell output to your clipboard on Linux. How would you do it? First, choose the clipboard destination, either the Mouse clip or the system clipboard.

For the mouse clipboard, pipe straight to xclip:

echo 123 | xclip

For the system clip board, pipe to xclip and select clip directly:

@Brainiarc7
Brainiarc7 / gpu-monitor.sh
Created March 31, 2017 22:05 — forked from disq/gpu-monitor.sh
GPU Monitor to send mail when load drops to 0%
#!/bin/sh
RET=`DISPLAY=:0 aticonfig --odgc --adapter=all`
ZEROCNT=`echo ${RET}|grep GPU|grep "0%"|wc -l`
if [ $ZEROCNT -gt 0 ]; then
if [ -e ~/gpu-monitor.stop ]; then
echo "$ZEROCNT gpu still idle"
exit 0
fi
sleep 10
RET=`DISPLAY=:0 aticonfig --odgc --adapter=all`