Skip to content

Instantly share code, notes, and snippets.

@nutrino
nutrino / vcpkg_commands.sh
Last active March 3, 2024 23:36
vcpkg commands
# Initialize
./bootstrap-vcpkg.sh -disableMetrics
# Export (online PC)
./vcpkg export [pkg_names] --zip
# Import (vcpkg folder of offline PC)
unzip [zip_file_name]
# Remove all packages including 'boost'
@nutrino
nutrino / macos_scripts.sh
Created May 8, 2023 16:13
macOS useful scripts
# Network scripts
nslookup www.naver.com
nslookup www.naver.com 8.8.8.8
dig www.naver.com
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; sudo killall mDNSResponderHelper
@nutrino
nutrino / network-monitor.sh
Last active March 22, 2023 23:45
Linux network usage monitoring
#https://www.tecmint.com/linux-network-bandwidth-monitoring-tools/
nload
sudo iftop
sudo nethogs
sudo iptraf
@nutrino
nutrino / fix_unmatched_cpu_affinity.sh
Created March 15, 2023 09:20
Set unmatched CPU affinity with the help of the ChatGPT
#!/bin/bash
# Use a while loop to read each line of output from ps
while read -r line; do
if [[ $line == *-cpu* ]]; then
#echo "$line"
pid=$(echo $line | awk '{print $1}')
no=$(echo $line | awk '{print $2}')
cmd=$(echo $line | awk '{$1=$2=""; print $0}')
cpu=$(echo $cmd | grep -oE '\-cpu [0-9]+' | awk '{print $2}')
@nutrino
nutrino / docker commands
Created March 4, 2023 14:01
Docker commands
docker exec -u 0 -it {ContainerName} bash
@nutrino
nutrino / macos_dmg_install.md
Last active February 12, 2023 13:50
macOS dmg install via command (specific destination disk enabler)
  1. Mount .dmg file (dbl-click)

  2. Open Terminal.

cd /Volumes/Samsung\ DeX

sudo installer -verboseR -dumplog -pkg Install\ Samsung\ DeX.pkg -target /

  1. Reboot
#!/bin/sh
if [ -z "$1" ]; then
echo "list_old_files.sh [files_to_find]"
exit 1
fi
set -x #echo on
## remove files older than specific date
@nutrino
nutrino / dotnet_commands.sh
Created February 1, 2023 00:38
.NET Commands in Linux
dotnet nuget locals all -l
@nutrino
nutrino / exif_set_date.py
Last active January 17, 2023 15:43
set image file date from exif data
#!/usr/bin/env python
# https://gist.github.com/ikoblik/7089165
"""A simple utility to restore file creation and modification
dates back to their original values from EXIF.
This script requires exif module to be installed or the exif
command line utility to be in the path.
NODE_OPTIONS=--max_old_space_size=8192 npm install