Skip to content

Instantly share code, notes, and snippets.

@Jammyjamjamman
Last active January 8, 2023 21:33
Show Gist options
  • Save Jammyjamjamman/ee2ff01e47602fcd9bbfd169967ecee0 to your computer and use it in GitHub Desktop.
Save Jammyjamjamman/ee2ff01e47602fcd9bbfd169967ecee0 to your computer and use it in GitHub Desktop.
bash_stuff.sh
#!/bin/sh
# Credits to Andy5995 for finding many (currently all) of these commands.
# commands for indenting C code with 2 spaces
indent -ci2 -bl -bli0 -nut -npcs *.c *.h
# If you make a script from this command...
indent -ci2 -bl -bli0 -nut -npcs $1 $2
# build with openssl
gcc -Wall `pkg-config --libs openssl` [c files] -o output_bin
# or
gcc -Wall -lssl -lcryto [c files] -o output_bin
# pkg-config to get required build flags
pkg-config --libs <library>
# https://github.com/linuxdeploy/linuxdeploy/issues/86
# Fix "no such file or directory" error when running appimages in docker:
sed -i 's|AI\x02|\x00\x00\x00|' <name_of.appimage>
# Setting limits in linux
sudo nano /etc/systemd/system.conf
sudo nano /etc/systemd/user.conf
sudo nano /etc/security/limits.conf
sudo systemctl daemon-reexec
# Substring checks
# https://stackoverflow.com/a/73903648
full_string="I-UAT"
substring="UAT"
if [ -z "${full_string##*$substring*}" ]; then
echo "Found substring!"
else
echo "Substring is MIA!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment