Skip to content

Instantly share code, notes, and snippets.

View omhmichaels's full-sized avatar
😈

Michael Martin omhmichaels

😈
View GitHub Profile
@omhmichaels
omhmichaels / Git Reset-Revert.md
Created April 5, 2022 17:46 — forked from stevenyap/Git Reset-Revert.md
Git reset and revert: Undoing changs

Difference between reset and revert

  • Reset rewinds history (files + commits) back to the previous commits
  • Revert rewinds your files back to the previous commits by adding a new commit to show this
  • You should use revert (especially if you have pushed) as it does not rewrite history

Git Reset

# If you are pulling, rebasing or your new code is a mess, and you want to return to the last committed point:
@omhmichaels
omhmichaels / revert-a-commit.md
Created April 5, 2022 17:45 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@omhmichaels
omhmichaels / git-revert-sha-commit
Created April 5, 2022 17:44 — forked from mgibowski/git-revert-sha-commit
[git] revert to a commit by sha hash
# found at:
# http://stackoverflow.com/questions/1895059/git-revert-to-a-commit-by-sha-hash
# reset the index to the desired tree
git reset --hard 56e05fced
# move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}
git commit -m "Revert to 56e05fced"
tf_var_key=$1
tf_var_description=${2:- ""}
tf_var_type=${3:- ""}
tf_var_default=${4:- ""}
printf "\nvariable \"$tf_var_key\" {\n\tdescription = \"$tf_var_description\"\n\ttype = \"$tf_var_type\"\n\tdefault = \"$tf_var_default\"\n}"
@omhmichaels
omhmichaels / make_portable.sh
Created October 23, 2021 22:31 — forked from Birch-san/make_portable.sh
Make a macOS executable binary or .dylib portable
#!/usr/bin/env bash
# Licensed by author Alex Birch under CC BY-SA 4.0
# https://creativecommons.org/licenses/by-sa/4.0/
# Example input:
# ./make_portable.sh mycoolbinary
# where mycoolbinary is a mach-o object file
# (for example an executable binary or a .dylib)
#
@omhmichaels
omhmichaels / generate-ssh-key.sh
Created August 12, 2020 06:09 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@omhmichaels
omhmichaels / macos_on_ubuntu.md
Created July 24, 2020 06:27 — forked from stefanocoding/macos_on_ubuntu.md
Install macOS in a VirtualBox machine on Ubuntu

Important: I'm writing this when the last version of macOS (and the one I have installed) is Mojave. There is already a script which installs Mojave in a virtual machine here https://github.com/img2tab/okiomov. But if you are curios how to do everything manually to install High Sierra, then this guide may be useful.

After reading a few articles I ended up with these steps:

  1. On macOS, download the High Sierra installer (even if you have Mojave installed): https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?ls=1&mt=12
  2. If the High Sierra Installer starts, quit it.
  3. Open "Disk Utility".
  4. Click on "File" > "New Image" > "Blank image...". Or just press cmd+N.
@omhmichaels
omhmichaels / macos_on_ubuntu.md
Created July 24, 2020 06:27 — forked from stefanocoding/macos_on_ubuntu.md
Install macOS in a VirtualBox machine on Ubuntu

Important: I'm writing this when the last version of macOS (and the one I have installed) is Mojave. There is already a script which installs Mojave in a virtual machine here https://github.com/img2tab/okiomov. But if you are curios how to do everything manually to install High Sierra, then this guide may be useful.

After reading a few articles I ended up with these steps:

  1. On macOS, download the High Sierra installer (even if you have Mojave installed): https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?ls=1&mt=12
  2. If the High Sierra Installer starts, quit it.
  3. Open "Disk Utility".
  4. Click on "File" > "New Image" > "Blank image...". Or just press cmd+N.
@omhmichaels
omhmichaels / macos_on_ubuntu.md
Created July 24, 2020 06:27 — forked from tieubao/macos_on_ubuntu.md
Install macOS in a VirtualBox machine on Ubuntu

Important: I'm writing this when the last version of macOS (and the one I have installed) is Mojave. There is already a script which installs Mojave in a virtual machine here https://github.com/img2tab/okiomov. But if you are curios how to do everything manually to install High Sierra, then this guide may be useful.

After reading a few articles I ended up with these steps:

  1. On macOS, download the High Sierra installer (even if you have Mojave installed): https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?ls=1&mt=12
  2. If the High Sierra Installer starts, quit it.
  3. Open "Disk Utility".
  4. Click on "File" > "New Image" > "Blank image...". Or just press cmd+N.

How to pass the OSCP

  1. Recon
  2. Find vuln
  3. Exploit
  4. Document it

Recon

Unicornscans in cli, nmap in msfconsole to help store loot in database.