Month: January 2006

  • Masters of their Domains

    Forget condos and strip malls. Domain names, the real estate of the Web, have been delivering far greater returns. How some of the savviest speculators on the Net are making millions from their URL portfolios. read more | digg story

  • Opera & page body margin

    body { margin: 0px; } In IE & Firefox there will be no margin for the page. In Opera there is still the spacing. Why? Because Opera has in its default styles, just as the CSS2 specification suggests (see appendix A) body { margin: 0px; padding: 8px; } To have no spacing between page body…

  • HOWTO: clear bash history?

    [root@ ~]# history -c

  • Get CPU information

    $make = exec(“cat /proc/cpuinfo|grep ‘model name’|cut -d : -f 2|cut -c 2-“); $speed = exec(“cat /proc/cpuinfo|grep MHz|cut -d : -f 2|cut -c 2-“); $count = exec(“grep processor /proc/cpuinfo|wc|awk ‘{print $1}’”); $hyperthreaded = exec(“grep flags /proc/cpuinfo|grep ‘ ht’”); Sample Output: Make: AMD Opteron(tm) Processor 244 Speed: 1792.558 Count: 2 Hyperthreaded: No

  • View & sort existing RPM packages

    rpm -qa –qf ‘%{SIZE} %{NAME}\n’ | sort -nr | less Sample Output: 186925230 kernel-source 184937329 kernel-source 74392320 rpmdb-redhat 44488420 emacs 42509842 glibc-common 41262406 libstdc++-ssa-devel 31483893 frontpage 27851009 perl 25825586 comps 23352847 kernel 23219902 libgcj-ssa-devel 22570875 kernel 21628214 rpm-devel 21543354 kernel-smp 20757085 kernel-smp 18808196 gcc-gnat 17833551 MySQL-server 17596278 ant-libs

  • wget, login & cookie

    If you need to sign into a site and download a file automatically with wget, here is a shell script for that: #!/bin/sh COOKIE_FILE=cookie.txt LOGIN_URL=”http://example.com/login?username=xxxx&password=xxxx” login() { echo “Signing in….” wget –save-cookie cookie.txt $LOGIN_URL return } print_usage() { echo “Usage: $0 [URL]” return } if [ $# -eq 0 ] ; then print_usage exit 1…

  • phpESP 1.8 – Poll/Survey Script – DB Design

    — # table of different surveys available CREATE TABLE survey ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, name CHAR(64) NOT NULL, owner CHAR(16) NOT NULL, realm CHAR(64) NOT NULL, public ENUM(‘Y’,’N’) NOT NULL DEFAULT ‘Y’, status INT UNSIGNED NOT NULL DEFAULT ‘0’, title CHAR(255) NOT NULL, email CHAR(64), subtitle TEXT, info TEXT, theme CHAR(64), thanks_page…

  • JSCookMenu 1.4.3 Bug

    File: JSCookMenu.js line 178 Old: hasChild = (item.length > 5); New: hasChild = (item.length && item.length > 5); Purpose: avoid warning because _cmSplit is parsed as an object and does not have length property Updated: JSCookMenu updated to 1.4.4 with a quick fix for a bug for _cmSplit checking.

  • Passing Arguments to a JavaScript Function

    function foo() { var argv = foo.arguments; var argc = argv.length; for (var i = 0; i < argc; i++) { alert("Argument " + i + " = " + argv[i]); } } Firefox 1.5 returns “Warning: deprecated arguments usage” Solution: “var argv = arguments;” Reference: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Functions:arguments “The arguments object is a local variable available…