跳到主要內容

發表文章

目前顯示的是 2016的文章

ASP.NET MVC ModelState 錯誤訊息

參考:http://www.cnblogs.com/darrenji/p/4415887.html  if (ModelState.IsValid) {         .... }else{                 String Message = "";                 var errors = ModelState.Where(m => m.Value.Errors.Any())                     .Select(x => x.Value.Errors);                 foreach (var item in errors)                 {                     var fieldErrors = item.Select(e => e.ErrorMessage).FirstOrDefault();                     Message += fieldErrors;                 } }

PandoraBox pptpd 設定

環境  LuCI Trunk (0.12+svn-r1024) PandoraBox R2 14.09 安裝 kmod-gre 防火牆設定 防火墙 - 通信规则 打开路由器端口 外部端口:1723 自定义规则 iptables -t nat -I PREROUTING -p gre -j DNAT iptables -A forwarding_rule -s 192.168.0.0/24 -j ACCEPT iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o br-lan -j MASQUERADE

解決 Debian-sh4 for NextVODBox 的 iptables 無法使用

網樂通是安裝下面網址的版本 https://ftp.yzu.edu.tw/Linux/debian-sh4-for-nextvod/download.php 架PPTPD時發現iptables 沒班法用 只好重新編譯Kernel & modules 了..QQ 1.取得config ssh登入網樂通 取得 /proc/config.gz 2.修改設定 參考這篇 http://mowei-tw.blogspot.tw/2016/12/kernel-modules.html 在編譯的時候 做完 make mrproper 把 config.gz 解壓 把"config" 改名成".config" mv condig .config make ARCH=sh CROSS_COMPILE=sh4-linux- menuconfig 參考這文章改設定 https://groups.google.com/forum/#!topic/asterisk-tw/3-Dalh3FZYQ Networking  ---->  Networking options  ---->   Network packet filtering framework (Netfilter)--->    Core Netfilter Configuration ---->     <*> Netfilter connection tracking support     <*> Netfilter Xtables support (required for ip_tables)     <*>   "NFLOG" target support     <*>   "conntrack" connection tracking match support     <*>   "state" match support    IP...

網樂通編譯Kernel & modules

參考網址: https://xiaolaba.wordpress.com/2012/10/20/ubuntu-12-10-stlinux-2-4/ http://www.twpda.com/2012/10/nextvod-compile-kernel.html https://github.com/dlintw/kernel-pdk7105/tree/twpda 編譯環境:linuxmint-18-cinnamon-64bit 1.安裝STLinux 2.4 參考 https://xiaolaba.wordpress.com/2012/10/20/ubuntu-12-10-stlinux-2-4/ 主要步驟為 下載 ISO 檔 mkdir STLinux cd STLinux wget ftp://ftp.stlinux.com/pub/stlinux/2.4/iso/STLinux-2.4-sh4-20121121.iso 掛載 ISO 檔 sudo mkdir /mnt/iso sudo mount -o loop STLinux-2.4-sh4-20120822.iso /mnt/iso 安裝 STLinux cd /mnt/iso sudo ./installb --debian all-sh4-glibc 2.下載原始碼 cd ~/STLinux wget https://github.com/dlintw/kernel-pdk7105/archive/twpda.zip unzip twpda.zip 3.編譯 cd kernel-pdk7105-twpda export PATH=$PATH:/opt/STM/STLinux-2.4/host/bin:/opt/STM/STLinux-2.4/devkit/sh4/bin make mrproper sh ./make.sh all 這邊整理一下我編譯出現的問題 1.build-essential 沒安裝 sudo apt-get install build-essential 2.make ARCH=sh CROSS_COMPILE=sh4-linux- menuconfig 出現ncurses...

[紀錄]小米路由器MINI 安裝套件

參考: http://www.miui.com/thread-2205749-1-1.html *須開啟ssh跟使用USB儲存設備 1.opkg設定 在USB設備上建立目錄 1.建立app資料夾 (app 資料夾可自行更名) 進入app資料夾 在建立bin資料夾 在x:/app/bin 放置 opkg 2.ssh cd /extdisks/sda1/ mkdir app (app 資料夾可自行更名) cd app mkdir bin cd bin wget https://drive.google.com/file/d/0Bx2A-Jefadp8NThYZnpOVWtnaXM/view?usp=sharing (想辦法放到哪裡下載下來吧XD) 確認檔案存在 /extdisks/sda1/app/bin/opkg 修改opkg設定檔 備份 cp /etc/opkg.conf /etc/opkg.conf.bak 編輯 vi /etc/opkg.conf 設定如下 src/gz barrier_breaker_base http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base src/gz barrier_breaker_luci http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/luci src/gz barrier_breaker_packages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages src/gz barrier_breaker_routing http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routing src/gz barrier_breaker_telephony http://downloads.openwrt.org/barrier_breaker/14.07/ra...

Kendo UI Grid 筆記

常用設定         var grid = $("#mygrid").kendoGrid({             dataSource: {                 transport: {                     read: {                         url: "/Home/data"                     }                 }             },             columns: [             { field: "Code", title: "代碼", width: "10%" },             { field: "Name", title: "名稱", width: "50%" },             { field: "", width: "40%", template: '<button class="k-button">按鈕一</button>' }             ],             ...

紀錄 Yi Camera live555 toolchain

http://en.miui.com/thread-137413-1-1.html http://nemon.org/ipcam-ipr1631x/ http://s000.tinyupload.com/?file_id=75004323688947916923 http://www.voidcn.com/blog/jiaozi07/article/p-3095821.html http://www.srchack.org/article.php?story=20150903014607230 http://wwww.ebaina.com/bbs/thread-4858-1-1.html

小蟻智慧攝影機支援RTSP

來源: http://en.miui.com/thread-196713-1-1.html 小蟻智慧攝影機版本: 1.8.5.1l_201511061661(台灣版) 下載檔案 https://drive.google.com/file/d/0ByjBix7wpeJJY0ZWZXlvWl9Za1E/view?usp=sharing 把攝影機SD卡拿讀卡機讀取 把壓縮檔內的test資料夾放進SD根目錄 插回SD卡至攝影機 重開 攝影機會呈現橘燈並執行更新 等恢復至藍燈或是用app確認攝影機開啟 用VLC或相關程式讀取串流 Main stream:rtsp:// <CameraIP> :554/ch0_0.h264 Minor stream:rtsp:// <CameraIP> :554/ch0_1.h264 Audio stream:rtsp:// <CameraIP> :554/ch0_3.h264 Telnet與FTP開啟加上 # Telnet if [ ! -f "/etc/init.d/S88telnet" ]; then     echo "#!/bin/sh" > /etc/init.d/S88telnet     echo "telnetd &" >> /etc/init.d/S88telnet     chmod 755 /etc/init.d/S88telnet fi # FTP echo "#!/bin/sh" > /etc/init.d/S89ftp echo "tcpsvd -vE 0.0.0.0 21 ftpd -w / &" >> /etc/init.d/S89ftp chmod 755 /etc/init.d/S89ftp User:  root Password:  1234qwer 使用passwd改密碼 參考: http://en.miui.com/thread-224653-1-1.html

小米路由器 mini 中繼模式啟動noip ddns

vi /etc/config/ddns config 'service' 'myddns' option 'service_name' 'noip.com' option 'enabled' '1' option 'domain' 'yourhost.no-ip.org' option 'usernamUe' 'your_username' option 'password' 'your_password' option 'interface' 'wan' option 'ip_source' 'network' option 'ip_network' 'wan' ddnsd start https://wiki.openwrt.org/doc/howto/ddns.client wan 改成區網對外網卡就可以了 一樣可以抓到真實IP

taiko

#include "UsbJoystick.h" #define PIEZOTHRESHOLD 70 #define PADNUM 4 unsigned long time[PADNUM] = {0,0,0,0}; int tempval[PADNUM] = {0,0,0,0}; unsigned long buttontime[PADNUM] = {0,0,0,0}; void setup() {   UsbJoystick.setup(); } void loop() {   UsbJoystick.update();   for(int i = 0; i < PADNUM; i++) {     buttondelay(i);   }   UsbJoystick.sendMsg(); } void buttondelay(int pad){  if ((millis() - buttontime[pad]) > 10) {     int val = analogRead(pad);     if( val >= PIEZOTHRESHOLD ) {       if(tempval[pad]==0){         sendmsg(pad,tempval[pad]);       }       if (val>tempval[pad]){       tempval[pad]=val;       }     }else{       if (tempval[pad]>PIEZOTHRESHOLD){           tempval[pad]=0;       }     }  }else{ ...