跳到主要內容

發表文章

目前顯示的是 12月, 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: Netfilter Configuration --->     <*> IPv4

網樂通編譯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