Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@Juul
Juul / autossh_reverse_tunnel.md
Last active September 24, 2023 06:40
How to configure a reverse SSH tunnel that auto-establishes and auto-reconnects

This is a brief guide on how to configure an SSH reverse tunnel that automatically establishes on boot and will continuously attempt to re-connect when it fails.

It is very useful if you are deploying a device somewhere without a public IP, e.g. behind a NAT, and need to be able to SSH into it from the wider internet.

Let's refer to the NAT'ed device as the client. This guide assumes that the client is able to create outgoing SSH connections to at least destination port 443.

You will need root access to a server with a static IP on the internet which runs an openssh server.

On my-server.example.com add the following to /etc/ssh/sshd_config, changing tunnel-user to whichever username you want to use (this will be a new user, not an exising user) and changing the PermitOpen line:

@Juul
Juul / ppp_notes.md
Created November 10, 2019 09:16
ppp_tunnel_notes

sit tunnel

client

ip tunnel add sit1 mode sit ttl 100 remote 107.170.232.149 local 173.132.20.41
ip addr add 172.30.0.1/24 dev sit1
ip link set dev sit1 up
echo 1 > /proc/sys/net/ipv4/ip_forward
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active April 23, 2024 08:02
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@Domin8-IPTV
Domin8-IPTV / web-fm.php
Created June 24, 2019 01:10
browser based file manager sign in username and password with MD5 encryption
<?php
/**
* File Manager Script
*/
// Default language ('en' and other from 'filemanager-l10n.php')
$lang = 'en';
// Auth with login/password (set true/false to enable/disable it)
$use_auth = true;
@Domin8-IPTV
Domin8-IPTV / vod2hls.sh
Created June 17, 2019 20:34
create hls live stream from files
#!/bin/bash
# Change this to path of file to stream /edit/to/vod/path.mp4
mediaFile="/edit/to/vod/path.mp4"
### 480x video400kbps audio40kbps ###
mediaStreams="-map 0"
audCodec="-acodec mp2"
audKbps="-b:a 40k"
@Juul
Juul / certbot_reverse_proxy_guide.md
Created May 29, 2019 01:04
How to use Let's Encrypt / certbot with a reverse proxy

apache config

The secret sauce is:

<Location /.well-known>
    ProxyPass !
</Location>
@aptgetupgrade
aptgetupgrade / email_parse_url.py
Last active January 1, 2024 11:18
code to poll emails from an IMAP email server and post these to wallabag
# Read email in inbox, look for any URLs and update them to wallabag, delete email if URLs found in it.
# Built from various internet sources. Final code donated under GPL v3 by Github user aptgetupgrade
# Tested using python 2. Could be run as part of a crontab, e.g. every 5 mins.
#
import sys
import imaplib
import getpass
import email
import email.header
import datetime
@Juul
Juul / lte_mbim_from_scratch.md
Last active March 29, 2024 03:06
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
Series Name,Series Code,Country Name,Country Code,2016 [YR2016]
"Population, total",SP.POP.TOTL,Afghanistan,AFG,34656032
"Population, total",SP.POP.TOTL,Albania,ALB,2876101
"Population, total",SP.POP.TOTL,Algeria,DZA,40606052
"Population, total",SP.POP.TOTL,American Samoa,ASM,55599
"Population, total",SP.POP.TOTL,Andorra,AND,77281
"Population, total",SP.POP.TOTL,Angola,AGO,28813463
"Population, total",SP.POP.TOTL,Antigua and Barbuda,ATG,100963
"Population, total",SP.POP.TOTL,Argentina,ARG,43847430
"Population, total",SP.POP.TOTL,Armenia,ARM,2924816