昇級網速並換新IP
05/03/2016, 19:00 - 今天
昇級網路速,結果就要重設IP Address...
正反解都設好了.
再來就來想辦法看AP上可不可以跑IPv6 Tunnel吧.
發表回應 發表回應 ( 3899預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 284 )

Restore and Recovery Apple TV 2
12/03/2015, 08:57 - Apple
Since Apple announce Apple TV 4,
my Apple TV 2 was dead, is that a joke?
maybe not, I found the secret code in download recovery image with iTunes.

發表回應 發表回應 ( 944預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 2.9 / 325 )

Ethernet calculate in script
12/01/2015, 14:23 - Network
Ethernet calculate in script

bandwidth.sh
#!/bin/bash
#
# ${CALC} is package "ap${CALC}"
#
# Phy Speed
SPEED_LIST="10 100 1000 2500 10000"
# Transport Unit Size
MTU_LIST="46 1500 9000 16000"
# VLAN tag number
VLAN_TAG_LIST="0"
#
CALC=$(whereis calc | cut -d' ' -f2 )
#
Kb=1000
Mb=$( ${CALC} "1000 * ${Kb}" )
Gb=$( ${CALC} "1000 * ${Mb}" )
#
# 96bit time
ethInterFrameGap=96
# 7+1Byte
ethPreamble=8
# 6Byte
ethDestMAC=6
# 6Byte
ethSrcMAC=6
# 2Byte
ethType=2
# 4Byte
ethVLAN=4
# 46Byte
minMTU=46
# 4Byte
ethFCS=4
#
function frameNumFunc() {
local speed=$1 # First Argument as Physical SPEED
local mtu=$2 # Second Argument as MTU
local tag=$3 # Thrid Arhument as VLAN Tag number
# calculate in bit wide
local frameSizeNum=$( ${CALC} "${ethDestMAC}+${ethSrcMAC}+${ethType}+${mtu}+${
ethFCS}+(${tag}*${ethVLAN})" )
local frameNumRaw=$( echo $( ${CALC} "${speed}/(${ethInterFrameGap}+(${ethPrea
mble}+${frameSizeNum})*8)" ) | sed -e 's/^~//g' )
local frameNum=$( ${CALC} "int(${frameNumRaw})" )
echo ${frameNumRaw} ${frameNum} ${frameSizeNum} # Return Maximum Transmit Fram
e number
}
#
function efficiencyFunc () {
local speed=$1
local mtu=$2
local frameNumber=$3
#
local efficiencyUsage=$( ${CALC} "${mtu}*${frameNumber}*8" )
local efficiencyNum=$( ${CALC} "${efficiencyUsage}/${speed}" )
echo ${efficiencyNum} $( ${CALC} "${efficiencyUsage}/${Mb}" )
}
#
function bandwidthFunc () {
local speed=$1
local overheadRate=$2
#
bandwidthNum=$( ${CALC} "(${speed}*(1-${overheadRate}))/${Mb}" )
echo ${bandwidthNum}
}
#
function overheadFunc () {
local speed=$1
local frameNum=$2
#
local overheadRate=$( ${CALC} "(${ethInterFrameGap} * ${frameNum})/${speed}" )
echo ${overheadRate}
}
#
function calculateFunc () {
local speed=$( expr $1 + 0 )
local mtu=$( expr $2 + 0 )
local vlanTag=$( expr $3 + 0 )
#
local bandwidthNums=$( ${CALC} "${speed} * ${Mb}" )
#
local frameNumbers=$( frameNumFunc ${bandwidthNums} ${mtu} ${vlanTag} )
local frameNums=$( echo ${frameNumbers} | cut -d' ' -f2 )
local frameNumsRaw=$( echo ${frameNumbers} | cut -d' ' -f1 )
local frameSizeNums=$( echo ${frameNumbers} | cut -d' ' -f3 )
#
local frameOverheadNums=$( overheadFunc ${bandwidthNums} ${frameNums} )
#
local efficiencyNumbers=$( efficiencyFunc ${bandwidthNums} ${mtu} ${frameNums
} )
local effNums=$( echo ${efficiencyNumbers} | cut -d' ' -f1 )
local effBandwidthNums=$( echo ${efficiencyNumbers} | cut -d' ' -f2 )
local bandwidth=$( bandwidthFunc ${bandwidthNums} ${frameOverheadNums} )
#
echo ${frameNums} ${frameOverheadNums} ${effNums} ${effBandwidthNums} ${bandwi
dth} ${frameSizeNums}
}
#
printf "===============================================================\n"
#
for i in ${SPEED_LIST} ; do
echo -e "Bandwidth:\t\t\t\t\t${i} Mbit"
#
for j in ${MTU_LIST} ; do
for k in ${VLAN_TAG_LIST} ; do
result=$( calculateFunc $i $j $k )
#
frames=$( echo ${result} | cut -d' ' -f 1 )
frameSize=$( echo ${result} | cut -d' ' -f 6 )
overheadRate=$( echo ${result} | cut -d' ' -f 2 )
overheadRatePercent=$( ${CALC} "($overheadRate+0)*100" )
efficiencyRate=$( echo ${result} | cut -d' ' -f 3 )
efficiencyRatePercent=$( ${CALC} "($efficiencyRate+0)*100" )
efficiencyBandwidthSpeed=$( echo ${result} | cut -d' ' -f 4 )
bandwidthSpeed=$( echo ${result} | cut -d' ' -f 5 )
#
echo -e "---------------------------------------------------------------"
echo -e "\tMTU Size:\t\t\t\t${j} Byte"
#
if [ "${k}" -eq "0" ]; then
T="None"
else
T=${k}
fi
#
echo -e "\t\tVLAN Tag:\t\t\t${T} Tag"
echo -e "\t\tFrame Size:\t\t\t${frameSize} Byte"
echo -e "\t\tMax Frame per second:\t\t${frames}"
echo -e "\t\tOverhead Rate:\t\t${overheadRatePercent}%"
echo -e "\t\tEfficiency Rate:\t${efficiencyRatePercent}%"
#
if [ "$( ${CALC} "${i} * ${Mb}" )" -gt "${Gb}" ]; then
bandwidthSpeed=$( ${CALC} "${bandwidthSpeed}/1000" )
efficiencyBandwidthSpeed=$( ${CALC} "${efficiencyBandwidthSpeed}/1000" )
#
echo -e "\t\tTransport Bandwidth:\t${bandwidthSpeed} Gbit"
echo -e "\t\tEfficiency Bbandwidth.sh
#!/bin/bash
#
# ${CALC} is package "ap${CALC}"
#
# Phy Speed
SPEED_LIST="10 100 1000 2500 10000"
# Transport Unit Size
MTU_LIST="46 1500 9000 16000"
# VLAN tag number
VLAN_TAG_LIST="0"
#
CALC=$(whereis calc | cut -d' ' -f2 )
#
Kb=1000
Mb=$( ${CALC} "1000 * ${Kb}" )
Gb=$( ${CALC} "1000 * ${Mb}" )
#
# 96bit time
ethInterFrameGap=96
# 7+1Byte
ethPreamble=8
# 6Byte
ethDestMAC=6
# 6Byte
ethSrcMAC=6
# 2Byte
ethType=2
# 4Byte
ethVLAN=4
# 46Byte
minMTU=46
# 4Byte
ethFCS=4
#
function frameNumFunc() {
local speed=$1 # First Argument as Physical SPEED
local mtu=$2 # Second Argument as MTU
local tag=$3 # Thrid Arhument as VLAN Tag number
# calculate in bit wide
local frameSizeNum=$( ${CALC} "${ethDestMAC}+${ethSrcMAC}+${ethType}+${mtu}+${
ethFCS}+(${tag}*${ethVLAN})" )
local frameNumRaw=$( echo $( ${CALC} "${speed}/(${ethInterFrameGap}+(${ethPrea
mble}+${frameSizeNum})*8)" ) | sed -e 's/^~//g' )
local frameNum=$( ${CALC} "int(${frameNumRaw})" )
echo ${frameNumRaw} ${frameNum} ${frameSizeNum} # Return Maximum Transmit Fram
e number
}
#
function efficiencyFunc () {
local speed=$1
local mtu=$2
local frameNumber=$3
#
local efficiencyUsage=$( ${CALC} "${mtu}*${frameNumber}*8" )
local efficiencyNum=$( ${CALC} "${efficiencyUsage}/${speed}" )
echo ${efficiencyNum} $( ${CALC} "${efficiencyUsage}/${Mb}" )
}
#
function bandwidthFunc () {
local speed=$1
local overheadRate=$2
#
bandwidthNum=$( ${CALC} "(${speed}*(1-${overheadRate}))/${Mb}" )
echo ${bandwidthNum}
}
#
function overheadFunc () {
local speed=$1
local frameNum=$2
#
local overheadRate=$( ${CALC} "(${ethInterFrameGap} * ${frameNum})/${speed}" )
echo ${overheadRate}
}
#
function calculateFunc () {
local speed=$( expr $1 + 0 )
local mtu=$( expr $2 + 0 )
local vlanTag=$( expr $3 + 0 )
#
local bandwidthNums=$( ${CALC} "${speed} * ${Mb}" )
#
local frameNumbers=$( frameNumFunc ${bandwidthNums} ${mtu} ${vlanTag} )
local frameNums=$( echo ${frameNumbers} | cut -d' ' -f2 )
local frameNumsRaw=$( echo ${frameNumbers} | cut -d' ' -f1 )
local frameSizeNums=$( echo ${frameNumbers} | cut -d' ' -f3 )
#
local frameOverheadNums=$( overheadFunc ${bandwidthNums} ${frameNums} )
#
local efficiencyNumbers=$( efficiencyFunc ${bandwidthNums} ${mtu} ${frameNums
} )
local effNums=$( echo ${efficiencyNumbers} | cut -d' ' -f1 )
local effBandwidthNums=$( echo ${efficiencyNumbers} | cut -d' ' -f2 )
local bandwidth=$( bandwidthFunc ${bandwidthNums} ${frameOverheadNums} )
#
echo ${frameNums} ${frameOverheadNums} ${effNums} ${effBandwidthNums} ${bandwi
dth} ${frameSizeNums}
}
#
printf "===============================================================\n"
#
for i in ${SPEED_LIST} ; do
echo -e "Bandwidth:\t\t\t\t\t${i} Mbit"
#
for j in ${MTU_LIST} ; do
for k in ${VLAN_TAG_LIST} ; do
result=$( calculateFunc $i $j $k )
#
frames=$( echo ${result} | cut -d' ' -f 1 )
frameSize=$( echo ${result} | cut -d' ' -f 6 )
overheadRate=$( echo ${result} | cut -d' ' -f 2 )
overheadRatePercent=$( ${CALC} "($overheadRate+0)*100" )
efficiencyRate=$( echo ${result} | cut -d' ' -f 3 )
efficiencyRatePercent=$( ${CALC} "($efficiencyRate+0)*100" )
efficiencyBandwidthSpeed=$( echo ${result} | cut -d' ' -f 4 )
bandwidthSpeed=$( echo ${result} | cut -d' ' -f 5 )
#
echo -e "---------------------------------------------------------------"
echo -e "\tMTU Size:\t\t\t\t${j} Byte"
#
if [ "${k}" -eq "0" ]; then
T="None"
else
T=${k}
fi
#
echo -e "\t\tVLAN Tag:\t\t\t${T} Tag"
echo -e "\t\tFrame Size:\t\t\t${frameSize} Byte"
echo -e "\t\tMax Frame per second:\t\t${frames}"
echo -e "\t\tOverhead Rate:\t\t${overheadRatePercent}%"
echo -e "\t\tEfficiency Rate:\t${efficiencyRatePercent}%"
#
if [ "$( ${CALC} "${i} * ${Mb}" )" -gt "${Gb}" ]; then
bandwidthSpeed=$( ${CALC} "${bandwidthSpeed}/1000" )
efficiencyBandwidthSpeed=$( ${CALC} "${efficiencyBandwidthSpeed}/1000" )
#
echo -e "\t\tTransport Bandwidth:\t${bandwidthSpeed} Gbit"
echo -e "\t\tEfficiency Bandwidth:\t${efficiencyBandwidthSpeed} Gbit"
else
echo -e "\t\tTransport Bandwidth:\t\t${bandwidthSpeed} Mbit"
echo -e "\t\tEfficiency Bandwidth:\t\t${efficiencyBandwidthSpeed} Mbit"
fi
#
done
done
#
printf "===============================================================\n"
done
#
andwidth:\t${efficiencyBandwidthSpeed} Gbit"
else
echo -e "\t\tTransport Bandwidth:\t\t${bandwidthSpeed} Mbit"
echo -e "\t\tEfficiency Bandwidth:\t\t${efficiencyBandwidthSpeed} Mbit"
fi
#
done
done
#
printf "===============================================================\n"
done
#


