Skip to content

Instantly share code, notes, and snippets.

View imZack's full-sized avatar
🤠
Make bugs

YuLun Shih imZack

🤠
Make bugs
  • Moxa
  • Taipei, Taiwan
View GitHub Profile
@imZack
imZack / download.py
Created November 29, 2017 09:42 — forked from idolpx/download.py
Python HTTP download with resume and optional MD5 hash checking
import os.path
import requests
import shutil
import hashlib
import logging
def validate_file(file_path, hash):
"""
Validates a file against an MD5 hash value
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@imZack
imZack / sierra_mc7355_flashing.md
Created June 8, 2017 09:46 — forked from mleinart/sierra_mc7355_flashing.md
Flashing Carrier configuration and updated firmware to a Sierra MC7355

Overview

The Sierra MC7355 can run configurations for several North American carriers. These cards are easy to find on eBay and notable for their support for the Sprint LTE network. Unless you're luck out, you may find you need to flash a new carrier configuration onto the card you purchased before using it.

Notes

These procedures are specific to the setup I had to perform this on. Most notably, the only system I had with a mini-PCI-e slot was the target pfSense system, a PCengines APU1d with no VGA port (serial console only). If you're able to obtain a

[6543782.657324] ------------[ cut here ]------------
[6543782.657375] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:303 dev_watchdog+0x2a4/0x2b0()
[6543782.657389] NETDEV WATCHDOG: eth0 (smsc95xx): transmit queue 0 timed out
[6543782.657401] Modules linked in: bnep bluetooth ipt_REJECT nf_reject_ipv4 xt_multiport xt_nat veth xt_conntrack ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype iptable_filter nf_nat nf_conntrack br_netfilter bridge stp llc overlay cfg80211 rfkill xt_TCPMSS xt_tcpmss xt_tcpudp iptable_mangle ip_tables x_tables pppoe pppox ppp_generic slhc snd_bcm2835 snd_pcm bcm2835_gpiomem bcm2835_rng snd_timer snd uio_pdrv_genirq uio ipv6
[6543782.657630] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.19-v7+ #858
[6543782.657642] Hardware name: BCM2709
[6543782.657685] [<800185e0>] (unwind_backtrace) from [<80013f48>] (show_stack+0x20/0x24)
[6543782.657714] [<80013f48>] (show_stack) from [<805730bc>] (dump_stack+0xd4/0x118)
[6543782.657741
@imZack
imZack / qmi_dissector.lua
Created May 12, 2016 06:23 — forked from ivoronin/qmi_dissector.lua
Wireshark Dissector for Qualcomm MSM Interface (QMI) Protocol
--[[
Wireshark Dissector for Qualcomm MSM Interface (QMI) Protocol v0.1
Copyright (c) 2012 Ilya Voronin <ivoronin@gmail.com>
Based on Code Aurora Forum's BSD/GPL licensed code:
http://www.codeaurora.org/contribute/projects/gobi/
Short howto for using this script:
@imZack
imZack / node_debian_init.sh
Last active September 15, 2015 09:24 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@imZack
imZack / zram.sh
Last active December 30, 2020 15:39 — forked from voyeg3r/zram.sh
How enable zram module on kernel (debian lik distro)?
#!/bin/bash
### BEGIN INIT INFO
# Provides: zram
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Increased Performance In Linux With zRam (Virtual Swap Compressed in RAM)
# Description: Adapted from systemd scripts at https://github.com/mystilleef/FedoraZram
### END INIT INFO
@imZack
imZack / ans.py
Last active September 6, 2015 06:36
hitcon 2015 nano wargame
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import serial
import time
port = None
lines = []
@imZack
imZack / benchmark.sh
Created September 5, 2015 08:50
benchmark io speed
#!/bin/sh
sync
echo 3 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=/test bs=8k count=100k
@imZack
imZack / preprocessor_fun.h
Last active August 29, 2015 14:27 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,