2008-12-16

How to Change the Ephemeral Port Range

Linux allows you to view and change the ephemeral port range by simply using the file /proc/sys/net/ipv4/ip_local_port_range. For example, this shows the default configuration on a kernel 2.2 system:

$ cat /proc/sys/net/ipv4/ip_local_port_range
1024 4999

To change this to the preferred range, you could do (as superuser):

# echo "49152 65535" > /proc/sys/net/ipv4/ip_local_port_range 

2008-12-15

Thunderbird Add-on

  • Buttons!
  • Google Contacts
  • MinimizeToTray
  • Send Later
  • Message Filter Import/Export

2008-10-28

Install Ubuntu 8.04 from Hard Disk

  • Make an ISO file ubuntu804.iso from Ubuntu's LiveCD (8.04 desktop), put the ISO file in D:/ubuntu804.iso
  • Mount the ISO file or the LiveCD, copy two files CDROM:/casper/{initrd.gz,vmlinuz} to Windows drive D:/
  • Download grub4dos, extract its files to C:/
  • Edit C:/boot.ini, add one new line: C:\grldr="GRUB4DOS"
  • Edit C:/menu.lst
    title Find and Install Ubuntu
    find --set-root /ubuntu804.iso
    kernel /vmlinuz boot=casper iso-scan/filename=/ubuntu804.iso
    initrd /initrd.gz
  • Reboot Windows XP
  • Select GRUB4DOS from the boot menu
  • ... ...
  • Will boot to the same screen as if you're directly booting from the LiveCD.

2008-10-14

Less' history file

偶然发现看 man page 的时候 search 过的字符串是有 history 的, 猜想是 less 的功能, 查了一下根目录下的文件, 发现有一个 .lesshst, 查 less 的 manual, 里面有说到 .lesshst:

. . . Name of the history file used to remember search commands and shell commands between invocations of less. . .

2008-10-13

Compile GNU screen from source

  • $ git clone git://git.savannah.gnu.org/screen.git
  • $ cd screen/src
  • $ aclocal --force
  • $ libtoolize --copy --force
  • $ autoconf --force
  • $ autoheader --force
  • $ automake --add-missing --copy --force-missing
  • $ ./configure --prefix=/usr/local/screen-dev --enable-colors256
  • $ make && make install
N.B.: Run mktar.pl to make traditional screen-X.X.X.tar.gz

See full screen man pages on Fedora Core 3

ubuntu 6.06 上看 man pages 的时候能全屏显示, 但 Fedora 3 上却不能, 研究一番, 可以自己编译 man-db 来解决:

编译 man-db 可能需要依赖 gdbm-devel 或者 db4-devel (ubuntu 上对应 libgdbm-dev 或者 libdb-dev).

2008-08-29

Expect 5.43 takes quite long when exiting

Expect 5.43 的 script 结束时总是很慢, 用 expect -d 发现最后有条 message:

write() failed to write anything - will sleep(1) and retry...
查了下 code, 在 exp_chan.c : ExpOutputProc() 中有个 sleep(1), 把它换成 usleep(10 * 1000) 就好了.

2008-08-01

Yahoo + Del.icio.us

原来 Del.icio.us 是 Yahoo 的了, 而且改名为 Delicious.com 了.

2008-07-31

Hotspot Shield

Public networks (both wired and wireless) are great. After all, what would life be without connecting while at airports, hotels and coffee shops? However, the danger to your personal data exists even if you connect to a fee based open network. Your passwords, credit card numbers, and any data you send can be seen and associated with you personally. Standard antivirus software won't protect you as this threat is on the network, not your laptop or iPhone.

That's why AnchorFree is pleased to offer Hotspot Shield. Our application keeps your Internet connection secure and anonymous on public networks.

2008-07-09

Project Management

  • ITIL - Information Technology Infrostructure Library
  • PRINCE2 - Projects in Controlled Environments

2008-07-08

Google's Protocol Buffers

Interactive Tclsh: auto_noexec

If set to any value, then unknown will not attempt to auto-exec any commands.

SEE ALSO: auto_execok(n)

2008-07-02

DNS Servers

2008-06-30

2008-06-28

256 color terminals

  • PuTTY 0.60: Settings > Window > Colours > Allow terminal to use xterm-256color mode
  • Ubuntu 6.06: apt-get install ncurses-term
  • Set TERM=xterm-256color
  • Compile screen: configure --enable-colors256
  • Edit .screenrc:
# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
defbce "on"
  • Start screen: screen -T xterm-256color
References: 256 color emacs + putty, 256 color xterm (including some 256 color schemes for vim)

Sources for Time Zone and Daylight Saving Time Data

Sources for Time Zone and Daylight Saving Time Data