Result:

===============================================================
Bandwidth: 10 Mbit
---------------------------------------------------------------
MTU Size: 46 Byte
VLAN Tag: None Tag
Frame Size: 64 Byte
Max Frame per second: 14880
Overhead Rate: 14.2848%
Efficiency Rate: 54.7584%
Transport Bandwidth: 8.57152 Mbit
Efficiency Bandwidth: 5.47584 Mbit
---------------------------------------------------------------
MTU Size: 1500 Byte
VLAN Tag: None Tag
Frame Size: 1518 Byte
Max Frame per second: 812
Overhead Rate: 0.77952%
Efficiency Rate: 97.44%
Transport Bandwidth: 9.922048 Mbit
Efficiency Bandwidth: 9.744 Mbit
---------------------------------------------------------------
MTU Size: 9000 Byte
VLAN Tag: None Tag
Frame Size: 9018 Byte
Max Frame per second: 138
Overhead Rate: 0.13248%
Efficiency Rate: 99.36%
Transport Bandwidth: 9.986752 Mbit
Efficiency Bandwidth: 9.936 Mbit
---------------------------------------------------------------
MTU Size: 16000 Byte
VLAN Tag: None Tag
Frame Size: 16018 Byte
Max Frame per second: 77
Overhead Rate: 0.07392%
Efficiency Rate: 98.56%
Transport Bandwidth: 9.992608 Mbit
Efficiency Bandwidth: 9.856 Mbit
===============================================================
Bandwidth: 100 Mbit
---------------------------------------------------------------
MTU Size: 46 Byte
VLAN Tag: None Tag
Frame Size: 64 Byte
Max Frame per second: 148809
Overhead Rate: 14.285664%
Efficiency Rate: 54.761712%
Transport Bandwidth: 85.714336 Mbit
Efficiency Bandwidth: 54.761712 Mbit
---------------------------------------------------------------
MTU Size: 1500 Byte
VLAN Tag: None Tag
Frame Size: 1518 Byte
Max Frame per second: 8127
Overhead Rate: 0.780192%
Efficiency Rate: 97.524%
Transport Bandwidth: 99.219808 Mbit
Efficiency Bandwidth: 97.524 Mbit
---------------------------------------------------------------
MTU Size: 9000 Byte
VLAN Tag: None Tag
Frame Size: 9018 Byte
Max Frame per second: 1383
Overhead Rate: 0.132768%
Efficiency Rate: 99.576%
Transport Bandwidth: 99.867232 Mbit
Efficiency Bandwidth: 99.576 Mbit
---------------------------------------------------------------
MTU Size: 16000 Byte
VLAN Tag: None Tag
Frame Size: 16018 Byte
Max Frame per second: 779
Overhead Rate: 0.074784%
Efficiency Rate: 99.712%
Transport Bandwidth: 99.925216 Mbit
Efficiency Bandwidth: 99.712 Mbit
===============================================================
Bandwidth: 1000 Mbit
---------------------------------------------------------------
MTU Size: 46 Byte
VLAN Tag: None Tag
Frame Size: 64 Byte
Max Frame per second: 1488095
Overhead Rate: 14.285712%
Efficiency Rate: 54.761896%
Transport Bandwidth: 857.14288 Mbit
Efficiency Bandwidth: 547.61896 Mbit
---------------------------------------------------------------
MTU Size: 1500 Byte
VLAN Tag: None Tag
Frame Size: 1518 Byte
Max Frame per second: 81274
Overhead Rate: 0.7802304%
Efficiency Rate: 97.5288%
Transport Bandwidth: 992.197696 Mbit
Efficiency Bandwidth: 975.288 Mbit
---------------------------------------------------------------
MTU Size: 9000 Byte
VLAN Tag: None Tag
Frame Size: 9018 Byte
Max Frame per second: 13830
Overhead Rate: 0.132768%
Efficiency Rate: 99.576%
Transport Bandwidth: 998.67232 Mbit
Efficiency Bandwidth: 995.76 Mbit
---------------------------------------------------------------
MTU Size: 16000 Byte
VLAN Tag: None Tag
Frame Size: 16018 Byte
Max Frame per second: 7793
Overhead Rate: 0.0748128%
Efficiency Rate: 99.7504%
Transport Bandwidth: 999.251872 Mbit
Efficiency Bandwidth: 997.504 Mbit
===============================================================
Bandwidth: 2500 Mbit
---------------------------------------------------------------
MTU Size: 46 Byte
VLAN Tag: None Tag
Frame Size: 64 Byte
Max Frame per second: 3720238
Overhead Rate: 14.28571392%
Efficiency Rate: 54.76190336%
Transport Bandwidth: 2.142857152 Gbit
Efficiency Bandwidth: 1.369047584 Gbit
---------------------------------------------------------------
MTU Size: 1500 Byte
VLAN Tag: None Tag
Frame Size: 1518 Byte
Max Frame per second: 203185
Overhead Rate: 0.7802304%
Efficiency Rate: 97.5288%
Transport Bandwidth: 2.48049424 Gbit
Efficiency Bandwidth: 2.43822 Gbit
---------------------------------------------------------------
MTU Size: 9000 Byte
VLAN Tag: None Tag
Frame Size: 9018 Byte
Max Frame per second: 34576
Overhead Rate: 0.13277184%
Efficiency Rate: 99.57888%
Transport Bandwidth: 2.496680704 Gbit
Efficiency Bandwidth: 2.489472 Gbit
---------------------------------------------------------------
MTU Size: 16000 Byte
VLAN Tag: None Tag
Frame Size: 16018 Byte
Max Frame per second: 19484
Overhead Rate: 0.07481856%
Efficiency Rate: 99.75808%
Transport Bandwidth: 2.498129536 Gbit
Efficiency Bandwidth: 2.493952 Gbit
===============================================================
Bandwidth: 10000 Mbit
---------------------------------------------------------------
MTU Size: 46 Byte
VLAN Tag: None Tag
Frame Size: 64 Byte
Max Frame per second: 14880952
Overhead Rate: 14.28571392%
Efficiency Rate: 54.76190336%
Transport Bandwidth: 8.571428608 Gbit
Efficiency Bandwidth: 5.476190336 Gbit
---------------------------------------------------------------
MTU Size: 1500 Byte
VLAN Tag: None Tag
Frame Size: 1518 Byte
Max Frame per second: 812743
Overhead Rate: 0.78023328%
Efficiency Rate: 97.52916%
Transport Bandwidth: 9.921976672 Gbit
Efficiency Bandwidth: 9.752916 Gbit
---------------------------------------------------------------
MTU Size: 9000 Byte
VLAN Tag: None Tag
Frame Size: 9018 Byte
Max Frame per second: 138304
Overhead Rate: 0.13277184%
Efficiency Rate: 99.57888%
Transport Bandwidth: 9.986722816 Gbit
Efficiency Bandwidth: 9.957888 Gbit
---------------------------------------------------------------
MTU Size: 16000 Byte
VLAN Tag: None Tag
Frame Size: 16018 Byte
Max Frame per second: 77939
Overhead Rate: 0.07482144%
Efficiency Rate: 99.76192%
Transport Bandwidth: 9.992517856 Gbit
Efficiency Bandwidth: 9.976192 Gbit
===============================================================

發表回應 發表回應 ( 1093預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 207 )

Linux VLAN Priority CoS config
11/24/2015, 16:54 - Network
With Ubuntu 15.10
apt-get install vlan

/etc/udev/rules.d/70-persistent-net.rules

# USB device 0x:0x (ax88179_178a)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:05:1b:a3:12:ce", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth10"


/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto p2p1
#iface p2p1 inet dhcp
#
# Change biosdevname back to eth
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
#
# address 192.168.7.200
# netmask 255.255.0.0
# gateway 192.168.1.201
#
address 172.22.10.254
netmask 255.255.255.0
gateway 172.22.10.1
#
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4
txq 30000
#
# Wireless Client
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wireless_mode managed
wireless_txpower auto
#
pre-up wpa_supplicant -B -Dwext -iwlan0 \
-c/etc/wpa_supplicant/wpa_supplicant.conf
post-down killall -q wpa_supplicant
#
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4
#
# Wireless AP
#auto wlan0
#iface wlan0 inet static
# hostapd /etc/hostapd/hostapd.conf
# wireless_txpower auto
# address 172.22.2.254
# netmask 255.255.255.0
#
#
auto eth10
allow-hotplug eth10
txq 10000
#
auto eth10.10
iface eth10.10 inet static
#
vlan-egress-map 0:3 4:3 2:1
vlan-ingress-map 0:5 1:6 2:7
address 10.10.10.3
netmask 255.255.255.0
#
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4
txq 5000
#
auto eth10.20
iface eth10.20 inet static
#
vlan-egress-map 0:3 4:3 2:1
vlan-ingress-map 0:5 1:6 2:7
address 10.10.20.3
netmask 255.255.255.0
#
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4
txq 5000
#
auto eth10.30
iface eth10.30 inet static
#
vlan-egress-map 0:3 4:3 2:1
vlan-ingress-map 0:5 1:6 2:7
address 10.10.30.3
netmask 255.255.255.0
#
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4
txq 5000
#

