發表文章

Synology 群暉 NAS 2.5G 10G 多網卡 橋接

圖片
1. 控制台→網路→網路介面→管理→Open vSwitch設定→啟動Open vSwitch(把這個選項打勾)→確定 2. 透過SSH連線,輸入"ovs-vsctl show",會顯示目前網卡橋接狀態,第一個網卡為eth0 第二為eth1 以此類推。 3. 確定要橋接的網卡編號,輸入"ovs-vsctl del-br ovs_eth1"(eth後的數字自行更改),將網卡從預設橋接器中移除。 4. 輸入 "ovs-vsctl add-port ovs_eth0 eth1",將網卡橋接到某虛擬橋接器。 範例 ovs-vsctl del-br ovs_eth1 //刪除ovs_eth1橋接器 ovs-vsctl del-br ovs_eth2 //刪除ovs_eth12接器 ovs-vsctl add-port ovs_eth0 eth1 // 將eth1橋接到 ovs_eth0 ovs-vsctl add-port ovs_eth0 eth2 // 將eth2橋接到 ovs_eth0 ovs-vsctl show // 顯示橋接狀態 5. 只要關機或重新開機後Open vSwitch設定會消失,如需啟動後自動設定,可以將指令加入倒任務排程表。 控制台→任務排程表→新增→觸發任務→使用者定義指令碼 使用者帳號選root 事件選開機 任務設定→使用者定義指令碼→填入要執行的Open vSwitch指令 可以把"透過電子郵件寄送執行結果"打勾,就可以看到執行結果

UVA 11321 Java

import java.util.*; import static java.lang.System.*; public class main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNextInt()) { int num = sc.nextInt(); int m = sc.nextInt(); System.out.printf("%d %d\r\n", num, m); if(num == 0&& m == 0) break; Data[] datas = new Data[num]; for(int i = 0; i { int n; int r; boolean even; Data(int n, int r, boolean even) { this.n = n; this.r = r; this.even = even; } public String toString() { return Integer.toString(this.n); } @Override public int compareTo(Data other) { if(this.r != other.r) return this.r

UVA 118 Java

import java.util.*; import static java.lang.System.*; public class main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int w = sc.nextInt(), h = sc.nextInt(); boolean drop_loc[][] = new boolean[51][51]; while(sc.hasNext()) { int x = sc.nextInt(), y = sc.nextInt(); char ori = sc.next().charAt(0); String cmd = sc.next(); boolean drop = false; for(int i = 0; i w || tempy > h) { if(!drop_loc[x][y]) { drop_loc[x][y] = true; drop = true; break; } } else { x = tempx; y = tempy; } } } if(drop) { System.out.printf("%d %d %c LOST\r\n", x, y, ori); } else System.out.printf("%d %d %c\r\n", x, y, ori); } } };

UVA 10415 Java

import java.util.*; import static java.lang.System.*; public class main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int cases = sc.nextInt(); for(int t = 0; t

UVA 10409 Java

import java.util.*; import static java.lang.System.*; public class main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNextInt()) { int num = sc.nextInt(); if(num == 0) break; int top = 1, n = 2, w = 3, s = 5, e = 4; for(int i = 0; i

UVA 10189 Java

import java.util.*; import static java.lang.System.*; public class main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t = 0, h = 0, w =0; while(sc.hasNextInt()) { h = sc.nextInt(); w = sc.nextInt(); if(h == 0 || w == 0) break; if(t != 0) System.out.println(); System.out.printf("Field #%d:\r\n", ++t); char[][] map = new char[h][w]; for(int i = 0; i = 0 && map[i - 1][j] == '*') count++; if( i + 1 = 0 && map[i][j - 1] == '*') count++; if( j + 1 = 0 && j - 1 >= 0 && map[i - 1][j - 1] == '*') count++; if( i - 1 >= 0 && j + 1 = 0 && map[i + 1][j - 1] == '*') count++; if( i + 1

UVA 10057 Java

import java.util.*; import static java.lang.System.*; public class main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNextInt()) { int n = sc.nextInt(); int[] datas = new int[n]; for(int i = 0; i