Skip to content

Instantly share code, notes, and snippets.

View maz-1's full-sized avatar
🐢
slow to respond

maz-1 maz-1

🐢
slow to respond
  • WolkenVision AG
  • China
View GitHub Profile
#!/usr/bin/env lua
--[[ by maz-1 ohmygod19993@gmail.com ]]--
local socket = require 'socket'
local copas = require 'copas'
local uci = require "luci.model.uci".cursor()
local sys = require "luci.sys"
@maz-1
maz-1 / rootactions_fix_i18n.patch
Created January 23, 2017 11:59
Fix kde-servicemenus-rootactions i18n support
diff -Naur a/Root_Actions_2.9/rootactions-servicemenu.pl b/Root_Actions_2.9/rootactions-servicemenu.pl
--- a/Root_Actions_2.9/rootactions-servicemenu.pl 2017-01-23 19:01:50.962827697 +0800
+++ b/Root_Actions_2.9/rootactions-servicemenu.pl 2017-01-23 19:02:34.582792120 +0800
@@ -896,7 +896,8 @@
$KDELANG = $ENV{LANG};
+ $KDELANG =~ s/\..*//;
}
chomp($KDELANGSHT = substr("$KDELANG",0,2));
return 0;
@maz-1
maz-1 / rootactions_zh_CN_translation.patch
Created January 23, 2017 12:02
Add simplified chinese to kde-servicemenus-rootactions
diff -Naur a/Root_Actions_2.9/dolphin-KDE4/10-rootactionsfolders.desktop b/Root_Actions_2.9/dolphin-KDE4/10-rootactionsfolders.desktop
--- a/Root_Actions_2.9/dolphin-KDE4/10-rootactionsfolders.desktop 2012-03-29 12:36:59.000000000 +0800
+++ b/Root_Actions_2.9/dolphin-KDE4/10-rootactionsfolders.desktop 2017-01-23 18:27:58.064836029 +0800
@@ -31,6 +31,7 @@
X-KDE-Submenu[sr@latin]=Korene &akcije
X-KDE-Submenu[sv]=Root åtgärder
X-KDE-Submenu[tr]=&Yetkili Eylemleri
+X-KDE-Submenu[zh_CN]=Root操作
#X-KDE-Submenu[xx]=Your string 'xx' is the country abbreviation
@maz-1
maz-1 / update-recoveryhd.sh
Last active January 29, 2017 15:06
update prelinkedkernel in mac os recovery hd, for hackintosh
#!/bin/sh
set -e
if [[ $EUID -ne 0 ]]; then
exec sudo "$0"
exit 1
fi
#ROOTDISK=$(mount|grep ' on / '|egrep -o 'disk\d*')
REC_DEV=$(diskutil info `df /|awk '/disk/ {print $1}'`|awk '/Recovery Disk:/ {print $3}')
#mkdir -p /Volumes/Recovery\ HD/
#mount -t hfs ${REC_DEV} /Volumes/Recovery\ HD/
@maz-1
maz-1 / natspec.rb
Created January 30, 2017 07:12
Homebrew Formula for natspec
desc "Library for national and language-specific issues"
homepage "http://sourceforge.net/projects/natspec/"
url "http://sourceforge.net/projects/natspec/files/natspec/0.3.0/libnatspec-0.3.0.tar.bz2"
sha256 "678db5f2e25be3e79183ecc9ff6b19fb66775bcb6c3c962ba7716bc4a8ecce71"
bottle do
cellar :any
sha256 "84aefa7e2449d8162aca396921a568c556f2191db72fd5f03ee2daf6cf9485bd" => :sierra
sha256 "2efac098c764845cae4a33c4788fd2f811a6a62a9345e4dcdebe4097cd1e09f3" => :el_capitan
sha256 "7a70c24489fcd92a6f3845dd945eb0822d4018ef937747c720522a1e70e90fdb" => :yosemite
@maz-1
maz-1 / natspec_p7zip1602.patch
Created January 30, 2017 07:12
natspec patch for p7zip 1602 test
diff -Naur -x '.*' a/CPP/7zip/Archive/Zip/ZipIn.cpp b/CPP/7zip/Archive/Zip/ZipIn.cpp
--- a/CPP/7zip/Archive/Zip/ZipIn.cpp 2016-05-20 16:20:03.000000000 +0800
+++ b/CPP/7zip/Archive/Zip/ZipIn.cpp 2017-01-30 14:51:29.000000000 +0800
@@ -2,6 +2,9 @@
#include "StdAfx.h"
+#include <iconv.h>
+#include <natspec.h>
+
@maz-1
maz-1 / appify
Created February 17, 2017 10:43 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@maz-1
maz-1 / appify
Last active February 17, 2017 10:47 — forked from subtleGradient/appify
appify. Create the simplest possible mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@maz-1
maz-1 / LyricImporter.lua
Last active June 16, 2017 03:35
Import Lyric file for Aegisub. Depends on https://github.com/davidm/lua-compress-deflatelua
local tr = aegisub.gettext
script_name = tr"Import Lyric file"
script_description = tr"Import Lyric file for Aegisub"
script_author = "domo & SuJiKiNen & maz_1"
script_version = "1.03"
local deflate = require "compress.deflatelua"
local bit = require("bit")
local Kugoo_keys = {64, 71, 97, 119, 94, 50, 116, 71, 81, 54, 49, 45, 206, 210, 110, 105}
@maz-1
maz-1 / stdout2var.ahk
Last active October 26, 2018 12:05
Store command line output in autohotkey variable. Supports both x86 and x64.
StdOutStream( sCmd, Callback := "", WorkingDir:=0, ByRef ProcessID:=0) { ; Modified : maz-1 https://gist.github.com/maz-1/768bf7938e533907d54bff276db80904
Static StrGet := "StrGet" ; Modified : SKAN 31-Aug-2013 http://goo.gl/j8XJXY
; Thanks to : HotKeyIt http://goo.gl/IsH1zs
; Original : Sean 20-Feb-2007 http://goo.gl/mxCdn
tcWrk := WorkingDir=0 ? "Int" : "Str"
DllCall( "CreatePipe", UIntP,hPipeRead, UIntP,hPipeWrite, UInt,0, UInt,0 )
DllCall( "SetHandleInformation", UInt,hPipeWrite, UInt,1, UInt,1 )
If A_PtrSize = 8
{
VarSetCapacity( STARTUPINFO, 104, 0 ) ; STARTUPINFO ; http://goo.gl/fZf24