VC 中指针是个很合怕的东东
[
2010/01/22 10:13 | by suibing ]
2010/01/22 10:13 | by suibing ]
VC中指针太可怕了,稍微错一位就全盘崩溃。。。。。。
discuz文字广告修改
[
2010/01/21 22:01 | by suibing ]
2010/01/21 22:01 | by suibing ]
方法很简单。 已亲测7.0 7.1 有效,其它版的没测试。
首先。
打开。 \include\advertisements.inc.php 文件。
然后搜索if($advcount > 5) {
复制代码找到后,你后发现有
if($advcount > 5) {
$minfillpercent = 0;
for($cols = 5; $cols >= 3; $cols--) {
复制代码这样的一串代码。
你需要修改的就是把两个5改成 6即可。 如果你需要的是一排四个单元,则改成4即可。 其它依次类推算
改成一下内容就可以实现两列的表格,三列需要把3个2全改成3
for循环是为了自动分行用的,这里我们不需要的
if($advcount > 2) { //这里是文字广告行数,还是pw还用
$minfillpercent = 0;
for($cols = 2; $cols >=2; $cols--) {
dz7.0页内文字广告位左边距修改:
在default文件夹下的css_common.htm查找:
.ad_text td { padding: 3px 20px; text-align: left; }
修改成:
.ad_text td { padding: 2px 2px; text-align: center; }
这样,当你放置google的两个468横幅的时候,就可以实现横排而没有必要改动总表格宽度了。
小经验,与大家分享。
首先。
打开。 \include\advertisements.inc.php 文件。
然后搜索if($advcount > 5) {
复制代码找到后,你后发现有
if($advcount > 5) {
$minfillpercent = 0;
for($cols = 5; $cols >= 3; $cols--) {
复制代码这样的一串代码。
你需要修改的就是把两个5改成 6即可。 如果你需要的是一排四个单元,则改成4即可。 其它依次类推算
改成一下内容就可以实现两列的表格,三列需要把3个2全改成3
for循环是为了自动分行用的,这里我们不需要的
if($advcount > 2) { //这里是文字广告行数,还是pw还用
$minfillpercent = 0;
for($cols = 2; $cols >=2; $cols--) {
dz7.0页内文字广告位左边距修改:
在default文件夹下的css_common.htm查找:
.ad_text td { padding: 3px 20px; text-align: left; }
修改成:
.ad_text td { padding: 2px 2px; text-align: center; }
这样,当你放置google的两个468横幅的时候,就可以实现横排而没有必要改动总表格宽度了。
小经验,与大家分享。
自定义discuz伪静态重写规则
[
2010/01/20 16:52 | by suibing ]
2010/01/20 16:52 | by suibing ]
是否很讨厌清一色的 forum-33-1.html 或者 thread-1392810-1-1.html 类似的页面呢?
其实要修改很简单,只需要修改3个文件,你就可以自定义你自己的重写格式
.htaccess
include/global.func.php 第891行开始
include/request.func.php 第559行开始
其实要修改很简单,只需要修改3个文件,你就可以自定义你自己的重写格式
.htaccess
include/global.func.php 第891行开始
include/request.func.php 第559行开始
proxmox 网络配置
[
2010/01/19 18:54 | by suibing ]
2010/01/19 18:54 | by suibing ]
Default Configuration (bridged)
The installation program creates a single bridge (vmbr0), which is connected to the first ethernet card (eth0).
auto lo
iface lo inet loopback
auto vmbr0
iface vmbr0 inet static
address 192.168.10.2
netmask 255.255.255.0
gateway 192.168.10.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
Virtual machine behaves like directly connected to the physical network.
Routed Configuration
Most hosting providers does not support above setup. For security reason they stop networking as soon as they detect multiple MAC addresses.
A common setup is that you get a public IP (assume 192.168.10.2 for this example), and additional IP blocks for your VMs (10.10.10.1/255.255.255.0). For such situation we recommend the following setup.
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.10.2
netmask 255.255.255.0
gateway 192.168.10.1
post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
auto vmbr0
iface vmbr0 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
Masquerading
Sometimes you want to use private IPs and masquerade the traffic:
auto vmbr1
iface vmbr1 inet static
address 10.10.11.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.11.0/24' -o eth0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.11.0/24' -o eth0 -j MASQUERADE
Unsupported Routing
Physical NIC (eg., eth1) cannot currently be made available exclusively for a particular KVM / Container , ie., without bridge and/or bond.
Naming Conventions
* Ethernet devices: eth0 - eth99
* Bridge names: vmbr0 - vmbr9
* Bonds: bond0 - bond9
* VLANs: Simply add the VLAN number to the ethernet device name, seperated by a period. For example "eth0.50"
以上是官方网站的配置,下面是自己的配置。
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.2.202
netmask 255.255.255.0
gateway 192.168.2.1
post-up iptables -t nat -A POSTROUTING -o eth0 -s 10.0.1.0/24 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -p tcp -d 192.168.2.202 --dport 4321 -i eth0 -j DNAT --to-destination 10.0.1.2:3389
post-down iptables -t nat -D POSTROUTING -s 10.0.1.0/24 -o eth0 -j MASQUERADE
auto vmbr0
iface vmbr0 inet static
address 10.0.1.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
去除post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp的原因是proxy_arp会导致一些网络问题,还是iptables好用。
The installation program creates a single bridge (vmbr0), which is connected to the first ethernet card (eth0).
auto lo
iface lo inet loopback
auto vmbr0
iface vmbr0 inet static
address 192.168.10.2
netmask 255.255.255.0
gateway 192.168.10.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
Virtual machine behaves like directly connected to the physical network.
Routed Configuration
Most hosting providers does not support above setup. For security reason they stop networking as soon as they detect multiple MAC addresses.
A common setup is that you get a public IP (assume 192.168.10.2 for this example), and additional IP blocks for your VMs (10.10.10.1/255.255.255.0). For such situation we recommend the following setup.
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.10.2
netmask 255.255.255.0
gateway 192.168.10.1
post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
auto vmbr0
iface vmbr0 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
Masquerading
Sometimes you want to use private IPs and masquerade the traffic:
auto vmbr1
iface vmbr1 inet static
address 10.10.11.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.11.0/24' -o eth0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.11.0/24' -o eth0 -j MASQUERADE
Unsupported Routing
Physical NIC (eg., eth1) cannot currently be made available exclusively for a particular KVM / Container , ie., without bridge and/or bond.
Naming Conventions
* Ethernet devices: eth0 - eth99
* Bridge names: vmbr0 - vmbr9
* Bonds: bond0 - bond9
* VLANs: Simply add the VLAN number to the ethernet device name, seperated by a period. For example "eth0.50"
以上是官方网站的配置,下面是自己的配置。
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.2.202
netmask 255.255.255.0
gateway 192.168.2.1
post-up iptables -t nat -A POSTROUTING -o eth0 -s 10.0.1.0/24 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -p tcp -d 192.168.2.202 --dport 4321 -i eth0 -j DNAT --to-destination 10.0.1.2:3389
post-down iptables -t nat -D POSTROUTING -s 10.0.1.0/24 -o eth0 -j MASQUERADE
auto vmbr0
iface vmbr0 inet static
address 10.0.1.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
去除post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp的原因是proxy_arp会导致一些网络问题,还是iptables好用。
debian下创建网桥,路由以及端口映射
[
2010/01/19 18:34 | by suibing ]
2010/01/19 18:34 | by suibing ]
脚本如下:
brctl addbr br0 //创建网桥
brctl delif vmbr0 vmtab101i0 //删除vmtab101i0桥
brctl addif br0 vmtab101i0 //添加vmtab101i0到br0
ifconfig br0 10.0.1.1 netmask 255.255.255.0 up //网桥ip
iptables -t nat -A POSTROUTING -o vmbr0 -s 10.0.1.0/24 -j MASQUERADE //路由
iptables -t nat -A PREROUTING -p tcp -d 192.168.2.202 --dport 4321 -i vmbr0 -j DNAT --to-destination 10.0.1.3:3389 //端口映射
brctl addbr br0 //创建网桥
brctl delif vmbr0 vmtab101i0 //删除vmtab101i0桥
brctl addif br0 vmtab101i0 //添加vmtab101i0到br0
ifconfig br0 10.0.1.1 netmask 255.255.255.0 up //网桥ip
iptables -t nat -A POSTROUTING -o vmbr0 -s 10.0.1.0/24 -j MASQUERADE //路由
iptables -t nat -A PREROUTING -p tcp -d 192.168.2.202 --dport 4321 -i vmbr0 -j DNAT --to-destination 10.0.1.3:3389 //端口映射





