Skip to content

Instantly share code, notes, and snippets.

View Mnkai's full-sized avatar
💭
I'm currently busy with my primary work. Some delays are expected.

Mnkai

💭
I'm currently busy with my primary work. Some delays are expected.
View GitHub Profile
@Mnkai
Mnkai / mastodon-stop.hook
Created November 12, 2017 02:05
Pacman compatible libalpm hook for stopping mastodon service before transaction
[Trigger]
Operation = Upgrade
Type = Package
Target = imagemagick
Target = ffmpeg
Target = protobuf
Target = nginx
Target = redis
Target = postgresql
Target = nodejs
@Mnkai
Mnkai / thermalPrint.sh
Last active October 25, 2017 23:20
Printing markdown document to thermal printer by command line - depends on pandoc and wkhtmltopdf
#!/usr/bin/zsh
pandoc "$1" -o "/tmp/print_temp_out.html" --wrap=preserve -f markdown -t html -s
wkhtmltopdf --encoding utf-8 --margin-top 1mm --margin-bottom 7mm --margin-left 0mm --margin-right 0mm --page-height 210mm --page-width 47mm --grayscale "/tmp/print_temp_out.html" "/tmp/print_temp_out.pdf"
lp -d Zjiang-58 "/tmp/print_temp_out.pdf"
rm "/tmp/print_temp_out.pdf"
rm "/tmp/print_temp_out.html"
@Mnkai
Mnkai / gist:06a1560d14e2a8d429355de169d8b672
Last active October 5, 2020 05:36
Huawei E5885 OTA filelist
URL (Sysfirm/WebUI)
* Note that global firmware ends with 00, Chinese ends with 233, Arabic ends with 1133
http://update.hicloud.com:8180/TDS/data/files/p9/s43/G134/g0/v73927/f1/full/filelist.xml (21.233.01.00.00/21.100.27.00.00)
http://update.hicloud.com:8180/TDS/data/files/p9/s43/G134/g0/v76581/f1/full/filelist.xml (21.235.01.00.00/21.100.28.00.00)
http://update.hicloud.com:8180/TDS/data/files/p9/s92/G247/g0/v96740/f1/full/filelist.xml (21.236.05.00.1133/21.100.32.01.1133)
http://update.hicloud.com:8180/TDS/data/files/p9/s43/G134/g0/v90819/f1/full/filelist.xml (21.236.05.01.233/21.100.32.01.233)
http://update.hicloud.com:8180/TDS/data/files/p9/s43/G134/g0/v98037/f1/full/filelist.xml (21.170.63.00.233/21.100.32.02.233)
@Mnkai
Mnkai / transfermd.sh
Created March 20, 2017 12:32
Script for transfering preconverted ATRAC3 files to NetMD
#!/bin/zsh
for file in $PWD/*.(aa3) ; do
fullfilename=$(basename $file)
filename=${fullfilename%.*}
# linux-minidisc found here: https://wiki.physik.fu-berlin.de/linux-minidisc/doku.php
sudo ../netmdcli send "$fullfilename" "$filename"
done
@Mnkai
Mnkai / convmdlp2.sh
Last active March 20, 2017 12:30 — forked from Lana-chan/md.sh
Zsh script for batch converting wav, flac, mp3 files into ATRAC3-LP2 format (MDLP)
#!/bin/zsh
mkdir aa3
for file in $PWD/*.(mp3|flac|wav) ; do
fullfilename=$(basename $file)
filename=${fullfilename%.*}
ffmpeg -nostats -loglevel panic -i $fullfilename -ar 44100 temp.wav
# ATRAC3Tool can be found here: https://github.com/Treeki/atrac3tool
/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@Mnkai
Mnkai / brcmfmac43430-sdio.txt
Last active February 8, 2017 13:29
Hi8 bcm43430 nvram
#AP6212_NVRAM_V1.0_20140603_intel
# 2.4 GHz, 20 MHz BW mode
# The following parameter values are just placeholders, need to be updated.
manfid=0x2d0
prodid=0x0726
vendid=0x14e4
devid=0x43e2
boardtype=0x0726
boardrev=0x1101
@Mnkai
Mnkai / minorister.zsh-theme
Last active February 8, 2017 01:51
Minorister oh-my-zsh theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# Minorister
# Dirty mix of agnoster and paradox theme
# I missed paradox theme of prezto even after installing oh-my-zsh
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
@Mnkai
Mnkai / key.md
Created April 21, 2016 02:19
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA