Skip to content

Instantly share code, notes, and snippets.

@fuyuanli
fuyuanli / gist:8718411
Last active August 29, 2015 13:55
reset還原xbmc失敗
Factory reset mode
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
942848 inodes, 1882520 blocks
37650 blocks (2.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1929379840
NextVOD:~# cat /proc/meminfo
MemTotal: 83436 kB
MemFree: 69900 kB
Buffers: 72 kB
Cached: 1548 kB
SwapCached: 0 kB
Active: 2304 kB
Inactive: 680 kB
Active(anon): 1348 kB
Inactive(anon): 0 kB
@fuyuanli
fuyuanli / a003
Created June 28, 2014 16:52
a003
#include<iostream>
using namespace std;
int main()
{
int M,D,S;
while(cin>>M>>D){
S=(M*2+D)%3;
if(S==0){
cout<<"\n"<<"普通\n";
https://gist.github.com/bhwebworks/7233529
wget https://drive.google.com/uc?id=0B3X9GlR6EmbnMHBMVWtKaEZXdDg -O drive #下載編譯好的檔案,並命為 drive
chmod +x drive #給予 drive 執行權限
mv drive /usr/local/bin/ #移動到 /usr/local/bin/
wget http://tpdb.speed2.hinet.net/test_400m.zip
drive upload -f 檔案名稱
@fuyuanli
fuyuanli / sources.list
Last active August 29, 2015 14:23
debian-sh4
#/etc/apt/sources.list
deb [arch=all] http://debian.csie.nctu.edu.tw/debian/ wheezy main contrib non-free
deb-src http://debian.csie.nctu.edu.tw/debian/ wheezy main contrib non-free
deb [arch=all] http://debian.csie.ntu.edu.tw/debian/ wheezy main contrib non-free
deb-src http://debian.csie.ntu.edu.tw/debian/ wheezy main contrib non-free
deb [arch=sh4] http://download.si-linux.co.jp/debian-sh/wheezy-sh4/ wheezy main contrib non-free
deb-src http://download.si-linux.co.jp/debian-sh/wheezy-sh4/ wheezy main contrib non-free
#!/bin/bash
#相關設定說明:https://goo.gl/K5ucXJ
#這隻小腳本應該可以丟掉OpenShift內的Cron功能跑,不用自己開機監控:http://www.cystc.org/?p=2940&lang=zh-tw
#判斷依據可以自己找適合的方法寫,如果是虛擬主機掛掉可能就不適合用Ping了,也可以用curl抓網頁字串是否存在來判斷存活
ping -c 1 -w 10 主機A > /dev/null 2>&1
if [ $? = 0 ] #判斷主機是否上線
then #主機A上線,OK
echo "ServerA is live~"
@fuyuanli
fuyuanli / gist:ad7c34dc56fa345099a7
Created June 28, 2015 04:51
網樂通鏡像官方 debian-ports
# 1. 安裝 apt-mirror。
apt-get install apt-mirror
# 2. 編輯 apt-mirror 設定。
vi /etc/apt/mirror.list
############# config ##################
set base_path /media/sdb1/debian-sh4 # 鏡像儲存位置,此處為外接硬碟。
# set mirror_path $base_path/mirror