Skip to content

Instantly share code, notes, and snippets.

View iddm's full-sized avatar

Shockingly Good iddm

View GitHub Profile
@iddm
iddm / NVIDIA_Performance_Counters.md
Created December 11, 2023 06:54 — forked from xaliander/NVIDIA_Performance_Counters.md
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.

@iddm
iddm / split_string_by_line.lua
Created September 14, 2021 18:47 — forked from iwanbk/split_string_by_line.lua
Split string by line in Lua
for line in yourString:gmatch("([^\n]*)\n?") do
-- do something
end
@iddm
iddm / docker_kill.sh
Created February 24, 2020 18:08 — forked from evanscottgray/docker_kill.sh
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@iddm
iddm / download-and-compile-emacs.sh
Last active July 10, 2019 11:03 — forked from strobe/compile-emacs.sh
Compile emacs 26.2 on CentOS 7.x
export VERSION=26.2
yum install gcc make ncurses-devel giflib-devel libjpeg-devel libtiff-devel gnutls-devel
curl -O http://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.xz > emacs.tar.xz
tar xJf emacs.tar.xz
cd emacs-$VERSION
./configure --without-x --without-selinux
make && sudo make install
@iddm
iddm / remove-docker-containers.md
Created February 21, 2018 19:30 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@iddm
iddm / rpm-digital-signature.sh
Created October 28, 2016 09:41 — forked from fernandoaleman/rpm-digital-signature.sh
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@iddm
iddm / donate.md
Created July 24, 2016 08:48 — forked from skratchdot/donate.md
My Paypal donate button in markdown format

Donation Button

Donate

@iddm
iddm / playground.rs
Created July 7, 2016 13:17 — forked from anonymous/playground.rs
Shared via Rust Playground
enum MachineState {
Normal,
Comment,
Upper,
Lower,
}
fn machine_cycle(state: &MachineState, character: char) -> (Option<char>, MachineState) {
use std::ascii::AsciiExt;