Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E73F964FC03 for ; Thu, 25 Sep 2008 22:13:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 69611-10 for ; Thu, 25 Sep 2008 22:13:49 -0300 (ADT) X-Greylist: delayed 00:30:17.412365 by SQLgrey-1.7.6 Received: from necsf13.nec.co.nz (mailhub13.nec.co.nz [202.37.54.13]) by postgresql.org (Postfix) with ESMTP id 8C85E64FC01 for ; Thu, 25 Sep 2008 22:13:49 -0300 (ADT) Received: from necsf13.nec.co.nz (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 8936713FDF; Fri, 26 Sep 2008 12:43:27 +1200 (NZST) Received: from nzlu01.nec.co.nz (mailhost.nec.co.nz [172.30.41.1]) by necsf13.nec.co.nz (Postfix) with ESMTP id 7D8FD13FDD; Fri, 26 Sep 2008 12:43:23 +1200 (NZST) Received: from nec.co.nz ([172.30.41.152]) by nzlu01.nec.co.nz (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0K7S00DFD20BV6@nzlu01.nec.co.nz>; Fri, 26 Sep 2008 12:43:23 +1200 (NZST) Date: Fri, 26 Sep 2008 12:43:23 +1200 From: Steve Martin Subject: Re: Hex representation To: Carol Walter Cc: "Plugge, Joe R." , Steve Crawford , Scott Marlowe , pgsql-admin@postgresql.org Message-id: <48DC302B.7000100@nec.co.nz> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-nz, en-us, en, fr User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020921 Netscape/7.0 References: <337D9AE2-2BEF-48E3-8DF4-E7F0CA560A1B@indiana.edu> <48DBCD2B.6020108@pinpointresearch.com> <32CC45C5BDC57241B9BCEF37AC0C5DB5080B9A0E@OMAEXMB02.corp.westworlds.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/314 X-Sequence-Number: 30407 Hi, - see below Plugge, Joe R. wrote: >Change the shbang line to match where your php in installed (if it is at >all) > >#!/full_path_to_my_php -q > >-----Original Message----- >From: pgsql-admin-owner@postgresql.org >[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Carol Walter >Sent: Thursday, September 25, 2008 1:15 PM >To: Steve Crawford >Cc: Scott Marlowe; pgsql-admin@postgresql.org >Subject: Re: [ADMIN] Hex representation > >Well, it was a bit convoluted, but I created the file with Excel, >filling the right number of cells with \x55. This worked too. The >script wouldn't run for me. I got an error about a "bad interpreter". > >Carol > >On Sep 25, 2008, at 1:40 PM, Steve Crawford wrote: > > > >>Scott Marlowe wrote: >> >> >>>I used this very simple little php script to make this >>> >>>filename: mk55: >>>#!/usr/bin/php -q >>>>>for ($i=0;$i<262144;$i++){ >>> print chr(85); >>>} >>>?> >>> >>> >>> >>Or, using standard *nix tools (Note: 0x55 = ascii U): >>dd bs=1k count=256 if=/dev/zero | tr '\000' U > full_of_0x55 >> >>Cheers, >>Steve >> >> >> I liked Steve Crawford's idea, a good one liner but I could not get it to work on sunos, version (Generic_118558-35). Worked on HPUX. Just using basic shell scripting, the following are another way of doing it. Using bash, it can be done like this: --- Start u.sh --- #!/usr/local/bin/bash <- change to output of "which bash" max=`expr 256 \* 1024` for (( i=0; i<$max; ++i )) ; do echo -n U <- depends on system, try print done --- End u.sh --- E.g ./u.sh > losOfUs.txt % xd losOfUs.txt | less 0000000 5555 5555 5555 5555 5555 5555 5555 5555 * 0040000 Or ksh or sh --- Start u.sh --- #!/bin/ksh <- change to output of "which ksh" max=`expr 256 \* 1024` i=0 while [ $i -lt $max ] ; do print -n U i=`expr $i + 1` done --- End u.sh --- ./u.sh > losOfUs.txt od -x losOfUs.txt | less 0000000 0000 0000 0000 0000 0000 0000 0000 0000 * 0003720 <- still working, slow machine :-{ Regards Steve Martin