Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / gist:9a250f0d921912db0f1cdd95b6571449
Created September 2, 2020 08:38
Prioritise Logitech daemon so MX3 mouse extra buttons don't lag
sudo renice -20 $(pgrep LogiMgrDaemon)
@arijusg
arijusg / generate-interfaces.sh
Last active June 18, 2020 09:44
Generate Typescript interfaces for multiple swagger api project files
#!/bin/bash
set -e
# Root
ROOT_PATH=${PWD}
ROOT_PROJECTS="${ROOT_PATH}/projects"
ROOT_DIST="${ROOT_PATH}/dist"
function print() {
if [ -z "$1" ]; then
@arijusg
arijusg / configure-list-of-allowed-authentication-servers.md
Last active April 6, 2020 09:31
Configure list of allowed authentication servers (intranet) for Microsoft Edge chromium
  1. Open finder and go to ~/Library/Preferences
  2. Find com.microsoft.Edge.plist. If file doesn't exist, continue, otherwise go to step x
  3. Create a new config file /usr/bin/defaults write ~/Library/Preferences/com.microsoft.Edge.plist RestoreOnStartup -int 1
  4. Convert it to plist: /usr/bin/plutil -convert xml1 ~/Library/Preferences/com.microsoft.Edge.plist
  5. Open ~/Library/Preferences/com.microsoft.Edge.plist with xcode
  6. Add rows below:
  • Key: AuthServerAllowlist, Type: String, Value: *contose.com
  • Key: AuthNegotiateDelegateAllowlist, Type: String, Value: *contoso.com
@arijusg
arijusg / download-video.md
Last active May 6, 2024 01:45
Download stream video
@arijusg
arijusg / windows-on-mac-fun.md
Created April 3, 2019 14:10
Windows on Mac fun

Windows on Mac fun

  • Download VM Image from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
  • Dowload VirtualBox 6.0 from https://www.virtualbox.org/wiki/Downloads

Install VirtualBox

  • Click install, the install will fail.
  • Go to System Preferences -> Security and Privacy -> General -> "Some system software was blocked from loading" -> click "Allow"
  • Click install again, VirtualBox will install
@arijusg
arijusg / set_proxy_on_work_laptop.sh
Created December 2, 2018 11:42
Set proxy settings automatically using work laptop
#!/bin/bash
##########################################################################################
# Set proxy settings automatically using work laptop (~/.bashrc) #
##########################################################################################
USERNAME="<<username>> or <<domain\username>>"
PASSWORD="password"
PROXY_ADDRESS="proxy domain address"
NO_PROXY_DOMAINS=".local,.example.com"
WORK_IP_RANGE="10.10.10.*"
@arijusg
arijusg / jamf.md
Created December 1, 2018 17:29 — forked from a7ul/jamf.md
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions