Skip to content

Instantly share code, notes, and snippets.

View amalmurali47's full-sized avatar

Amal Murali amalmurali47

View GitHub Profile
@amalmurali47
amalmurali47 / edit_commit_history.md
Last active February 20, 2026 11:56
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 <john@example.com>". 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
@amalmurali47
amalmurali47 / backup_digitalocean.md
Last active February 2, 2026 19:10
Backup DigitalOcean droplet locally

DigitalOcean does not provide a way to download a snapshot of your droplet locally. You can use rsync to accomplish this instead.

On your local machine, assuming you have added your-server in your SSH config:

rsync -aAXHv --append-verify --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} your-server:/
  • -a : archive mode (all files, with permissions, etc.)
  • -A : preserve ACLs/permissions (not included with -a)
@amalmurali47
amalmurali47 / install_chrome.md
Created June 22, 2025 09:14
How to install an older version of Google Chrome on Ubuntu?

Installing an Older Chrome Version on Ubuntu

I needed Chrome 136.0.7103.92 for testing a CVE, but Google's repo only keeps the latest stable. Here's how I got it running alongside my regular Chrome install. Writing this down for next time, but maybe it'll help someone else too.

Warning: Old browsers have security vulnerabilities. Only use for testing, never for normal browsing.

Getting the .deb file

Google stores old builds at https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/. You can grab version numbers from the Chrome releases blog and build the URL:

@amalmurali47
amalmurali47 / README.md
Created May 1, 2019 18:31
Delete all Telegram contacts.

How to delete all your Telegram contacts at once?

  1. Go to https://web.telegram.org and sign in if you're not already signed in.
  2. On the top-left, click on the hamburger icon to show the dropdown menu, and choose "Contacts" from the list.
  3. Choose "Edit".
  4. Open the Developer Console of your browser (preferably Chrome or Firefox). On Chrome, that is Ctrl + Shift + J.
  5. Run the following JS snippet:
var x = document.getElementsByClassName('contacts_modal_contact')
@amalmurali47
amalmurali47 / intigriti_xss_check.py
Created April 26, 2020 11:53
Check which characters are converted by the web server
import re
import string
import requests
def check(c):
t = requests.get(f'https://challenge.intigriti.io/{c}').text
return re.match(r'404 - \'File "(.*?)" was.*\'', t).group(1)
@amalmurali47
amalmurali47 / go-setup.sh
Last active December 12, 2021 15:58
Go automatic upgrade/installation script for Linux
#!/bin/bash
version=$(curl -s "https://go.dev/dl/?mode=json" | jq '.[0].version' -r)
wget "https://dl.google.com/go/${version}.linux-amd64.tar.gz"
sudo tar -C /usr/local -xzf go*.linux-amd64.tar.gz
{
echo '# Golang'
echo 'export GOPATH=$HOME/go'
@amalmurali47
amalmurali47 / gist:9213340
Created February 25, 2014 17:11
array_rand() vs shuffle() - Benchmark
<pre><?php
$arr = array(
array(
"image" => "",
"title" => "Open 7 days.",
"text" => "We’re open 7 days a week."
),
array(
"image" => "",
@amalmurali47
amalmurali47 / woo.py
Created July 16, 2021 20:17
sqlmap tamper script for WooCommerce Unauthenticated SQLi
#!/usr/bin/env python3
from urllib.parse import quote as encode
import requests
base_url = 'http://localhost:9001'
def tamper(payload, **kwargs):
require 'selenium-webdriver'
@host = "http://metadata.google.internal/computeMetadata/v1/instance/"
def setup
@driver = Selenium::WebDriver.for(
:remote,
url: 'https://SELENIUM_URL/wd/hub',
desired_capabilities: :chrome)
end

Downloading the script

Execute the command in a terminal window:

wget "https://gist.github.com/amalmurali47/050ef9250c5e1cd611f2e54012d1ece3/raw/29126c4e7e2ae79f8c61cd057e8b30c1345367ec/vaccine_checker.py"

It will save the script as vaccine_checker.py.

Requirements

You need the following installed:

  • Python