Skip to content

Instantly share code, notes, and snippets.

@kleo
kleo / dupe
Created February 3, 2021 10:19
Clonezilla clone sda to sdb
#!/bin/bash
# Make sure that sda is the source by placing the source SATA cable on the first SATA port number
# You will need 1.) clonezilla live
# 2.) a working space for saving our custom clonezilla iso, a flashdrive or any other storage medium
# Needed when cloning later
# 3.) source drive (sda)
# 4.) target drive (sdb)
#
# follow https://clonezilla.org/advanced/customized-clonezilla-live.php
/usr/sbin/ocs-onthefly -batch -g auto -e1 auto -e2 -r -j2 -sfsck -p poweroff -f sda -d sdb
@kleo
kleo / check-tor.sh
Created December 4, 2020 06:26
Simple addon to check if script is running on Tor
#!/bin/bash
# alias foo='torsocks script.sh'
curl -s https://check.torproject.org | sed '/<!doctype/d' | sed '/&raquo/d' | xmlstarlet sel -t -v '//html/body/div[2]/h1' | tr -d '\n' | awk '{$1=$1};1'
echo
curl https://ipv4.icanhazip.com
echo
[Unit]
Description=Switch Lan Play
After=network.target network-online.target
[Service]
Type=simple
Restart=on-failure
RestartSec=60
ExecStart=/home/pi/switch-lan-play/build/src/lan-play --netif eth0 --pmtu 500 --relay-server-addr lanplay.cpalm.org:11451
@kleo
kleo / tig.md
Last active October 29, 2020 01:48

TIG Stack AN5506-04-FA and Raspberry Pi

Defaults has UTC configured to GMT+8, configure NTP with adminpldt

Management > Device Management > NTP Check Time

time.google.com
time.google.com
https://thiru.in/333/tech/get-github-vanity-url-git-io/
$ curl -i https://git.io -F "url=https://github.com/ithiru" -F "code=thiru"
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Server: Cowboy
Connection: keep-alive
Date: Thu, 22 Sep 2016 05:05:35 GMT
Status: 201 Created
@kleo
kleo / sm-n910k.txt
Last active October 26, 2020 16:55
USB debugging enabled remove/change lock screen password SM-N910K (2017-02-18)
# USB debugging enabled remove/change lock screen password SM-N910K (2017-02-18)
# Copy lock screen password
/data/data/com.android.providers.settings/databases/settings.db
# Copy MMS/SMS storage (optional)
/data/data/com.android.providers.telephony/databases/mmssms.db
# Remove or change the password entry from settings.db copy
# I used DB.Browser.for.SQLite-3.9.1-win64.exe from https://sqlitebrowser.org/
@kleo
kleo / gist:93fda5d3d925dbdaab7e62c40708caa6
Last active December 10, 2020 19:58
timwr/CVE-2016-5195 dirtycow vagrant
# timwr/CVE-2016-5195 dirtycow vagrant
vagrant init debian/stretch64
vagrant up
# remote forward adb server port on host to vagrant
vagrant ssh -- -R 5037:localhost:5037
# https://bbs.archlinux.org/viewtopic.php?pid=1628620#p1628620
mount -o remount,size=4G /run/archiso/cowspace
@kleo
kleo / gist:91d6f893cb4090ac9c3d08ec503e5f9d
Last active October 23, 2020 20:48
Building Luma3DS on Arch Linux

Building Luma3DS on Arch Linux

Install text editor

sudo pacman --noconfirm -Syu

sudo pacman --noconfirm -S vim