Skip to content

Instantly share code, notes, and snippets.

View Brainiarc7's full-sized avatar

Dennis E. Mungai Brainiarc7

View GitHub Profile
@agaoglu
agaoglu / gpuwatch.py
Created February 2, 2011 21:48
Ganglia metric module for nVidia GPU monitoring
import os
descriptors = list()
def getString():
test_file = "nvidia-smi -q --gpu=0 | tail -23"
try:
p = os.popen(test_file, 'r')
return p.read()
@bradoaks
bradoaks / hfsc-shape.sh
Created April 25, 2011 14:51 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@alandipert
alandipert / interfaces
Created March 12, 2013 20:14
raspbian configuration for bridging eth0 and wlan0
# /etc/network/interfaces
# Configured for bridging wifi<->ethernet
# Tested with:
# - RPi Model B Rev. 1
# - 2013-02-09-wheezy-raspbian
# - Edimax 8192-series USB wireless adapter
# - /etc/modprobe.d/8192cu.conf contents:
# - options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
# - firmware: c2d133fb4efe9c9995da7fd7e1c45d74254f5c4b
<?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 <sam@hocevar.net>
@vongosling
vongosling / gist:9929680
Last active January 31, 2024 04:49
Performance Tuning

Three system configuration parameters must be set to support a large number of open files and TCP connections with large bursts of messages. Changes can be made using the /etc/rc.d/rc.local or /etc/sysctl.conf script to preserve changes after reboot.

1. /proc/sys/fs/file-max: The maximum number of concurrently open files.

fs.file-max = 1000000

2. /proc/sys/net/ipv4/tcp_max_syn_backlog: Maximum number of remembered connection requests, which are still did not receive an acknowledgment from connecting client. The default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines.

net.ipv4.tcp_max_syn_backlog = 3240000

3. /proc/sys/net/core/somaxconn: Limit of socket listen() backlog, known in userspace as SOMAXCONN. Defaults to 128.

net.core.somaxconn = 3240000

@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')
@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 / 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.
@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
@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