Skip to content

Instantly share code, notes, and snippets.

View saschazepter's full-sized avatar

Sascha Zepter saschazepter

View GitHub Profile
@amalmurali47
amalmurali47 / edit_commit_history.md
Last active June 8, 2025 13:59
Change ownership of selected older commits in Git
  1. Clone the repo.
  2. Use git rebase -i --root
  3. vim will open. Select the commits you want to modify by changing pick to edit. If you would like to change all the commits, perform the following replace: :%s/^pick/edit/g. This command changes all instances of "pick" at the start of lines to "edit".
  4. You will now be shown all the selected commits one by one. Each commit message will be displayed. You have two options:
    • If you would like to keep the commit author details the same, do a git rebase --continue.
    • If you would like to change it to a different name/email, do git commit --amend --reset-author. If --reset-author is specified, it will use the details from your git config. (If you need to specify an alternate name/email, you can do so with --author="John Doe <[email protected]>". If you would like to change the time to a previous date, you can do so with --date "2 days ago".)
  5. Do the same for all the commits and finish the rebase.
  6. Perform git push -f origin master to
@alahmnat
alahmnat / Session Converter.html
Created March 14, 2021 01:23
Session Buddy to Tab Session Manager export converter
<html>
<head></head>
<body>
<p>
<b>How to use this tool:</b> In Chrome, open Session Buddy. Click on the gear at the top-right, and select "Export".
</p>
<p>
In the export dialog, select "JSON" as the export type, and be sure to select both "Sessions" and "Windows" in the "Show" options.
</p>
<p>
@joerodgers
joerodgers / Update-LastLogonTimestamp.ps1
Last active June 17, 2025 08:57
Trick to force an update to the LastLogon Timestamp for an Active Directory account. This is sometimes necessary for the portal cache accounts if a companies AD team disables accounts based on the LastLogon timestamp of a user.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
function Update-LastLogonTimestamp
{
[CmdletBinding()]
param
(
[parameter(Position=0, Mandatory=$true)][string]$UserName
)
@Hakky54
Hakky54 / openssl_commands.md
Last active June 9, 2025 12:54 — forked from p3t3r67x0/openssl_commands.md
OpenSSL Cheat Sheet

OpenSSL Cheat Sheet 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@lietu
lietu / hg-git-sync.sh
Created September 15, 2019 09:05
Sync a Mercurial (hg) repository to a Git repository
#!/usr/bin/env sh
set -exu
# Which Git repo to sync with - change this for sure
GIT_REPO="git@..."
# Paths
HG_REPO="$(pwd -P)" # You might need to change this
GIT_TMP="/tmp/git-sync-$(date +%s)"
@yancyn
yancyn / git-svn.md
Last active March 2, 2025 18:05
Migrate Archive Google Code SVN to Git

Migrate Archive Google Code SVN to Git

Requirements

  • git
  • git-svn

Setup¹

$ sudo apt-get install git
$ sudo add-apt-repository ppa:git-core/ppa
@Saissaken
Saissaken / Update git fork with tags.sh
Last active May 14, 2025 10:18
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@amura2406
amura2406 / MigrateSVNtoGIT.md
Created August 23, 2016 07:58
Tutorial to migrate from SVN to Git

Install svn2git.

On all systems you can install as a Ruby gem if you already have Ruby and Git installed.

sudo gem install svn2git

Checkout SVN Repo

Checkout the latest SVN Repository of the project you want to convert.

svn co --username <your_name> https://svn.server.com/repository/trunk
@CrookedNumber
CrookedNumber / gist:8964442
Created February 12, 2014 21:02
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

@JPBlanc
JPBlanc / gist:1082221
Created July 14, 2011 10:13
Retreive the FSMO roles from a Domain Controler usind ADSI
'==========================================================================
'
' NAME: fSMORoleOwner.vbs
'
' AUTHOR: JPB , Silogix
' DATE : 13/07/2011
'
' COMMENT: This script allow to retreive the five FSMO Role Owners
'
'==========================================================================