Skip to content

Instantly share code, notes, and snippets.

View neutronscott's full-sized avatar
🤡
clownin' around

Scott Nicholas neutronscott

🤡
clownin' around
View GitHub Profile
@neutronscott
neutronscott / mtk-bootseq.py
Created June 10, 2024 15:59 — forked from plugnburn/mtk-bootseq.py
MTK Bootseq: enter alternative boot modes in MediaTek-based smartphones
#!/usr/bin/env python3
# Simple script to enter the necessary boot mode in the MT6572-based (etc) phones
# Depends on pyserial, otherwise fully cross-platform
# Usage: python3 mtk-bootseq.py [MODECMD] [port]
# e.g. python3 mtk-bootseq.py FASTBOOT /dev/tty.usbmodem14200
# and then connect the cable and repeatedly short-press the power on key
# Supported commands depend on the device and its preloader. Here's the list for Sigma S3500 sKai:
@neutronscott
neutronscott / windows-openssh-sucks.rst
Last active February 24, 2024 23:02
Let's use Windows openssh to get a local copy of a file ...

Using SFTP and SCP in Windows

SFTP

SCP is deprecated so let's start with SFTP:

C:\Users\snicholas\Downloads>sftp mute@192.168.1.1
mute@192.168.1.1's password:
/* menu.java
* learning the java OO way
* scott nicholas <m@san.aq> jan 29 2024
*/
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class Menu
# Transparent proxying so logs show correct IP and content inspection for when port 443 allows ssh but 22 is blocked :)
#
# https://gist.github.com/mhofman/a01df56480b3791d526b77dbebef43a2#creative-ip-routing-for-transparent-proxying
#
# root@debian:~# cat /etc/network/interfaces.d/lo
# auto lo
# iface lo inet loopback
# post-up ip -4 a a 192.168.255.233/30 dev lo
# post-up ip -6 a a fd00:8::1/64 dev lo
# post-up ip -4 rule add from 192.168.255.232/30 lookup 232
@neutronscott
neutronscott / t408dl-scatter.txt
Created September 4, 2022 23:36
WIP: SP Flashing Tool Scatter File for T408DL
- general: MTK_PLATFORM_CFG
info:
- config_version: V1.1.6
platform: MT6739
project: t408dl
storage: EMMC
boot_channel: MSDC_0
block_size: 0x20000
check_bootloaders_consistency: true
@neutronscott
neutronscott / nextperm.lua
Last active December 6, 2020 21:51
my first lua
--[[ Psuedo-code given in chapter:
NextPerm(p1, p2, ..., pn)
Let k be the largest index such that P(k) < P(k+1)
If no such k exists then (p1, p2, ..., pn) is the last permutation
Let j be the largest index such that P(j) > P(k)
Swap P(j) and P(k)
Reverse the order of P(k+1), ..., P(n)
--]]
@neutronscott
neutronscott / true.s
Created November 8, 2020 16:27
149 byte true
; $ ls -l true /bin/true
; -rwxr-xr-x 1 root root 35424 Feb 28 2019 /bin/true*
; -rwxr-xr-x 1 mute mute 149 Feb 22 2015 true*
;
; take that GNU!
; basically https://www.muppetlabs.com/~breadbox/software/tiny/return42.html
; but someone said 'true' had to support options to really compare to GNU
BITS 32
@neutronscott
neutronscott / gist:de319214647082fc3f051f2e65fa8787
Last active January 14, 2020 07:04
notes on virtualbox running boot camp partition
1. Create VMDK mimic layout of real HDD.
Slices were readable but raw disk wasn't in macos, so I just wrote down all the "diskutil info disk0s1"
info and converted 4096-byte-sectors to 512 by multiplying by 8. Also I offset disk0s1 by 1 sector.
This allowed me to copy the first sector and manually edit the Bytes/sector, Sector/Cluster, Hidden Sectors,
and Total Sectors in the NTFS BPB. Windows sees it as a RAW partition otherwise, even though Linux has no
problem figuring it out. Finally I recreated the blank space at the end as a writable area since the
alternate GPT is stored there.
# Extent description
@neutronscott
neutronscott / keybase.md
Created December 22, 2019 15:59
keybase.io proof

Keybase proof

I hereby claim:

  • I am neutronscott on github.
  • I am neutronscott (https://keybase.io/neutronscott) on keybase.
  • I have a public key ASBB0G2Md8mWrwFoaTqH2uGLcSGuD-dAkSFOjhbslzdMCwo

To claim this, I am signing this object: