This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| def upload_and_generate_mobi(source_file, output_file, title) | |
| puts "Dealing #{source_file} ..." | |
| # get key | |
| key = `curl -s http://ebook.cdict.info/mobi/ | grep progress_key`.match(/progress_key=([a-zA-Z0-9]+)/)[1] | |
| `curl -s "http://ebook.cdict.info/mobi/revalid.php?progress_key=#{key}"` | |
| `curl -s \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # replace symbols | |
| def rs(str) | |
| return str if str.blank? | |
| symbols = { | |
| '>' => '>', | |
| '<' => '<', | |
| '&' => '&' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Boot from USB... | |
| mkdir /mnt/arch | |
| cd /mnt/arch | |
| mount -t proc proc proc/ | |
| mount -t sysfs sys sys/ | |
| mount -o bind /dev dev/ | |
| chroot . /bin/bash | |
| mount -a | |
| pacman -S linux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| rand() { | |
| echo $(( $1 * RANDOM / 32768 )) | |
| } | |
| rand_element () { | |
| local -a th=("$@") | |
| echo "${th[$( rand ${#th[@]} )]}" | |
| } | |
| reviewers=(hSATAC poga aar0nTw hanklin kerkerj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| rand() { | |
| echo $(( $1 * RANDOM / 32768 )) | |
| } | |
| rand_element () { | |
| local -a th=("$@") | |
| echo "${th[$( rand ${#th[@]} )]}" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Gemfile.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # Usage | |
| # $ docker-machine create my-machine123 -d virtualbox | |
| # $ ruby <(curl -L https://git.io/vZT32) my-machine123 | |
| # https://gist.github.com/hSATAC/ac91f6cdc88c5a12ed5a | |
| require 'erb' | |
| bootlocalsh = %Q(#/bin/bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: uniqush-push | |
| # Required-Start: $remote_fs $network | |
| # Required-Stop: $remote_fs $network | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: starts uniqush-push | |
| # Description: Starts Uniqush provides a unified push service for server-side notification to apps on mobile devices. | |
| ### END INIT INFO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "runtime" | |
| "runtime/debug" | |
| "runtime/pprof" | |
| "strconv" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 記錄一下步驟 | |
| 1. 從 appstore 下載 OSX 安裝檔,不需要安裝 | |
| 2. gem install iesd | |
| 3. iesd -i /Applications/Install\ OS\ X\ Mavericks.app -o Mavericks.dmg -t BaseSystem 做完會在家目錄多一個 Mavericks.dmg | |
| 4. 開一個 VirtualBox 虛擬機器,選 OSX Mavericks 建立好以後先不要開機,進入設定 > 系統 > 晶片組選 PIIX3 然後確定 EFI 有打勾 |