Skip to content

Instantly share code, notes, and snippets.

View mrlnc's full-sized avatar

Merlin Chlosta mrlnc

View GitHub Profile
@mrlnc
mrlnc / cloudsend.sh
Created February 11, 2020 13:58 — forked from tavinus/cloudsend.sh
Send files to Nextcloud/Owncloud shared folder using curl
#!/usr/bin/env bash
############################################################
#
# cloudsend.sh
#
# Uses curl to send files to a shared
# Nextcloud/Owncloud folder
#
# Usage: ./cloudsend.sh <file> <folderLink>
@mrlnc
mrlnc / free5gc_sctp.md
Created June 6, 2020 11:46
Expose AMF SCTP from free5GC docker-compose

Add the following to the free5gc-amf section in docker-compose.yaml:

    ports:
      - "38412:38412/sctp"

So that the section looks like this:

@mrlnc
mrlnc / ws_remote.md
Last active October 23, 2020 14:34
Wireshark from remote host, with fish autocompletion

I frequently need wireshark to inspect the traffic on remote machines. This is a fish-shell shortcut to start tcpdump on the remote host and pipe it into a local wireshark.

Requirements:

  • local fish-shell
  • local wireshark installation
  • tcpdump on remote

In ~/.config/fish, create directories functions and completions.

Create the function ws_remote in ~/.config/fish/functions/ws_remote.fish:

@mrlnc
mrlnc / free5gc_wireguard.md
Created February 8, 2021 12:45
Wireguard on Linux 5.0.0-23-generic (for Free5GC)

So you're using free5gc (hence stuck on linux 5.0.0-23-generic) and want to use wireguard VPN.

tl;dr you need wireguard-linux-compat tag v1.0.20200520

git clone https://git.zx2c4.com/wireguard-linux-compat
cd wireguard-linux-compat
git checkout v1.0.20200520
cd ..
make -C wireguard-linux-compat/src -j$(nproc)
make -C wireguard-linux-compat/src -j$(nproc) install
@mrlnc
mrlnc / libqmi-git.md
Last active March 16, 2022 15:48
Building qmicli and libqmi from source
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 49
---

:stop_sign: these notes are outdated. :stop_sign:

build tools were changed for `libqmi > 1.30`
check out the official docs: https://modemmanager.org/docs/libqmi/building/

---

qmicli (building on libqmi) as shipped with Ubuntu 20.04 can’t interface with 5G chipsets as the 5G-NR-related symbols are missing. Support begins with 1.26.4 in Ubuntu 20.10, but I think it doesn’t hurt to have the lastest release — new features are being added quite fast.

@mrlnc
mrlnc / free5gc-vscode-debug.md
Created February 27, 2021 16:14
Debugging free5gc

Free5GC has many components and I'm not very familiar with Golang, so this is a quick reminder for myself how debugging works with Go.

I'm using vscode with the (golang.Go plugin)[https://marketplace.visualstudio.com/items?itemName=golang.Go]

  1. Start all Free5GC components with ./run.sh
  2. Kill the component you'd like to debug, like killall amf

The main issue is that the Go module doesn't work well with submodules as of now, so you cannot start debugging from the free5gc folder.

@mrlnc
mrlnc / adb-5gnr-status.md
Created March 4, 2021 12:49
adb: get 5G-NR connection status

I need to use ADB and check if the phone is currently on 5GNR or not. gsm.network.type doesn't indicate if 5G-NSA bearers are active. No matter if LTE, LTE+ or 5G indicators are shown, the network type remains the same:

OnePlus8:/ # getprop gsm.network.type                                                                                     
LTE,Unknown

Workaround:

logcat /data/com.android.providers.telephony/databases/telephony.db | grep -i update5GIcon
@mrlnc
mrlnc / free5gc-run-tests-extern-5gc.md
Last active March 13, 2021 18:25
free5gc-run-tests-extern-5gc.md

You can use Free5GC's set of testcases (free5gc/test/registration_test.go) to test other core networks, too.

1.) change IPs in registration_test.go to point to your 5GC instance.

const ranN2Ipv4Addr string = "127.0.0.1"
const amfN2Ipv4Addr string = "127.0.0.1"

2.) run tests with the noinit parameter -- this will inhibit initialization of a local free5gc instance

@mrlnc
mrlnc / pysim-suci.md
Last active November 7, 2023 12:55
pysim-suci.md
@mrlnc
mrlnc / silent_ping_sms.md
Last active October 28, 2021 12:06
Building "Silent Ping SMS" Android App

Building the app "Silent Ping SMS".

Install JDK and gradle.

apt install gradle openjdk-8-jdk 

The README says: ./gradle clean installDebug, which fails: