Skip to content

Instantly share code, notes, and snippets.

View Leo-PL's full-sized avatar

Lech Perczak Leo-PL

View GitHub Profile
@Leo-PL
Leo-PL / lte_mbim_from_scratch.md
Created May 22, 2021 13:23 — forked from Juul/lte_mbim_from_scratch.md
How to use 4G LTE modems like the MC7455 on both Debian/Ubuntu and OpenWRT using MBIM

The purpose of this document is to get you familiar with the concepts and command line tools involved with connecting to the internet using modern 4G LTE modems on both Debian/Ubuntu and OpenWRT.

This writeup is based on my experiences with the Sierra Wireless AirPrime MC7455 modem and a Calyx (Sprint) SIM card, but it should apply to most modern 4G LTE modems.

High level overview

These are the steps required:

  • Physically connect antennas
@Leo-PL
Leo-PL / ssh-wakeup.sh
Created March 25, 2021 21:48
ProxyCommand wrapper for remote host wakeup on SSH connection
#!/bin/bash
function wait_for_host() {
local host=${1}
local port=${2}
local count=${3}
local tries=0
TIMEOUT_SEC=1
while (( ${tries} < ${count} )); do
@Leo-PL
Leo-PL / modem.py
Created February 27, 2021 00:35 — forked from aursu/modem.py
ModemManager interface via Python 3 (Dbus, Modems, SMS)
#!/usr/bin/python3
# script created for reading SMS messages from 3G modem connected to PC
# 1) it looks for modem
# 2) reads all SMS messages from modem
# 3) prints all found SMS messages to stdout only if total messages count
# greater than SMS_STORE_COUNT (default is 3)
# 4) save all but SMS_STORE_COUNT messages to txt files and
# delete them from modem
@Leo-PL
Leo-PL / descrypt-admin-allsalts.txt
Created February 1, 2021 00:07 — forked from roycewilliams/descrypt-admin-allsalts.txt
descrypt-admin-allsalts.txt
# All possible descrypt hashes of the password 'admin', using all possible salts.
# From https://github.com/roycewilliams/kens-salty-rainbow
# If you find a device that always uses one of these, let me know.
..xpoEyRReGzk
./nlIXYriZaB2
.08iPeaCLti3E
.1fH80ykoJAyI
.23PstrXfk7Nw
.37vRhjo4ZP66
.4nTonCOGSWyU
@Leo-PL
Leo-PL / ssh_recovery.sh
Last active September 15, 2020 17:02
A self-contained script to setup a reverse SSH tunnel for use in emergency situations, when you need to help someone atechnical remotely and VPN went down. Fill out your parameters as needed.
#!/bin/bash
USER=""
SERVER_HOST=""
SERVER_PORT="22"
REMOTE_PORT="22"
LOCAL_PORT="1234"
IDENTITY=$(mktemp)
KNOWN_HOSTS=$(mktemp)
@Leo-PL
Leo-PL / ipxe_build.md
Created June 21, 2020 22:22 — forked from rikka0w0/ipxe_build.md
Build IPXE

1. Install tools and config IPXE

# Install compiler and dependencies
sudo apt-get install -y git gcc make liblzma-dev

# Grab the source code
git clone https://github.com/ipxe/ipxe.git
cd ipxe/src

# Enable NFS support
@Leo-PL
Leo-PL / reset_modem_hard.sh
Created April 22, 2020 22:34
Simple WAN watchdog for OpenWrt with LTE modem. Add to crontab.
#!/bin/sh
USB_GPIO=21
DELAY=1
gpio_value="/sys/class/gpio/gpio${USB_GPIO}/value"
echo 0 > ${gpio_value}
sleep ${DELAY}
echo 1 > ${gpio_value}
@Leo-PL
Leo-PL / backup.sh
Created April 22, 2020 22:29
OpenWrt backup script with git configuration versioning
#!/bin/bash
DATE=`date -Idate`
USER="root"
HOSTS=("<host1>" ... "<hostn>")
commit_single_host_to_git ()
{
local host=${1}
local backup_filename="backup-${host}-${DATE}.tar.gz"
@Leo-PL
Leo-PL / hp_saap_license.txt
Created March 28, 2020 12:56 — forked from evianzhow/hp_saap_license.txt
HP Smart Array Advanced Pack Evaluation License Key
34T62-N84MB-7DQGY-G7XGT-YTQ63
@Leo-PL
Leo-PL / keepass-file-format.md
Last active March 28, 2020 12:28 — forked from lgg/keepass-file-format-explained.md
Keepass file format explained

Keepass file format explained

I’m currently working (I’m just at the beginning, and I’m quite slow) on a personal project that will use Keepass files (kdb and kdbx).
I tried to find some documentation about .kdb and .kdbx format, but I didn’t find anything, even in the Keepass official website. I you want to know how these file formats are structured, you must read Keepass’s source code. So I wrote this article that explains how Keepass file format are structured, maybe it will help someone.