/etc/network/if-up.d/vlan

#!/bin/sh

# Most of this stuff is to enable vlans

case "$IFACE" in
# Ignore any alias (#272891) which uses <interface>:<alabel>
*:*)
exit 0
;;
vlan0*)
vconfig set_name_type VLAN_PLUS_VID
VLANID=`echo $IFACE|sed "s/vlan0*//"`
;;
vlan*)
vconfig set_name_type VLAN_PLUS_VID_NO_PAD
VLANID=`echo $IFACE|sed "s/vlan0*//"`
;;
eth*.0*|bond*.0*|wlan*.0*|em*.0*|p[0-9]*.0*)
vconfig set_name_type DEV_PLUS_VID
VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g;s/bond[0-9][0-9]*\.0*//g;s/wlan[0-9][0-9]*\.0*//g;s/em[0-9][0-9]*\.0*//g;s/p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\.0*//g"`
IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/;s/\(wlan[0-9][0-9]*\)\..*/\1/;s/\(em[0-9][0-9]*\)\..*/\1/;s/\(p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\)\..*/\1/"`
;;
eth*.*|bond*.*|wlan*.*|em*.*|p[0-9]*.*)
vconfig set_name_type DEV_PLUS_VID_NO_PAD
VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g;s/bond[0-9][0-9]*\.0*//g;s/wlan[0-9][0-9]*\.0*//g;s/em[0-9][0-9]*\.0*//g;s/p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\.0*//g"`
IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/;s/\(wlan[0-9][0-9]*\)\..*/\1/;s/\(em[0-9][0-9]*\)\..*/\1/;s/\(p[0-9][0-9]*\(p[0-9][0-9]*\)\?\(_[0-9][0-9]*\)\?\)\..*/\1/"`
;;
*.0*)
# Silently ignore interfaces which we do not (know how to) support
[ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0
vconfig set_name_type DEV_PLUS_VID
VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"`
;;
*.*)
# Silently ignore interfaces which we do not (know how to) support
[ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0
vconfig set_name_type DEV_PLUS_VID_NO_PAD
VLANID=`echo $IFACE|sed "s/[^.]*\.0*//g"`
;;

*)
exit 0
;;
esac

