Skip to content

Instantly share code, notes, and snippets.

@kaneelyster
kaneelyster / Auto Backup ADB commands.md
Last active October 2, 2024 18:01
Auto Backup ADB commands

Good write-up here.

Enable ADB verbose logging for backups:
adb shell setprop log.tag.GmsBackupTransport VERBOSE
adb shell setprop log.tag.BackupXmlParserLogging VERBOSE

Force auto backup:
adb shell bmgr backupnow <PACKAGE>

Force full backup:

@valacar
valacar / search-for-selected-text.js
Created March 13, 2018 01:10
[userscript] Search for selected text
// ==UserScript==
// @name Search for selected text
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Valacar
// @include https://*
// @include http://*
// @grant GM_openInTab
// ==/UserScript==
@lindekaer
lindekaer / convert.ts
Last active September 12, 2020 03:59
Convert Google Chrome bookmark timestamp to JS date
// A Webkit timestamp is the number of microseconds from "1st of Jan 1601"
// The magic number 11644473600 is the number of seconds between
// "1st of Jan 1601" and "1st of Jan 1970"
export const converWebkitTimestamp = (webkitTimestamp: number): Date => {
const dateInSeconds = Math.round(webkitTimestamp / 1000000) - 11644473600
return new Date(dateInSeconds * 1000)
}
#Requires -RunAsAdministrator
Stop-Service -Name @("bits","wuauserv","appidsvc","cryptsvc")
del "$env:ALLUSERSPROFILE\Application Data\Microsoft\Network\Downloader\qmgr*.*"
if(Test-Path variable:global:errs) {Remove-Variable -Name @("errs") -ErrorAction SilentlyContinue } #$err = $null
$errs = [System.Collections.ArrayList](@{})
function Start-Backup {
param([string[]]$paths = @("$env:SystemRoot\system32\catroot2","$env:SystemRoot\SoftwareDistribution"))
foreach($path in $paths){
$bak = "$($path).bak"
if((Test-Path -PathType Any $bak) -and (Test-Path -PathType Any $path)){
@haccer
haccer / scanio.sh
Last active July 3, 2025 21:27
PoC script to mass-locate vulnerable subdomains using results from Rapid7's Project Sonar
#!/bin/bash
# Usage : ./scanio.sh <save file>
# Example: ./scanio.sh cname_list.txt
# Premium
function ech() {
spinner=( "|" "/" "-" "\\" )
while true; do
for i in ${spinner[@]}; do
echo -ne "\r[$i] $1"
@codeisafourletter
codeisafourletter / RecoverPSGallery.ps1
Created February 1, 2018 14:11 — forked from guitarrapc/RecoverPSGallery.ps1
Whom you miss PSGallery with Get-PSRepository!
Register-PSRepository -Name PSGallery -SourceLocation https://www.powershellgallery.com/api/v2/ -PublishLocation https://www.powershellgallery.com/api/v2/package/ -ScriptSourceLocation https://www.powershellgallery.com/api/v2/items/psscript/ -ScriptPublishLocation https://www.powershellgallery.com/api/v2/package/ -InstallationPolicy Trusted -PackageManagementProvider NuGet
@ryanpcmcquen
ryanpcmcquen / backup_chrome_63_saved_passwords.js
Last active March 4, 2025 10:32
DEPRECATED! Chrome now has password export built in.
// 1. Open: chrome://settings/passwords
// 2. Open Chrome developer tools (using F12 or Ctrl+Shift+i).
// 3. Run the following code in the console tab.
// 4. Copy output in a text file and save it somewhere safe!
;(() => {
const asyncForEach = (array, done, iterator) => {
let i = 0
let next = err => {
if (err) {
done(err)
@jacano
jacano / Spotify
Created December 24, 2017 10:30
Spotify
# Block Spotify Ads
127.0.0.1 media-match.com
127.0.0.1 adclick.g.doublecklick.net
127.0.0.1 http://www.googleadservices.com
127.0.0.1 open.spotify.com
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 desktop.spotify.com
127.0.0.1 googleads.g.doubleclick.net
127.0.0.1 pubads.g.doubleclick.net
127.0.0.1 securepubads.g.doubleclick.net
@ThisIsOstad
ThisIsOstad / Chrome 61 Backup Saved Passwords
Last active September 12, 2020 18:00
As Chrome removed the "Backup" button in "Saved Passwords", you can make a backup from your passwords by running this code in the console!
// 1. Open chrome://settings/passwords
// 2. Open chrome developer tools (using F12 or Ctrl+Shift+i)
// 3. Run the following code in the console tab
// 4. Copy output in a text file and save it somewhere safe!
function asyncForEach(array, done, iterator) {
var i = 0;
next();
function next(err) {
if (err) {
@sgtoj
sgtoj / persistent_c_mount_wsl.sh
Last active June 24, 2024 21:32
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# allow `mount` cmd without password
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo')
# add the mount directive to `fstab`
sudo mkdir -p /c
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# update to `.bashrc` to auto mount at login
echo "sudo mount -a" >> ~/.bashrc
# now reload it
source ~/.bashrc