Skip to content

Instantly share code, notes, and snippets.

View smarek's full-sized avatar
💭
I may be slow to respond.

Marek Sebera smarek

💭
I may be slow to respond.
View GitHub Profile
@smarek
smarek / install.sh
Last active March 3, 2024 00:03
Yate, YateBTS and bladeRF install
#!/bin/bash
#
# For debian-like systems, for others you might have to change package names
# libusb-dev at least 1.0
# build-essential => make, dpkg-dev, gcc, g++, libc-dev / libc6-dev
#
#
# Depending on your architecture and available cores, you might want to change -j4 argument (4 = number of compilation threads = cpu cores available)
#
# If you have GCC version greater than 6, go /usr/src/yatebts/ and patch using `patch -p1 < yatebts-5.0.0-gcc6.patch`
@smarek
smarek / 00README.md
Last active February 5, 2024 10:04
E3372s-153 from Stick mode to HiLink mode automatic installer

E3372s from STICK to HiLink mode installer

You need

  • curl, usb-modeswitch, grep, awk, sudo (not necessary, last step can fail safely)
  • balong_flash in $PATH ( https://github.com/forth32/balongflash.git )
  • atinout in $PATH ( https://github.com/beralt/atinout.git will work fine )
  • 2 files we flash (core sw update version 22.x, WebUI installer), we use these (you can probably use different balong-compatible):
    • core sw: "E3372sUpdate_22.298.03.02.965.BIN" / "E3372sUpdate_22.298.03.02.965.exe"
    • webui: "Update_WEBUI_17.100.06.00.03_Hilink_V7R2_9x25_CPIO.exe"
@smarek
smarek / plant_uml_decoder.py
Created August 27, 2023 08:44 — forked from ryardley/plant_uml_decoder.py
PlantUML url encryption decoder
#!/usr/bin/env python3
import zlib
import base64
import string
import sys
plantuml_alphabet = (
string.digits + string.ascii_uppercase + string.ascii_lowercase + "-_"
)
base64_alphabet = string.ascii_uppercase + string.ascii_lowercase + string.digits + "+/"
@smarek
smarek / Identification 413c:81c2
Created June 21, 2019 11:26
EM7455 - Sierra Wireless - Linux
# picocom /dev/ttyUSB2
ATI
Manufacturer: Sierra Wireless, Incorporated
Model: EM7455
Revision: SWI9X30C_02.30.03.00 r7804 CARMD-EV-FRMWR2 2018/07/25 01:10:04
MEID: -redacted-
IMEI: -redacted-
IMEI SV: 17
FSN: LF818679700410
+GCAP: +CGSM
@smarek
smarek / 70-huawei-e3.conf
Last active February 26, 2022 17:00
Raspberry / Banana Huawei E3372 network interface name
# /etc/udev/rules.d/70-huawei-e3.conf
# Necessary for network interface name
SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14dc", NAME="usb0"
# Might be duplicate to usb_modeswitch config, however it's good to have it there
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/usr/sbin/usb_modeswitch -c /etc/usb_modeswitch.d/huawei_e3.conf"
@smarek
smarek / README.md
Last active January 24, 2021 22:21
Inflate gzdeflate contents / decode eIDAS SAMLRequest param

Run like

> decode_saml_request.sh sample_data
@smarek
smarek / git.diff
Created July 30, 2020 10:49
kaitai tests translator python
diff --git a/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/PythonSG.scala b/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/PythonSG.scala
index 327d3df0..0b64d616 100644
--- a/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/PythonSG.scala
+++ b/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/PythonSG.scala
@@ -56,7 +56,9 @@ class PythonSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerato
override def nullAssert(actual: Ast.expr): Unit = {
val actStr = translateAct(actual)
- out.puts(s"self.assertIsNone($actStr)")
+ val attrStr = actStr.substring(actStr.lastIndexOf('.') + 1)
@smarek
smarek / build.log
Created July 30, 2020 08:27
build-tests python
Translating: imports_abs
[error] (run-main-0) io.kaitai.struct.precompile.ErrorInInput: imports_abs: /meta/imports/0: Unable to find 'common/vlq_base128_le' in import search paths, using: List(../../formats)
[error] io.kaitai.struct.precompile.ErrorInInput: imports_abs: /meta/imports/0: Unable to find 'common/vlq_base128_le' in import search paths, using: List(../../formats)
[error] at io.kaitai.struct.formats.JavaClassSpecs$.cached(JavaClassSpecs.scala:75)
[error] at io.kaitai.struct.formats.JavaClassSpecs.$anonfun$importAbsolute$1(JavaClassSpecs.scala:31)
[error] at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:658)
[error] at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error] at scala.util.Success.map(Try.scala:213)
[error] at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
[error] at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
<?php
declare(strict_types=1);
namespace App\Controller;
use Cake\Controller\Controller;
use Closure;
use ReflectionFunction;
class AppController extends Controller
@smarek
smarek / default.php
Last active September 19, 2019 14:11
cakephp i18n language link
<?php
$parsed = Router::parseRequest($this->request);
unset($parsed['_matchedRoute']);
echo $this->Html->link('Čeština', array_merge($parsed, ['lang' => 'cz']));
echo ' | ';
echo $this->Html->link('English', array_merge($parsed, ['lang' => 'en']));
echo ' | ';
echo $this->Html->link('French', array_merge($parsed, ['lang' => 'fr']));
?>