Archive for Unix

Gogrid – service going down hill – 10000% uptime guaranteed – false advertising

There was a time I recommended gogrid to many people – having moved away from uk2.net which was just about as dreadful as it gets as far as maintaining a service goes.

Twice this week now go-grid (www.gogrid.com) have had network problems. They have a 10000% guaranteed uptime yet in about 7 months I’ve had in access of 7 hours outage and yet to receive any form of reimbursement.

Basically, if you have mission critical appliances then you can’t rely on go-grid either.

The RFO’s from the last outage tells us the blame is due to DOS against another of their servers and they said it would be fixed. The truth is, they fixed nothing and AGAIN my server can’t be accessed.

I supposed the next step is to move business to Amazon EC2.. More to do…
13   183 ms   178 ms   179 ms  ae-92-92.ebr2.SanJose1.Level3.net [4.69.134.221]

14   180 ms   180 ms   179 ms  ae-1-6.bar2.SanFrancisco1.Level3.net [4.69.140.1
3]
15   180 ms   180 ms   219 ms  ae-4-4.car2.SanFrancisco1.Level3.net [4.69.133.1
7]
16   180 ms   179 ms   180 ms  SERVEPATH.car2.SanFrancisco1.Level3.net [4.53.13
.18]
17     *        *        *     Request timed out.
18     *        *        *     Request timed out.
19     *        *        *     Request timed out.
20     *        *        *     Request timed out.
21     *        *        *     Request timed out.
22     *        *        *     Request timed out.
23     *        *        *     Request timed out.
24     *        *        *     Request timed out.
25     *        *        *     Request timed out.
26     *        *        *     Request timed out.
27     *        *        *     Request timed out.
28     *        *        *     Request timed out.
29     *        *        *     Request timed out.
30     *        *        *     Request timed out.

race complete.

:\wamp\bin\apache\apache2.2.8\bin>

Comments (3)

bit of bash script to remove files from a dir when they are 30 minutes old

Problem

(paraphrased/untested) : – find . -type f -mtime xx -exec rm {}\;
doesn’t always have a high enough resolution when you want to remove a file
that is seconds or minutes old.

In my application, I have “guest writers” who preview their web content
before submitting for review. I don’t want web robots to index this content
(so will have a meta in the html to that effect anyway) and I don’t want
nosy readers of my sites to be familiar with tmp files which are under the
wwwroot so they can read stuff that has yet to be approved AND also I want to
do good housekeeping and remove tmp content fairly quickly.
I could use a “staging” web server, after they author presses the
preview button, a temp web page is rendered. I can delete this page within
seconds of it being viewed – this is fine.

Solution

The following code will be run in cron, maybe every half an hour

Where

time resolution is in seconds thus the division by 60 to get minutes
bash does not do natively division hence the pipe to bc
the file is the modify time

#!/bin/bash
#  echo  " (`date +%s` -  `stat -c %Z 12345`) / 60"   | bc -l

for i in `ls -b $FILEPATH`;
do

   U=$(( (`date +%s` - `stat -c %Z $i`) / 60 | bc -l ))

   if [ $U -gt 30 ]; then
     echo "$i is too old - will delete $U"
#    insert the DANGEROUS bit here
   else
     echo "too young - will not delete $U";
#    no dangerous bit here
   fi

done

Leave a Comment

AIX TL and hardware (Documentum 5.3 friendly)

IBM Technology levels are obtained by using

oslevel

with no params tells you the version of AIX.  (For Documentum it should be at least 5.2 currently).

oslevel -q -s

Will give a lengthy list of service packs and the technology level.

Example:

$ oslevel -q -s
Known Service Packs
——————-
5300-07-04-0818
5300-07-03-0811
5300-07-02-0806
5300-07-01-0748
5300-06-07-0818
5300-06-06-0811
5300-06-05-0806
5300-06-04-0748
5300-06-03-0732
5300-06-02-0727
5300-06-01-0722
5300-06-01-0000
5300-06-00-0000
5300-05-CSP-0000
5300-05-06-0000
5300-05-05-0000
5300-05-04-0000
5300-05-03-0000
5300-05-02-0000
5300-05-01-0000
5300-04-CSP-0000
5300-04-03-0000
5300-04-02-0000
5300-04-01-0000
5300-03-CSP-0000

