Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / linux_osquery
Last active May 29, 2025 12:00
linux_osquery
SELECT * FROM block_devices;
SELECT * FROM users WHERE gid < 65534 AND uid >= 1000;
# finds all users who have actual login shells
SELECT * FROM users WHERE shell NOT LIKE '%false' AND shell NOT LIKE '%true';
SELECT * FROM users WHERE shell="/bin/bash"
#Querying the socket_events table
SELECT pid, remote_address AS address,
@githubfoam
githubfoam / github actions cheat sheet
Last active March 23, 2026 03:33
github actions cheat sheet
============================================================================
#how to delete a workflow from GitHub Actions?
https://stackoverflow.com/questions/57927115/anyone-know-a-way-to-delete-a-workflow-from-github-actions
============================================================================
gists
============================================================================
https://api.github.com/users/githubfoam/gists
`html_url` list gists
============================================================================
@githubfoam
githubfoam / fio cheatsheet
Last active November 9, 2026 10:06
fio cheatsheet
-----------------------------------------------------------------------------------------------------
Read Test
fio --name=randread --ioengine=libaio --iodepth=16 --rw=randread --bs=4k --direct=0 --size=512M --numjobs=4 --runtime=240 --group_reporting
-----------------------------------------------------------------------------------------------------
writes a total 2GB files [4 jobs x 512 MB = 2GB] running 4 processes at a time:
fio --name=randwrite --ioengine=libaio --iodepth=1 --rw=randwrite --bs=4k --direct=0 --size=512M --numjobs=4 --runtime=240 --group_reporting
-----------------------------------------------------------------------------------------------------
Read Write Performance Test
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=random_read_write.fio --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
@githubfoam
githubfoam / suse experience
Created July 1, 2020 10:24
suse experience
zypper ref #Refreshing Repositories
zypper update -y #update all installed packages with newer version as far as possible
#Reboot is required to ensure that your system benefits from these updates.
zypper --non-interactive --quiet install bcc-tools bcc-examples git
@githubfoam
githubfoam / bash script cheat sheet
Last active March 23, 2026 03:33
bash script cheat sheet
-----------------------------------------------------------------------------------------------------
Common Ways to Run a Bash Script
You can execute a Bash script in several different ways, each affecting:
Which shell runs it,
Whether a new shell process is created,
Which environment variables are used, and
@githubfoam
githubfoam / go lang experience
Last active April 7, 2023 12:45
go lang experience
-------------------------------------------------------------------------------------------------
# official Go downloads page https://go.dev/dl/
-------------------------------------------------------------------------------------------------
sudo snap install go --classic #Ubuntu
-------------------------------------------------------------------------------------------------
cd /tmp
export GOVERSION="1.18"
curl -O https://dl.google.com/go/go$GOVERSION.linux-amd64.tar.gz
tar -xvf go$GOVERSION.linux-amd64.tar.gz
sudo mv go /usr/local
@githubfoam
githubfoam / hpc experience
Last active June 10, 2020 15:49
hpc experience
-------------------------------------------------------------------------------------------------------------------------------------------------
$ cat Makefile
F90 = gfortran
TARGET=hello
OBJECTS = $(TARGET).o
FCFLAGS = -g -pg -fbounds-check
OPFLAGS = -Ofast -O3 -O2 -O1
#PROFILERS = gprof strace ltrace valgrind
all: build-gprof build-strace build-ltrace build-valgrind
@githubfoam
githubfoam / macos_administrator_daily_tasks
Last active March 31, 2022 08:11
macos_administrator_daily_tasks
--------------------------------------------------------------------------------------------------------------------------------------------------
#zsh shell (Z-Shell),Most versions of macOS ship with zsh pre-installed
zsh --version
chsh -s $(which zsh) #set zsh as the default shell
chsh -s $(which bash) # revert to Bash
chsh -s /usr/local/bin/zsh
chsh -s /bin/zsh
--------------------------------------------------------------------------------------------------------------------------------------------------
#Hosts File
Windows 10 - "C:\Windows\System32\drivers\etc\hosts"
@githubfoam
githubfoam / minikube
Last active July 21, 2022 13:13
minikube
------------------------------------------------------------------------------------------------
sudo -E minikube start --driver=none --kubernetes-version v1.11.8 --extra-config kubeadm.ignore-preflight-errors=SystemVerification #Some versions of Linux have a version of docker that is newer than what Kubernetes expects. To overwrite this, run minikube with the following parameters
sudo minikube config set driver none #make none the default driver
minikube start --alsologtostderr -v=4 #debug crashes
sudo minikube start --profile=minikube --memory=8192 --cpus=4 --vm-driver=none --kubernetes-version=v$KUBERNETES_VERSION # The 'none' driver does not respect the --cpus flag ! The 'none' driver does not respect the --memory flag
sudo minikube start --memory=8192 --cpus=4 --vm-driver="virtualbox"
------------------------------------------------------------------------------------------------
kubectl config use-context minikube #use kubectl to switch to the minikube context, so we can talk to the cluster
-----------
@githubfoam
githubfoam / solaris 11-4 cheat sheet
Created February 25, 2020 16:53
solaris 11-4 cheat sheet
#pkg update
# System configuration profiles are processed by SMF after OS package installation when a client first boots.
#The Service Management Facility in Oracle Solaris 11 is used to configure systems and store related configuration data, allowing changes to persist across system updates.
sysconfig create-profile -o profile.xml
sysconfig configure -c sc-profile.xml #The resulting profile can be used with AI or as input to a sysconfig command
kstat -p | grep link_ | grep bge # display network interface variables
#vagrant sudoer