Discuz 设置#
每个主题页面只显示一次签名#
在viewthread.php文件中,找到:
while($post = $db->fetch_array($query)) {
下面加:
$count[$post['authorid']] = $post['usesig'] ? $count[$post['authorid']] + 1 : $count[$post['authorid']]; $post['signature'] = $count[$post['authorid']] == 1 ? $post['signature'] : NULL;
HDWiki 设置#
增加用户和词条数统计#
打开 model/base.class.php 文件,找到 init_template 函数的定义,在最后加上
$this->view->assign('usernum',$this->db->result_first("select count(*) as usernum from ".DB_TABLEPRE."user where 1"));
$this->view->assign('docnum',$this->db->result_first("select count(*) as docnum from ".DB_TABLEPRE."doc where 1"));
然后就可以在模板中使用 $usernum 和 $docnum 来显示用户数和词条数了。
Some interesting software#
银冬瓜#
个人家庭理财软件
Virtual Machine#
Virtual Box#
From http://forums.virtualbox.org/viewtopic.php?f=6&t=1887&start=15
- run `cmd` and write:
- run `regedit` and goto 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VirtualServer'
- add section 'Parameters'
- add key 'Application' equal 'C:\Program Files\Sun xVM VirtualBox\VBoxHeadless.exe' to section 'Parameters'
- add key 'AppParameters' equal 'startvm <vmname> -vrdp=off' to section 'Parameters'
- add key 'AppDirectory' equal 'C:\Program Files\Sun xVM VirtualBox\' to section 'Parameters'
- run `mmc` and goto 'Computer Configuration/Windows Settings/Scripts/Shutdown' and add script with line:
- copy '.VirtualBox' from 'C:\Users\<username>\' to 'C:\Windows\System32\config\systemprofile\'
Virtual PC#
Installing Debian on Virtual PC 2007#
If you tried installing Debian testing or any other recent flavor of Linux on Microsoft’s VirtualPC 2007 you probably hit the wall with the “An unrecoverable processor error has been encountered. The virtual machine will reset now.” error during the machine's first boot after installation.
The solution?
Add noreplace-paravirt to the boot options in grub's kernel entry.
You may also want to add clocksource=pit as well to solve timing issues and vga=791 for a 1024x768 resolution text mode.
Booting in a usable terminal
To boot in a usable terminal, select the safe (single-user) mode (just select, do not press enter).
Press ‘e’ to edit the command, select the middle line as shown in the picture below then press ‘e’ again. Add the noreplace-paravirt parameter to the end of the line and press enter to go back to the previous screen. Press ‘b’ to boot using the selected kernel entry.
Once you get into a usable terminal, we need to make those changes permanent. We will have to edit /boot/grub/menu.lst and add noreplace-paravirt in the “default kernel options” and the rest in the “additional options” as shown on the two pictures below.
Starting X
Well, if you continue booting and end up in X you will certainly get nothing but a garbled screen. This happens because VirtualPC doesn’t support the default 24 bit color depth of X and we will have to edit xorg.conf and tell it to use only 16 (or 32?) bit colors.
Just open /etc/X11/xorg.conf then look for the “Screen” section. Add the line DefaultDepth 16 as in the picture below, save and reboot (or just restart x).
修改虚拟机 BIOS 安装 OEM 版 Windows XP#
Virtual PC#
修改 vmc 文件:
<bios_serial_number type="string">IBM CORPORATION</bios_serial_number>
Virtual Box#
修改 xml 文件:
<ExtraDataItem name="VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" value="IBM CORPORATION"/> <ExtraDataItem name="VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" value="IBM CORPORATION"/>
Firewall#
Comodo Firewall + PCTools ThreatFire#
Supposing that someone would like to run them together, this would be the setup
- TF standard at level 3
- D+ unselect all activity monitors except DNS and Loopback, watch COM, File and Registry, watch Physical memeory and direct disk access (unselect screen and keyboard). Use D+ in clean PC mode. Because you run an behavior blocker you can also unselect (set to off) image execution control
What you will get
- TF for all programs continueously
- D+ for some extra's at new arrivals (COM, File, Reg, Phys Mem, Direct Disk)