if [ -n "$IF_VLAN_RAW_DEVICE" ] && [ -d /sys/class/net/$IFACE ]; then
if [ ! -x /sbin/vconfig ]; then
exit 0
fi
if [ -n "$IF_VLAN_EGRESS_MAP" ]; then
for i in $IF_VLAN_EGRESS_MAP ; do
vconfig set_egress_map $IFACE `echo $i|cut -d: -f1` `echo $i|cut -d: -f2`
done
fi
if [ -n "$IF_VLAN_INGRESS_MAP" ]; then
for i in $IF_VLAN_INGRESS_MAP ; do
vconfig set_ingress_map $IFACE `echo $i|cut -d: -f1` `echo $i|cut -d: -f2`
done
fi
fi
#


/etc/network/if-up.d/ifqueue

#!/bin/sh
if [ -d "/sys/class/net/$IFACE" ]; then
TXQ=`expr $IF_TXQ + 0`
if [ -n "$IF_TXQ" ] && [ "$TXQ" -gt 0 ]; then
# ifconfig $IFACE txqueuelen $TXQ
ip link set txqueuelen $TXQ dev $IFACE
fi
fi
#


ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 30000
link/ether 08:62:66:c7:ba:b0 brd ff:ff:ff:ff:ff:ff
3: eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10000
link/ether 00:05:1b:a3:12:ce brd ff:ff:ff:ff:ff:ff
4: eth10.10@eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 5000
link/ether 00:05:1b:a3:12:ce brd ff:ff:ff:ff:ff:ff
5: eth10.20@eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 5000
link/ether 00:05:1b:a3:12:ce brd ff:ff:ff:ff:ff:ff
6: eth10.30@eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 5000
link/ether 00:05:1b:a3:12:ce brd ff:ff:ff:ff:ff:ff


