- $ xinetd-config
- $ cygrunsrv -I xinetd -p /usr/sbin/xinetd -d 'CYGWIN xinetd' -a '-stayalive -pidfile /var/run/xinetd.pid'
- $ cygrunsrv -S xinetd
2008-01-30
[Cygwin] Install xinetd service
Posted by
Display Name
-
2:03 PM
0
comments
How to start SSH service in Cygwin
- $ vim C:/cygwin/Cygwin.bat
- Add one line: set CYGWIN=binmode tty ntsec
- Restart Cygwin
- $ ssh-host-config
- windows 中会多一个 service 叫 CYGWIN sshd
- $ cygrunsrv -S sshd
[kw: cygwin ssh sshd]
Posted by
Display Name
-
10:10 AM
0
comments
Cygwin something
- clear - ncurses
- hexdump - util-linux
- Search Cygwin packages
Posted by
Display Name
-
10:05 AM
0
comments
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
<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.
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.
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
Posted by
Display Name
-
10:55 PM
0
comments
Labels: Apple
7-Zip
http://www.7-zip.org/
[kw: compress]
Posted by
Display Name
-
12:41 PM
0
comments
Labels: Utils
2008-01-26
NTP/SNTP Tools
NetTime - Sourceforge.net
iTimeSync
Free Time Sync Software
Posted by
Display Name
-
11:11 PM
0
comments
Labels: Network/Security, Utils
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.
Posted by
Display Name
-
11:04 PM
0
comments
Labels: Network/Security, Utils
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
#
Posted by
Display Name
-
1:54 PM
0
comments
Labels: *nix, Debian/Ubuntu
Firefox 3b2 on Mac OS X
使用了 Firefox 3 Beta 2, 感觉还不错, 以前 google 时输入框内光标错位问题没有了, 速度也还可以, 期待 release 版 :-)
Posted by
Display Name
-
9:30 AM
0
comments
Labels: Apple, Network/Security
Fun Input Toy (FIT): 苹果输入法
去年尝试 fit 的时候好像还不很稳定, 没怎么敢用, 现在貌似强大了好多, 下载了 1.5.7 (for Tiger PPC) 版, 感觉不错的样子 :-) 不过以后可能会将重点放到 Leopard 的支持上, 但愿 Tiger 的版本也能继续维护.
Posted by
Display Name
-
9:26 AM
0
comments
Labels: Apple
2008-01-02
crypt() in PHP
Description
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$
Posted by
Display Name
-
9:28 AM
0
comments
Labels: Network/Security, Shell/Scripting