Skip to content

Instantly share code, notes, and snippets.

@arijusg
arijusg / profile.py
Created March 4, 2022 17:26
Python profiling
from timeit import default_timer as timer
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.INFO)
start = timer()
# my code
end = timer()
LOGGER.info(f"1: {(end - start)*1000}ms")
start = timer()
@arijusg
arijusg / Correct_GnuPG_Permission.sh
Created February 13, 2024 15:06 — forked from oseme-techguy/Correct_GnuPG_Permission.sh
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@arijusg
arijusg / install_ncdu_amazon_linux.sh
Created February 16, 2024 10:09 — forked from MrHassanMurtaza/install_ncdu_amazon_linux.sh
Install ncdu on amazon linux 2
#!/bin/bash
# install packages/dependencies for compilation
sudo yum -y install gcc make ncurses-devel
cd /tmp
# the latest version of ncdu is published here: http://dev.yorhel.nl/ncdu
# update the link below if necessary:
wget -nv http://dev.yorhel.nl/download/ncdu-1.10.tar.gz