Skip to content

Instantly share code, notes, and snippets.

View iddm's full-sized avatar

Shockingly Good iddm

View GitHub Profile
@xaliander
xaliander / NVIDIA_Performance_Counters.md
Last active December 11, 2023 06:54
ERR_NVGPUCTRPERM: Permission issue with Performance Counters

Error

ERR_NVGPUCTRPERM: Permission issue with Performance Counters

Solutions for this issue

NVIDIA has a page that addresses the issue. Unfortunately, the instructions didn't solve the problem for me. However, I found a solution from rameshgunjal in the NVIDIA forums.

Option 1: Running the program as admin

You might have noticed that sudo nv-nsight-cu results in an error. Instead, you have to provide the path: sudo /usr/local/cuda/bin/nv-nsight-cu. The same applies for other applications as well: sudo /usr/local/cuda/bin/nsight-sys.

@holmberd
holmberd / linux-kill-pts.md
Last active July 13, 2024 18:38
Kill tty/pts sessions in Linux

Kill user tty/pts sessions in Linux

Commands

  • w: show who is logged on and what they are doing
  • who: show who is logged on
  • tty: show current users pseudo terminal
  • ps -ft pts/1: get process id for the pseudo terminal
  • pkill: signal process based on name and other attributes
@XueshiQiao
XueshiQiao / h264format.md
Last active September 28, 2024 18:23
H.264 Annex B format and AVCC format

AnnexB format:

([start code] NALU) | ( [start code] NALU) |

AVCC format:

([extradata]) | ([length] NALU) | ([length] NALU) |
@troyfontaine
troyfontaine / 1-setup.md
Last active November 19, 2024 11:26
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL
@kwilczynski
kwilczynski / fake-redirect.py
Created February 12, 2017 20:32
Create a simple HTTP redirect with Python on localhost.
import SimpleHTTPServer
import SocketServer
class FakeRedirect(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
print self.path
self.send_response(301)
new_path = '%s%s'%('http://localhost:8081', self.path)
self.send_header('Location', new_path)
self.end_headers()
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@skratchdot
skratchdot / donate.md
Created January 25, 2016 17:42
My Paypal donate button in markdown format

Donation Button

Donate

@ram-nadella
ram-nadella / trim.lua
Created January 19, 2016 22:40
Trim a lua string
function trim(s)
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end
@josemanuelcarretero
josemanuelcarretero / openvpn_install.sh
Last active January 19, 2017 18:50
Openvpn Intel Edison Yocto
cat > /etc/opkg/intel-iotdk.conf <<EOF
src intel-iotdk http://iotdk.intel.com/repos/1.1/intelgalactic
src intel-all http://iotdk.intel.com/repos/1.1/iotdk/all
src intel-quark http://iotdk.intel.com/repos/1.1/iotdk/quark
src intel-i586 http://iotdk.intel.com/repos/1.1/iotdk/i586
src intel-x86 http://iotdk.intel.com/repos/1.1/iotdk/x86
EOF
opkg update
opkg install liblzo2-dev