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
[af.policy.r_submix_prio_adjust]: [0]
[af.rf_info]: [273]
[bgw.current3gband]: [0]
[camera.disable_zsl_mode]: [1]
[curlockscreen]: [1]
[dalvik.vm.dex2oat-Xms]: [64m]
[dalvik.vm.dex2oat-Xmx]: [512m]
[dalvik.vm.heapgrowthlimit]: [128m]
[dalvik.vm.heapsize]: [256m]
[dalvik.vm.image-dex2oat-Xms]: [64m]
@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 / get_single.py
Created May 30, 2018 05:22
WebVisu get single property
#!/usr/bin/python
import requests #you might need to install requests separatelly
import sys
req = "|0|1|0|" + str(sys.argv[2]).replace(",","|")
addr = "http://" + str(sys.argv[1])
print req
r = requests.post(addr + '/webvisu/webvisu.htm', data=req)
@smarek
smarek / webvisu.py
Last active June 1, 2018 12:42
WebVisu automate
#!/usr/bin/python
import requests #you might need to install requests separatelly
import sys
from IPy import IP
import re
if len(sys.argv) == 1:
print "Usage: webvisu.py <target ip address> <folder with webvisu.htm and visu_ini.xml>"
sys.exit(0)
@smarek
smarek / 00README.md
Last active May 26, 2024 18:13
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 / about.md
Last active May 28, 2019 05:31
MariaDB Tarantool Replication script - now available as full project systemd-integrated, https://github.com/smarek/mariadb-tarantool-replication
@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 / assoc.php
Created August 26, 2019 08:12
cakephp remove all associated fields from entity
<?php
public function entityStripAssociations(Entity &$entity)
{
/** @var Table $table */
$table = TableRegistry::getTableLocator()->get($entity->getSource());
foreach ($table->associations() as $asoc) {
$entity->unsetProperty($asoc->getProperty());
}
return $entity;
}
@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']));
?>
@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