$ oslevel -s
5300-06-07-0818

Which is AIX 5.3 TL6 SP7

Systems running Documentum include

$ oslevel  -s
5300-06-00-0000

Which is AIX 5.3 TL6  No SP
prtconf

will tell you the cpu, network and other information. Abbreviated example below:

$ prtconf
System Model: IBM,9117-570
Machine Serial Number: 65045F0
Processor Type: PowerPC_POWER5
Number Of Processors: 2
Processor Clock Speed: 1900 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
LPAR Info: 5 manch0010
Memory Size: 4096 MB
Good Memory Size: 4096 MB
Platform Firmware level: Not Available
Firmware Version: IBM,SF240_320
Console Login: enable
Auto Restart: true
Full Core: false

At time of writing it is believed (by me) TL05 is out of support from IBM.

Leave a Comment

get logs from servers using ftp script

Reminder to self how to use automatic ftp scripts.

Useful when you have lots of logs to fetch down from lots of fti or content server.
Replace dmadmin and <password> and servername accordingly.

batch file (content server):

mkdir -p c:\logs_all_systems\server0006\install
mkdir -p c:\logs_all_systems\server0006\product\5.3\install
ftp -i -s:server0006.scr

(fti):

mkdir -p c:\logs_all_systems\server0021\install
ftp -i -s:server0021.scr

where -i is to ignore manual requests for responses from server

script file (servernnnn.scr) for content server:

open server0006.domain.net
dmadmin
<password>
bin
cd /app/documentum/dmadmin/
lcd c:\logs_all_systems\server0006
get install.log
lcd c:\logs_all_systems\server0006\install
cd /app/documentum/dmadmin/install
mget dmadmin*

cd /app/documentum/dmadmin/product/5.3/install
lcd c:\logs_all_systems\server0006\product\5.3\install
mget dmadmin*
quit

fti:

open server0021.domain.net
dmadmin
<password>
bin
lcd c:\logs_all_systems\server0021\install
cd /app/documentum/dmadmin/install
mget dmadmin*
quit

Leave a Comment

dm_check_password – unix command line syntax example

To check dm_check_password on unix (thanks Dave R)

$ dm_check_password -p <nnn.nnn.nnn.nnn> -b <nnn.nnn.nnn.nnn> -d <DOMAIN>
“copyright info”
Enter user name: <windowsuser>
Enter user password:
Enter user extra #1 (not used):
“additional info”
Enter user extra #2 (not used):

dm_check_password: Result = (0) = (DM_EXT_APP_SUCCESS)

Leave a Comment

Find (not) by user and group

More find stuff (thanks for the tips JC)
find /mydir ! -user dmadmin ! -group dmgroup
find /mydir -type f ! -user dmadmin ! -group dmgroup

Leave a Comment

Change root password on Leopard

Root password not set by default for root user.
Login an as normal user which should be a sudo user:

my-macbook:~ mymacbook $ sudo su
Password:
sh-3.2# passwd root
Changing password for root.
New password:
Retype new password:
sh-3.2#

Commit password to memory!

Leave a Comment

Create ISO image of DVD using dd command

dd – convert and copy a file
See man pages for explanation

Create copy of DVD to ISO:

[root@killer media]# dd if=/dev/dvd of=winxp.iso

Create a blank disk image:
dd if=/dev/zero of=/home/disk.img bs=1M count=4096

Leave a Comment

Error reporting in aix

 errpt -a | more

       -a
            Displays information about errors in the error log file in detailed format. If used in conjunction with the -t flag, all the information from the template
            file is displayed.

See man pages for the other flags.

Leave a Comment

Linux (Centos) Adding password by updating /etc/passwd

Probably better to use the admin tools or adduser, however

Process, backup 2 files: /etc/passwd and /etc/shadow
(Shadowing has been enabled by default since last century)
Add user to /etc/passwd
rm /etc/shadow
mkdir home for new user (and set owner/group)
execute /usr/sbin/pwconv
passwd newuser
do same for groups

Leave a Comment

Older Posts »