/proc/net/vlan/config

VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth10.10 | 10 | eth10
eth10.20 | 20 | eth10
eth10.30 | 30 | eth10


/proc/net/vlan/eth10.10 - eth10.30

eth10.10 VID: 10 REORDER_HDR: 1 dev->priv_flags: 1
total frames received 73
total bytes received 24464
Broadcast/Multicast Rcvd 0

total frames transmitted 131
total bytes transmitted 58775
Device: eth10
INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:1 7:2
EGRESS priority mappings: 0:3 2:1 4:3

eth10.20 VID: 20 REORDER_HDR: 1 dev->priv_flags: 1
total frames received 0
total bytes received 0
Broadcast/Multicast Rcvd 0

total frames transmitted 45
total bytes transmitted 7462
Device: eth10
INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:1 7:2
EGRESS priority mappings: 0:3 2:1 4:3

eth10.30 VID: 30 REORDER_HDR: 1 dev->priv_flags: 1
total frames received 5
total bytes received 4152
Broadcast/Multicast Rcvd 0

total frames transmitted 50
total bytes transmitted 11656
Device: eth10
INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:1 7:2
EGRESS priority mappings: 0:3 2:1 4:3

發表回應 發表回應 ( 306預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 2.9 / 167 )

OS X 10.11
10/15/2015, 00:33 - Apple


發表回應 發表回應 ( 680預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 2.9 / 153 )

NTP
05/06/2015, 20:59 - Network
看來 ntp.nasa.gov 不能用了,換到 pool.ntp.org 好了。
發表回應 發表回應 ( 2233預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 219 )

netsurf-fb SDL_Init Unable open mouse problem solved
03/12/2015, 15:00 - Open Source
netsurf-fb 'SDL_Init()' Unable open mouse problem solved
Reference URL
發表回應 發表回應 ( 1767預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 245 )

WebkitGTK patch for directFB without X11 in Linux
03/05/2015, 16:59 - Open Source
This is not a new patch, copy someone patch to OS X, but test successful.


--- Source/WebCore/plugins/PluginView.h.orig 2015-03-05 12:59:54.367967198 +0800
+++ Source/WebCore/plugins/PluginView.h 2015-03-05 13:01:34.659459208 +0800
@@ -378,7 +378,8 @@
void setNPWindowIfNeeded();
#endif

-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+//#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+#if PLATFORM(X11) && ENABLE(NETSCAPE_PLUGIN_API)
bool m_hasPendingGeometryChange;
Pixmap m_drawable;
Visual* m_visual;

--- Source/WebCore/plugins/PluginView.cpp.orig 2015-03-05 12:57:54.328586254 +0800
+++ Source/WebCore/plugins/PluginView.cpp 2015-03-05 13:02:50.131097591 +0800
@@ -839,7 +839,8 @@
#if defined(XP_MACOSX)
, m_contextRef(0)
#endif
-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+//#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+#if PLATFORM(X11) && ENABLE(NETSCAPE_PLUGIN_API)
, m_hasPendingGeometryChange(true)
, m_drawable(0)
, m_visual(0)

