Skip to content

Instantly share code, notes, and snippets.

View sergachev's full-sized avatar

Ilia Sergachev sergachev

  • NVIDIA
  • Zurich
  • 22:27 (UTC +02:00)
View GitHub Profile
import sys
import pathlib
import subprocess
for fn in pathlib.Path(sys.argv[1]).glob('*'):
ext = subprocess.getoutput(f'file --extension {fn}').split(' ')[-1].split('/')[0].split(',')[0]
assert ext.isalnum()
fn.rename(fn.with_suffix('.' + ext))
python3 test_split.py ../llvm-test-suite/Bitcode/simd_ops/ARM_tests/test_op_vsubw_u32_658.bc
total functions: 4
before:
0 function(s): 1 module(s)
1 function(s): 2 module(s)
2 function(s): 1 module(s)
after:
1 function(s): 4 module(s)
@sergachev
sergachev / TechLifePro_Setup.py
Last active July 3, 2020 20:13 — forked from csabavirag/TechLifePro_Setup.py
Techlife pro Smart Bulb scripts
#!/usr/bin/env python
# 1. Modify the variables according to your setup: ssid, password, bssid, [email]
# 2. Connect the computer to AP-TechLife-xx-xx SSID
# 3. Run the script
import socket
# Variables to change
ssid = '**YOURSSID**'
password = '**WIFIPASSWORD**'
bssid = bytearray([0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa]) # Enter your WiFi router's WiFi interface MAC address in hex (eg. AA:AA:AA:AA:AA:AA)
@sergachev
sergachev / build_custom_openwrt.sh
Created April 4, 2018 12:41
downloads latest openwrt imagebuilder and builds a firmware image
#!/bin/sh
wget https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-imagebuilder-ramips-mt7621.Linux-x86_64.tar.xz
tar -xvf openwrt-imagebuilder-ramips-mt7621.Linux-x86_64.tar.xz
cd openwrt-imagebuilder-ramips-mt7621.Linux-x86_64
make image PROFILE=zbt-we1326 PACKAGES="luci \
kmod-usb-net kmod-usb-net-cdc-ether kmod-usb-serial-qualcomm kmod-usb-net-qmi-wwan kmod-usb-net-rndis kmod-usb-wdm luci-proto-qmi uqmi \
block-mount kmod-usb-storage kmod-usb3 usb-modeswitch usbutils fdisk \
fstools f2fs-tools f2fsck kmod-fs-f2fs mkf2fs \
@sergachev
sergachev / adb_install.sh
Created March 22, 2015 22:51
install rockbox to DX50 via adb
#!/bin/sh
make -j all zip
read -n1 -r -p "Press any key to continue"
echo
cd ../rbutil/ibassoboot/jni/ && $ANDROID_NDK_PATH/ndk-build
read -n1 -r -p "Press any key to continue"
echo
cd -
@sergachev
sergachev / adb_patch.py
Created March 22, 2015 18:12
Patch iBasso DX50 firmware to switch USB mode to ADB
import sys
from subprocess import call
TOOLS_PATH = './rk-tools/'
# optional steps:
# 1. download and compile rk-tools
# git clone https://github.com/rk3066/rk-tools.git
# cd rk-tools && make