`expect -D 1' works for 5.41

Expect 5.42.1 和 5.43 的 -D 1 参数一直不能正常工作, 郁闷很久, 找了一个 5.41 编译了一下, 却是好的, 看来是 5.41 之后的修改有问题吧.

Red Hat Liberation Fonts - Free

在 WinXP 上, Liberation Mono (and Bold) 10 号字体跟 Windows 的 Fixedsys 大小相当.

2008-06-27

Webmin

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely. See the standard modules page for a list of all the functions built into Webmin, or check out the screenshots.

2008-06-25

PIDs Littler Than 300 Reserved?

在 ubuntu 6.06.2 上试验了一下, pid 长到 32767 之后, 新的 pid 并不是从 1 开始分配的, 而是从 300 开始, 貌似系统给自己预留了一些 :-)

2008-06-13

[Ubuntu] Packages being kept back

# apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
The following packages have been kept back:
openssh-client openssh-server
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
# apt-get install openssh-client openssh-server
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
openssh-blacklist
Suggested packages:
rssh
The following NEW packages will be installed:
openssh-blacklist
The following packages will be upgraded:
openssh-client openssh-server
2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2909kB of archives.
After unpacking 4280kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com dapper-updates/main openssh-blacklist 0.1-1ubuntu0.6.06.1 [2125kB]
Get:2 http://us.archive.ubuntu.com dapper-updates/main openssh-server 1:4.2p1-7ubuntu3.4 [207kB]
Get:3 http://us.archive.ubuntu.com dapper-updates/main openssh-client 1:4.2p1-7ubuntu3.4 [577kB]
Fetched 2909kB in 45s (63.6kB/s)
Preconfiguring packages ...
Selecting previously deselected package openssh-blacklist.
(Reading database ... 93922 files and directories currently installed.)
Unpacking openssh-blacklist (from .../openssh-blacklist_0.1-1ubuntu0.6.06.1_all.deb) ...
Preparing to replace openssh-server 1:4.2p1-7ubuntu3.3 (using .../openssh-server_1%3a4.2p1-7ubuntu3.4_i386.deb) ...
Unpacking replacement openssh-server ...
Preparing to replace openssh-client 1:4.2p1-7ubuntu3.3 (using .../openssh-client_1%3a4.2p1-7ubuntu3.4_i386.deb) ...
Unpacking replacement openssh-client ...
Setting up openssh-blacklist (0.1-1ubuntu0.6.06.1) ...
Setting up openssh-client (4.2p1-7ubuntu3.4) ...

Setting up openssh-server (4.2p1-7ubuntu3.4) ...
* Restarting OpenBSD Secure Shell server... [ ok ]

#

2008-06-06

Quick Reference Cards

Quick Reference Cards - http://www.digilife.be/

How to uninstall Apps in Mac OS X

-- apple mac os x uninstall --

[Ubuntu 6.06] Disable IPv6

系统启动到 IPv6 over IPv4 tunneling driver 时候 hang 住了

2008-06-05

Hex Editors

  • apt-cache search -n hex
  • apt-get install hexedit
  • apt-get install hexer
  • apt-get install hexcurse
  • apt-get install ncurses-hexedit
--
hex edit editor

2008-06-04

2008-05-31

How to enable single window mode in Safari

After browsing for a few hours in Safari it's possible to end up with a dozen windows or so because of links that open a new window (links with target="_blank"). I've always wished there was a way to have these links open in a new tab instead of a new window (sometimes referred to as single window mode).

In the latest Safari 3.1 Apple finally added a (hidden) preference! To enable single window mode and have all links open in a new tab that would normally have opened in a new window, we only need to enable the TargetedClicksCreateTabs preference using the following command (paste it into Terminal):

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

You might need to restart Safari before the setting is taken into effect. To disable the setting again, run the same command with false instead of true.

Have fun!

-- From http://www.naquah.net/

2008-05-22

2008-05-17

Ubuntu 8.04

前天收到了从 Netherland 寄来的 Ubuntu 8.04 的 CD, 里面已经 officially 包含了 Wubi 安装程序, 在 Windows XP 上安装了一下, 很顺畅, 没遇到什么麻烦, 只是在安装过程中有个进度条竟然到了 128%, 应该是个小 bug. 启动之后使用正常, 只发现一点儿小问题: 音量控制不起作用.

2008-05-15

Securing and Optimizing Linux

Securing and Optimizing Linux - RedHat Edition - A Hands on Guide

2008-05-09

PuttyCyg

PuttyCyg - code.google.com

--
putty cygwin

Layer 4-7 Switching

Layer 4 switching: The magic combination - NetworkWorld.com
Multilayer Switch - Wikipedia.org

A Layer 7 Switch performs wire-speed processing of packet header content, not only at Layer 2 or Layer 3, but also at the transport layer (Layer 4) up through the application layer (OSI’s Layer 7). Layer 7 switch integrates routing and switching by forwarding traffic at layer 2 speed using layer 7 information. For example, an XML switch can analyze the XML tags at the application level and make forwarding decisions. -- javvin.com

Readers' Choice Awards 2008

Readers' Choice Awards 2008

Parted Magic

Parted Magic is a Linux LiveCD/USB/PXE with its elemental purpose being to partition hard drives.

Optimized at approximately 45MB, the Parted Magic OS employs core programs of GParted and Parted to handle partitioning tasks with ease, while featuring other useful programs (e.g. Partition Image, TestDisk, fdisk, sfdisk, dd, ddrescue, etc.) and an excellent set of documentation to benefit the user. An extensive collection of fileystem tools are also included, as Parted Magic supports the following: ext2, ext3, ext4, fat16, fat32, hfs, hfs+, jfs, linux-swap, ntfs, reiserfs, reiser4, and xfs.

The latest version is updated with: Linux 2.6.24.3, Parted 1.8.8, ntfsprogs-2.0.0, ntfs-3g-1.2506, and GParted-0.3.7.

Parted Magic uses Busybox for basic Unix commands and networking, the Dropbear SSH server and client, and Firefox to surf the web.

The current Xserver is xorg-server-1.4.0.90 with the following drivers: apm, ark, ati, chips, cirrus, cyrix, glint, i128, i740, i810, mga, neomagic, nv, r128, riva128, radeon, rendition, s3, s3virge, savage, siliconmotion, sis, tdfx, tga, trident, tseng, vesa, vmware, and voodoo.

The mini Xserver, Xvesa, is also available.

Parted Magic falls under the terms of the GPL.

2008-05-04

LDAP Docs

LDAP related RFCs - bind9.net
LDAP related RFCs - ldapman.org

2008-04-29

Disabling the Firefox DNS cache

Disabling the Firefox DNS cache

November 4th, 2006 by site admin

If you, like me, make frequent changes to your host file, for instance because your staging and production environment both listen to the same vhost. You will have probably noticed that it takes Firefox a while to pick up on the alterations you made. This is because in order to improve performance by default Firefox caches DNS lookups for up to 60 seconds. If you do not feel like waiting, restarting the browser is your only option. Fortunately you can disable DNS caching. This is what you do :

Enter about:config in the adress bar.

Right click on the list of properties, select new > integer in the context menu

enter network.dnsCacheExpiration as the preference name and 0 as the integer value

Add another integer preference, this time use network.dnsCacheEntries as the preference name and again 0 as the value

2008-04-25

[股市] 什么是“大非”、“小非”

股权分置改革之前,上市公司的股份分为流通股和非流通股两部分。股权分置改革之后,考虑到市场的接纳程 度,对非流通股获得流通权规定了限制时间,这部分股票因此叫限售股份。“大非”是指大规模的限售流通股,占总股本5%以上。“小非”是指小规模限售流通 股,占总股本5%以下。

-- 南方周末

2008-04-02

Change MSN Account E-Mail

MSN 帐号支持修改 email 了, 在 Windows Live Account 登录后点 Change 链接即可, 昨天俺把用了 N 年的 MSN 帐号从 263 的 email 换成了 gmail. 转换过程很顺利, 原来的 MSN 好友会自动迁移到新的 MSN 帐号中, 正如我所期望的那样.

Free Books

Wikipedia 也能访问了!

既然 blogspot 解禁, 那 wikipedia 呢. 试一下打开 en.wikipedia.org, 竟然进去了, 大喜.

Blogspot 解禁了?

使用 proxy 访问 blogspot 很久了, 昨晚在家突然访问不了我的 blog 了, 以为是临时网络故障所致, 没有在意. 今早来公司再次访问俺的 blog, 仍然失败, 怪. 难道 ...? 修改 firefox 的 settings, 去掉 proxy 设置, 竟然能直接访问 blogspot 了, 喜. google 一下 ‘blogspot 解禁’, 果然是解禁了, 但愿不是临时的.

2008-03-28

andLinux

andLinux is a complete Ubuntu Linux system running seamlessly in Windows 2000 based systems (2000, XP, 2003, Vista; 32-bit versions only). This project was started for Dynamism for the GP2X community, but its userbase far exceeds its original design. andLinux is free and will remain so, but donations are greatly needed.

andLinux uses coLinux as its core which is confusing for many people. coLinux is a port of the Linux kernel to Windows. Although this technology is a bit like running Linux in a virtual machine, coLinux differs itself by being more of a merger of Windows and the Linux kernel and not an emulated PC, making it more efficient. Xming is used as X server and PulseAudio as sound server.

andLinux is not just for development and runs almost all Linux applications without modification.

2008-03-26

DNS Books

Dig for Windows

http://members.shaw.ca/nicholas.fong/dig/

GNU Utilities for Win32

Here are some ports of common GNU utilities to native Win32. In this context, native means the executables do only depend on the Microsoft C-runtime (msvcrt.dll) and not an emulation layer like that provided by Cygwin tools.

DoubleCommand 又把俺的 iBook G4 搞死了

前天 Mac OS X 10.4.11 (PPC) 进行了一次 system update, 之后重启, 结果又出现蓝屏, 起不来了! 再重启, 还是一样. :-( 因为以前出过同样的问题, 怀疑又是 DoubleCommand 捣的鬼, 重启, 按住 Command-s, 进入 single mode, 执行 mount -uw /, 删除 /Library/StartupItems/DoubleCommand 和 /Library/PreferencePanes/DoubleCommand* 目录, 再重启, 一切 OK.

以后再也不用 DoubleCommand 了!

Mac OS X Keyboard Shoutcuts

Follow me

2008-03-24

Wubi

试用了一下 Wubi, 装了 ubuntu-7.04 在 windows-xp 上, 整体感觉还是很流畅的, 不错.

2008-03-20

How to disable blinking cursors

One of the most famous methods of torture is Chinese water torture. In this torture a tied person is placed under a bucket filled with water with a tiny hole in the bottom. Water is slowly dripped on to a person's forehead, eventually driving the victim insane.

Software development is not an easy task, and often after a painful process of writing a program developers feel they should share their pains with users, so they put a part of own sufferings onto the shoulders of users in a method similar to the Chinese water torture - blinking cursors.

Fortunately, programmers are not insensitive torturers, and sometimes they provide an option in their programs to turn blinking cursers off. But often these options are not documented, and are not easily accessible.

-- jurta.org

Perl Sites

Perl.org
Perl.com
PM.org - Perl Mongers
CPAN.org
MacPerl.com
ActiveState.com
TPJ.com - The Perl Journal
PerlArchive.com
PerlMonks.com (or PerlMonks.net)
YAPC.org - Yet Another Perl Conference

2008-03-13

Gcc 4.3 released

GCC 4.3

2008-02-28

MacBook Air



2008-02-27

Wubi - Install Ubuntu Inside Windows

Wubi is an unofficial Ubuntu installer for Windows users that will bring you into the Linux world with a single click. Wubi allows you to install and uninstall Ubuntu as any other application. If you heard about Linux and Ubuntu, if you wanted to try them but you were afraid, this is for you.

2008-02-22

Firefox 3 Beta 3: The Home Button Has Gone

The Home button has been moved to the Bookmarks toolbar by default (but can be easily moved back) and the splitter that allows to resize the search and location bars when placed next to each other has become invisible.

对此网上骂声一片哈, 天晓得谁出的这馊主意 :)

2008-02-21

Phrase from Dennis

  • Eat your own dog food
  • Red Envelope

Google 了一下, 找到:

  • Eat one's own dog food
  • Sip your own champagne
  • Sip one's own champagne

2008-02-20

2008-02-19

[Ubuntu] Desktop vs. Server

Desktop 版跟 Server 版使用不同的 kernel:

desktop: linux-image (linux-image-2.6.15-23)
server: linux-image-server (linux-image-2.6.15-23-server)

desktop # uname -a
Linux ubuntu606 2.6.15-51-386 #1 PREEMPT Tue Feb 12 16:52:52 UTC 2008 i686 GNU/Linux
server # uname -a
Linux dapper-server 2.6.15-51-server #1 SMP Thu Dec 6 21:37:18 UTC 2007 i686 GNU/Linux

desktop 跟 server 的 /etc/lsb-release 也是相同的:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=6.06
DISTRIB_CODENAME=dapper
DISTRIB_DESCRIPTION="Ubuntu 6.06.2 LTS"

Compiling Expect 5.43 on Ubuntu 6.06

  • $ apt-get install tcl8.4-dev
  • $ wget http://expect.nist.gov/expect.tar.gz
  • $ tar -xzf ...
  • $ ./configure --prefix=... --with-tcl=/usr/lib/tcl8.4 --with-tclinclude=/usr/include/tcl8.4/tcl-private
  • $ make
  • $ make install

2008-02-17

Apt-file does not work for Dapper

近日发现 apt-file 不好用了, 不解. 看了一下 apt-file 的 man page, 它要用到 server 上的一个叫 Contents-i386.gz 的文件, 所有的信息应该都在这个文件里面, 然而 server 上的这个文件大小只有 677 个 byte. 到 server 的 Edgy 的目录里面看了一下, 这个文件的大小有 11M 呢, 不晓得 Dapper 里面的这个文件为什么这么小了. 心生一计, 来个偷梁换柱, 把 Edgy 里面的文件 download 下来改名成 Dapper 的就好了!

2008-02-15

Locale variables

Variable What it's for
LANG The basic language setting used by applications on the system, unless overridden by one of the other locale environment variables
LC_CTYPE The character set used to display and input text
LC_NUMERIC How non-monetary numeric values are formatted on screen
LC_TIME How date and time values are formatted
LC_COLLATE How to sort various information items (e.g. defines the order of the alphabet so items can be ordered alphabetically by the sort command)
LC_MONETARY How monetary numeric values are formatted
LC_MESSAGES Which language is to display messages to the end user
LC_PAPER Definitions of paper formats and standards
LC_NAME How names are formatted
LC_ADDRESS How to display address information
LC_TELEPHONE How telephone numbers are structured
LC_MEASUREMENT What units of measurement are used
LC_IDENTIFICATION
LC_ALL This variable serves as a powerful override over all the other locale environment variables. When its value is set, applications use that value to determine which locale settings to use regardless of the values of the other variables

Perl 5.10.0 released

Perl 5.10.0 Released

Today (December 18th, 2007) the Perl Foundation announces the release of Perl 5.10, the first major upgrade to the wildly popular dynamic programming language in over five years. This latest version builds on the successful 5.8.x series by adding powerful new language features and improving the Perl interpreter itself. The Perl development team, called the Perl Porters, has taken features and inspiration from the ambitious Perl 6 project, as well as from chiefly academic languages and blended them with Perl's pragmatic view to practicality and usefulness.

Significant new language features

The most exciting change is the new smart match operator. It implements a new kind of comparison, the specifics of which are contextual based on the inputs to the operator. For example, to find if scalar $needle is in array @haystack, simply use the new ~~ operator:

  if ( $needle ~~ @haystack ) ...

The result is that all comparisons now just Do The Right Thing, a hallmark of Perl programming. Building on the smart-match operator, Perl finally gets a switch statement, and it goes far beyond the kind of traditional switch statement found in languages like C, C++ and Java.

Regular expressions are now far more powerful. Programmers can now use named captures in regular expressions, rather than counting parentheses for positional captures. Perl 5.10 also supports recursive patterns, making many useful constructs, especially in parsing, now possible. Even with these new features, the regular expression engine has been tweaked, tuned and sped up in many cases.

Other improvements include state variables that allow variables to persist between calls to subroutines; user defined pragmata that allow users to write modules to influence the way Perl behaves; a defined-or operator; field hashes for inside-out objects and better error messages.

Interpreter improvements

It's not just language changes. The Perl interpreter itself is faster with a smaller memory footprint, and has several UTF-8 and threading improvements. The Perl installation is now relocatable, a blessing for systems administrators and operating system packagers. The source code is more portable, and of course many small bugs have been fixed along the way. It all adds up to the best Perl yet.

For a list of all changes in Perl 5.10, see Perl 5.10's perldelta document included with the source distribution. For a gentler introduction of just the high points, the slides for Ricardo Signes' Perl 5.10 For People Who Aren't Totally Insane talk are well worth reading.

Don't think that the Perl Porters are resting on their laurels. As Rafael Garcia-Suarez, the release manager for Perl 5.10, said: "I would like to thank every one of the Perl Porters for their efforts. I hope we'll all be proud of what Perl is becoming, and ready to get back to the keyboard for 5.12."

2008-02-14

Searching Ubuntu Packages

http://packages.ubuntu.com/

[Ubuntu] Components

Components

The Ubuntu software repository is divided into four components, main, restricted, universe and multiverse on the basis of our ability to support that software, and whether or not it meets the goals laid out in our Free Software Philosophy.

The standard Ubuntu installation is a subset of software available from the main and restricted components. You can install additional software using installation software such as Synaptic Package Manager or Aptitude. Other components are added by editing the /etc/apt/sources.list file. See "man sources.list" for more information on editing the sources.list file.

"main" component

The main distribution component contains applications that are free software, can freely be redistributed and are fully supported by the Ubuntu team. This includes the most popular and most reliable open source applications available, much of which is installed by default when you install Ubuntu.

Software in main includes a hand-selected list of applications that the Ubuntu developers, community, and users feel are important and that the Ubuntu security and distribution team are willing to support. When you install software from the main component you are assured that the software will come with security updates and technical support.

We believe that the software in main includes everything most people will need for a fully functional desktop or internet server running only open source software.

The licences for software applications in main must be free, but main may also may contain binary firmware and selected fonts that cannot be modified without permission from their authors. In all cases redistribution is unencumbered.

"restricted" component

The restricted component is reserved for software that is very commonly used, and which is supported by the Ubuntu team even though it is not available under a completely free licence. Please note that it may not be possible to provide complete support for this software since we are unable to fix the software ourselves, but can only forward problem reports to the actual authors.

Some software from restricted will be installed on Ubuntu CDs but is clearly separated to ensure that it is easy to remove. We include this software because it is essential in order for Ubuntu to run on certain machines - typical examples are the binary drivers that some video card vendors publish, which are the only way for Ubuntu to run on those machines. By default, we will only use open source software unless there is simply no other way to install Ubuntu. The Ubuntu team works with such vendors to accelerate the open-sourcing of their software to ensure that as much software as possible is available under a Free licence.

"universe" component

The universe component is a snapshot of the free, open source, and Linux world. In universe you can find almost every piece of open source software, and software available under a variety of less open licences, all built automatically from a variety of public sources. All of this software is compiled against the libraries and using the tools that form part of main, so it should install and work well with the software in main, but it comes with no guarantee of security fixes and support. The universe component includes thousands of pieces of software. Through universe, users are able to have the diversity and flexibility offered by the vast open source world on top of a stable Ubuntu core.

Canonical does not provide a guarantee of regular security updates for software found in universe but will provide these where they are made available by the community. Users should understand the risk inherent in using packages from the universe component.

Popular or well supported pieces of software will move from universe into main if they are backed by maintainers willing to meet the standards set for main by the Ubuntu team.

"multiverse" component

The "multiverse" component contains software that is "not free", which means the licensing requirements of this software do not meet the Ubuntu "main" Component Licence Policy.

The onus is on you to verify your rights to use this software and comply with the licensing terms of the copyright holder.

This software is not supported and usually cannot be fixed or updated. Use it at your own risk.

mailsend

Mailsend is a simple program to send mail via SMTP protocol (That's how all emails are sent). I needed to send a piece of alert mail from a program in a networked Windows machine, but could not find a simple program like this installed. So I wrote one. You might find it useful in some situations. The program does not use any config file and I plan to keep it that way. At this time I don't have any plan to port it to Unix. Well I had a need and I ported it to Unix (v1.05, Feb-24-2004).

cygpath: Convert Unix and Windows format paths, or output system path information

Refer to cygpath(1) for details

[kw: cygwin]

2008-02-08

[Mac OS X] Remove the scrollbar but not the buffer from Terminal

Remove the scrollbar but not the buffer from Terminal

Coming from a Linux background, I miss having a terminal window that had a buffer but did not display a scrollbar. Terminal previously would not allow you to have one without the other.

While setting up a special terminal window, I noticed that the .term files have a separate entry for the scrollbar and the buffer. While the GUI combines these, you can go into the .term file itself and turn off the scroll bar and keep the buffer!

[robg adds: To make this work, first you'll need to create a saved Terminal using File -> Save. Hopefully it saves in the default location (your user's Library -> Application Support -> Terminal folder). This allows the saved Terminal to be used from the File -> Library menu. Regardless of where it's saved, once you have a saved Terminal, open it in your favorite editor and search for:


<key>Scrollbar</key>
<string>YES</string>
Change the YES to NO, save the file, and then open it in Terminal. You should now have a window with scrollback but without the scrollbar.]

2008-02-06

MacPorts upgraded

今天升级 MacPorts 到 1.6 了, 同时发现 Tcl 8.5 release 了, Subversion 也有 1.4.6 了.

Changes in Tcl 8.5

2008-02-05

acct(2)

NAME
acct -- enable or disable process accounting

SYNOPSIS
#include <unistd.h>

int
acct(const char *file);

DESCRIPTION
The acct() call enables or disables the collection of system accounting
records. If the argument file is a nil pointer, accounting is disabled.
If file is an existing pathname (null-terminated), record collection is
enabled and for every process initiated which terminates under normal
conditions an accounting record is appended to file. Abnormal conditions
of termination are reboots or other fatal system problems. Records for
processes which never terminate can not be produced by acct().

For more information on the record structure used by acct(), see
/usr/include/sys/acct.h and acct(5).

This call is permitted only to the super-user.

NOTES
Accounting is automatically disabled when the file system the accounting
file resides on runs out of space; it is enabled when space once again
becomes available.

2008-02-04

Jabber servers

  • MSN
    • nedbsd.nl
    • jabber.no
  • Yahoo
    • jaim.at
    • jabber.no
  • QQ
    • freelinq.com

[cygwin] Run crond service

$ cron-config

2008-01-30

[Cygwin] Install xinetd service

  • $ xinetd-config
  • $ cygrunsrv -I xinetd -p /usr/sbin/xinetd -d 'CYGWIN xinetd' -a '-stayalive -pidfile /var/run/xinetd.pid'
  • $ cygrunsrv -S xinetd

How to start SSH service in Cygwin

  1. $ vim C:/cygwin/Cygwin.bat
    • Add one line: set CYGWIN=binmode tty ntsec
  2. Restart Cygwin
  3. $ ssh-host-config
    • windows 中会多一个 service 叫 CYGWIN sshd
  4. $ cygrunsrv -S sshd

[kw: cygwin ssh sshd]

Cygwin something

2008-01-28

[Apple] How to hide the menu bar and Dock

Have you ever wanted the ability to hide the Dock and/or the menu bar on an application-by-application basis? That is, when you launch iPhoto, the Dock is hidden, when you launch Google Earth both the Dock and the menu bar are hidden? This can be useful when working on a smaller screen with a program that requires most of the screen for its visuals, or if you just find the Dock and menu bar are cluttering your view of things.

While there are a number of third-party programs out that purport to do just this— ASM and MenuShade come to mind—it’s actually quite easy to do yourself. It just takes a couple of simple edits in one file within the given application.

As an example, I’ll change Stickies so that the Dock and menu bar both go into hiding when the application is launched. Note that they’re not lost for good—they’re simply hiding, and will reappear when you move the mouse into their typical locations. The key to this hint is a property list variable named LSUIPresentationMode. By setting this variable to a certain value within each application’s info.plist file, you can change how the Dock and menu bar behave within that application.

Whenever you do something like this, it’s a very good idea (read: do it!) to make a backup copy of the application in question. Make your modifications on the backup copy of the program, and then if something goes wrong, you’ll only have to delete the backup you created to get things back to normal.

To change how an application handles the Dock and menu bar, you need to find the program’s info.plist file. These are always located inside the application bundle, so start by control-clicking on the backup copy of the app and choosing Show Pacakge Contents from the pop-up menu. In the new window that opens, open the Contents folder and you should find the info.plist file. What you do next depends on whether or not you have Apple’s free Developer Tools, known as Xcode, installed.

Xcode is not installed

If you don’t have Xcode installed, the easiest way to implement this hint is to download and install Brian Webster’s PlistEdit Pro, a third-party shareware application. This $24.95 program works much like the Property List Editor program included with Xcode. There’s a free trial period, so you can test it out yourself before deciding to buy. If you choose to use this program, skip ahead to the Xcode is installed section of this hint for the how-to.

If you’re still reading, that means you’ve chosen not to use a property list editor of some sort. That’s OK; this hint isn’t really all that tough to implement, but you will need a pure text editor such as TextEdit. Open your text editor, then drag and drop the info.plist file onto the text editor’s icon in the Dock. If you’re using a copy of Stickies, as I am, then here’s what you’ll see:


To make Stickies hide the Dock and menu bar when launched, add the following two lines, just below the entry on row four:

<key>LSUIPresentationMode</key>
<integer>4</integer>

Save the changes, and you’re done. Jump down to Putting it to use to see how it works.

Xcode is installed

If you have Xcode (or PListEditor Pro), the changes are even simpler. With Xcode installed, just double-click on the info.plist file and it will open in Property List Editor; PListEditor Pro users may have to use drag-and-drop to open the file.

Once it’s open in either editor, click once on the Root entry in the Property List section of the window, then click the New Child button in the toolbar. Set the name of the entry to LSUIPresentationMode, the Class pop-up to Number, and give it a value of 4. Save the file, and you’re done with the editing.

Putting it to use

In the following short movie clip, you’ll see two versions of Stickies running. The first is the stock Stickies, and you can see both the menubar and the Dock remain visible when it’s launched. The second is my modified Stickies—when it’s launched, both the menu bar and the Dock vanish.

As you can see in the video, the menu bar and Dock both become visible again when you mouse into their respective regions, so nothing is lost for good. Note, however, that this trick will not necessarily work perfectly in every application—hide the menu bar in Photoshop CS2, for instance, and you may have issues selecting items in the menus. If you stick to Cocoa applications (typically those provided by Apple, plus many third-party apps such as those by OmniGroup), you should have good results. Modifying Carbon apps (such as Photoshop, BBEdit, etc.) may be more troublesome.

If you ever want/need to undo what you’ve done, just delete the backup copy of the app you modified, and you’re done. What, you didn’t work on a backup copy? Well, just open the info.plist file in your editor of choice, and remove the two lines you added (or use the Delete feature in your property list editor application). Just make sure the program isn’t running when you do this. Save your changes, relaunch the program, and things should be back to normal.


-- From MacWorld

7-Zip

http://www.7-zip.org/

[kw: compress]

2008-01-26

NTP/SNTP Tools

NetTime - Sourceforge.net
iTimeSync
Free Time Sync Software

NTP Configuration on Windows 2000 Workstation

NTP Configuration on Windows 2000 Workstation

Windows 2000 (Win2K) uses a time service, known as Windows Time Synchronization Service (Win32Time), to ensure that all Win2K computers on your network use a common time. The W32Time Service is a fully compliant implementation of the Simple Network Time Protocol (SNTP) as detailed in IETF RFC 1769. SNTP uses UDP port 123 by default. If you want to synchronize your time server with an SNTP server on the Internet, make sure that port is available.

  • Select a NTP server, using

net time /setsntp:swisstime.ethz.ch

  • Start the W32time service with

net start W32Time

You can also set the start option of the Windows Time Synchronization Service (W32Time) to Automatic, so the service will start when Windows/2000 starts.

Set the following Registry Entries for the W32Time Service (marked in blue color)

The registry values are located in the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

  • AvoidTimeSyncOnWan : REG_DWORD (optional)
    Prevents the computer from synchronizing with a computer that is in another site.
    0 = the site of the time source is ignored [default]
    1 = the computer does not synchronize with a time source that is in a different site

  • GetDcBackoffMaxTimes : REG_DWORD (optional)
    The maximum number of times to double the backoff interval when successive attempts to find a domain controller do not succeed. An event is logged every time a wait of the maximum length occurs.
    0 = the wait between successive attempts is always the minimum and no event is logged
    7 = [default]

  • GetDcBackoffMinutes : REG_DWORD (optional)
    The initial number of minutes to wait before looking for a domain controller if the last attempt did not succeed. 15 = [default]

  • LocalNTP : REG_DWORD
    Used to start the SNTP server.
    0 = do not start the SNTP server unless this computer is a domain controller[default]
    1 = always start the SNTP server

  • NtpServer : REG_SZ (swisstime.ethz.ch)
    NtpServer : REG_SZ (optional) Used to manually configure the time source. Set this to the DNS name or IP address of the NTP server to synchronize from. You can modify this from the command line by using the net time command. Value is blank by default

  • Period : REG_DWORD or REG_SZ
    Used to control how often the time service synchronizes. If a string value is specified, it must be one of special ones listed below.
    0 = once a day
    65535, "BiDaily" = once every 2 days
    65534, "Tridaily" = once every 3 days
    65533, "Weekly" = once every week (7 days)
    65532, "SpecialSkew" = once every 45 minutes until 3 good synchronizations occur, then once every 8 hours (3 per day) [default]
    65531, "DailySpecialSkew" = once every 45 minutes until 1 good synchronization occurs, then once every day
    freq = freq times per day

  • ReliableTimeSource : REG_DWORD (optional)
    Used to indicate that this computer has reliable time.
    0 = do not mark this computer as having reliable time [default]
    1 = mark this computer as having reliable time (this is only useful on a domain controller)

  • Type : REG_SZ
    Used to control how a computer synchronizes.
    Nt5DS = synchronize to domain hierarchy [default]
    NTP = synchronize to manually configured source
    NoSync = do not synchronize time

    The Nt5DS setting may not use a manual configured source.

The Adj and msSkewPerDay values are used to preserve information about the computer's clock between restarts. Do not manually edit these values.

2008-01-14

[Ubuntu 6.06] chown changes file permissions?

# ls -l foo.sh
-rwxr-xr-x 1 root root 23 2007-08-16 14:30 foo.sh
# chmod u+s foo.sh
# ls -l foo.sh
-rwsr-xr-x 1 root root 23 2007-08-16 14:30 foo.sh
# chown root:root foo.sh
# ls -l foo.sh
-rwxr-xr-x 1 root root 23 2007-08-16 14:30 foo.sh
# uname -a
Linux ubuntu 2.6.15-27-686 #1 SMP PREEMPT Sat Sep 16 02:13:27 UTC 2006 i686 GNU/Linux
#

Firefox 3b2 on Mac OS X

使用了 Firefox 3 Beta 2, 感觉还不错, 以前 google 时输入框内光标错位问题没有了, 速度也还可以, 期待 release 版 :-)

Fun Input Toy (FIT): 苹果输入法

去年尝试 fit 的时候好像还不很稳定, 没怎么敢用, 现在貌似强大了好多, 下载了 1.5.7 (for Tiger PPC) 版, 感觉不错的样子 :-) 不过以后可能会将重点放到 Leopard 的支持上, 但愿 Tiger 的版本也能继续维护.

2008-01-02

crypt() in PHP

crypt

(PHP 4, PHP 5)

crypt — One-way string encryption (hashing)

Description

string crypt ( string $str [, string $salt ] )

crypt() will return an encrypted string using the standard Unix DES-based encryption algorithm or alternative algorithms that may be available on the system.

Some operating systems support more than one type of encryption. In fact, sometimes the standard DES-based encryption is replaced by an MD5-based encryption algorithm. The encryption type is triggered by the salt argument. At install time, PHP determines the capabilities of the crypt function and will accept salts for other encryption types. If no salt is provided, PHP will auto-generate a standard two character salt by default, unless the default encryption type on the system is MD5, in which case a random MD5-compatible salt is generated. PHP sets a constant named CRYPT_SALT_LENGTH which tells you whether a regular two character salt applies to your system or the longer twelve character salt is applicable.

The standard DES-based encryption crypt() returns the salt as the first two characters of the output. It also only uses the first eight characters of str , so longer strings that start with the same eight characters will generate the same result (when the same salt is used).

On systems where the crypt() function supports multiple encryption types, the following constants are set to 0 or 1 depending on whether the given type is available:

  • CRYPT_STD_DES - Standard DES-based encryption with a two character salt
  • CRYPT_EXT_DES - Extended DES-based encryption with a nine character salt
  • CRYPT_MD5 - MD5 encryption with a twelve character salt starting with $1$
  • CRYPT_BLOWFISH - Blowfish encryption with a sixteen character salt starting with $2$ or $2a$