--- Source/WebCore/bridge/npruntime_internal.h.orig 2015-03-05 13:04:23.290670731 +0800
+++ Source/WebCore/bridge/npruntime_internal.h 2015-03-05 13:05:01.154499696 +0800
@@ -29,7 +29,8 @@
#include "npfunctions.h"
#include "npruntime.h"

-#if defined(MOZ_X11)
+//#if defined(MOZ_X11)
+#if PLATFORM(X11)
#include <X11/Xresource.h>

#undef None

發表回應 發表回應 ( 911預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3.1 / 190 )

Upgrade OS X Server's ClamAV
02/05/2015, 12:43 - Apple
Reference to Updating ClamAv on OS X Server >= 10.5.6

Here is my script to auto build
clamav_renew.sh

#!/bin/bash
#
VERSION=0.98.6
if [ -e clamav-${VERSION}.tar.gz ]; then
rm -fr clamav-${VERSION}.tar.gz
fi
#
if [ -d clamav-${VERSION} ]; then
rm -fr clamav-${VERSION}
fi
#
wget http://sourceforge.net/projects/clamav/files/clamav/${VERSION}/clamav-${VERSION}.tar.gz
#
tar -zxvf clamav-${VERSION}.tar.gz
#
cd clamav-${VERSION}
#
./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/private/etc \
--enable-bigstack --enable-static \
--with-user=_clamav --with-group=_clamav \
--with-dbdir=/var/clamav --datadir=/var/clamav
#
make
#
make check
#
SELECT=""
IFS=''
#
echo "Press Y to install ClamAV, version " ${VERSION}
read -s -n 1 SELECT
#
if [[ "$SELECT" =~ [yY] ]]; then
make install
#
echo "Reload clamav"
if [ -e clamav_reload.sh ]; then
./clamav_reload.sh
fi
#
fi
#


clamav_reload.sh

#!/bin/bash
#
# refresh database
sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/org.clamav.freshclam.plist
sudo /bin/launchctl load -w /System/Library/LaunchDaemons/org.clamav.freshclam.plist
# restart clamd
sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/org.clamav.clamd.plist
sudo /bin/launchctl load -w /System/Library/LaunchDaemons/org.clamav.clamd.plist
#a reload amavisd
sudo /bin/launchctl unload /System/Library/LaunchDaemons/org.amavis.amavisd.plist
sudo /bin/launchctl load /System/Library/LaunchDaemons/org.amavis.amavisd.plist
#

發表回應 發表回應 ( 937預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3.1 / 181 )

Goto OS X 10.10.2
02/04/2015, 17:54 - Apple

發表回應 發表回應 ( 868預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 193 )


| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 下一頁> 最後>>