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 / main.go
Created August 25, 2022 09:14 — forked from walm/main.go
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@imZack
imZack / notify.yml
Created March 15, 2022 14:09 — forked from trung/notify.yml
Notify slack about Github Actions workflow and its jobs status. `notify` job must be the last job in the workflow and it must depend on all other jobs
notify:
if: always()
name: Notify
needs:
- job1
- job2
- job11
- job3
- job4
runs-on: ubuntu-latest
@imZack
imZack / mount-bitlocker
Created September 13, 2021 07:47 — forked from dumbledore/mount-bitlocker
Mount/umount wrapper for dislocker on MacOS
#!/bin/bash
BITLOCKER_PARTITION="${1}"
BITLOCKER_PASSWORD="${2}"
function usage() {
echo "$(basename ${0}) <partition> <password>"
echo "Unlocks and mounts a bitlocker partition as read-only"
}
if [ -z "${BITLOCKER_PARTITION}" ]
@imZack
imZack / README.md
Created March 30, 2021 02:20 — forked from reegnz/README.md
CamelCase <--> snake_case conversion in jq

CamelCase <--> snake_case conversion with jq

tl;dr

I provide you with 3 jq lib functions that will help you in converting between snake_case and CamelCase.

The interface

I want to change keys in my json from camelcase to snake_case.

@imZack
imZack / convertBareRepoToNormalRepo.sh
Created March 29, 2021 09:07 — forked from Pelt10/convertBareRepoToNormalRepo.sh
Convert directory with git bare repo (Gitlab repo) to normal repo
echo "****************************************************"
echo "* *"
echo "* CONVERT BARE REPO TO NORMAL REPO *"
echo "* *"
echo "****************************************************"
echo " -> untar repo.tar.gz"
tar -zxf repo.tar.gz
for user in $(ls repositories/); do
for repo in $(ls repositories/$user/); do
pathRepo="repositories/$user/$repo/";
@imZack
imZack / sched-reboot.service
Created February 26, 2020 02:32 — forked from hkoba/sched-reboot.service
systemd service and timer for scheduled reboot.
[Unit]
Description=Scheduled Reboot
[Service]
Type=simple
ExecStart=/usr/bin/systemctl --force reboot
@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

@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: