icurtain - road at night

Virgin broadband is crap - 20mb = 6mb

2008-08-14 10:52:07 digg this!


Against my better judgement I recently had Virgin's 20 mb package installed. The actual connection speed averages out about 6mb.

Customer service is a very special experience, if you are lucky enough to get connected in under 10 minutes you will then have the joy of speaking to a the rude, poorly trained staff who don't really make any effort to resolve your problems, in the knowledge you are signed up for 12 months, so you can rot!

I still havn't recieved my 'Free' wireless router.. after 2 weeks.. now that's service


PHP Get/Set Generator

2008-07-23 15:28:19 digg this!


get/set code generator for PHP - all Java development environments allow you to do this

enter comma seperated variable names: size, length, width, etc


Projects for July 2008

2008-07-13 21:06:27 digg this!


Finish ORM classes for database and XML
Work on existing systems to implement full XML output from logic classes to display classes

PHP Variable Variables..

2008-07-01 18:41:15 digg this!


$var = "value";
$value = "some value";
echo $$var;

For some insane reason PHP allows you to have variable variables.. if you ever use these you should probably be prohibited from using a computer again


Session Manager class for cookies in PHP

2008-06-27 20:15:40 digg this!


Here is a little class I've written to make handling cookie sessions a little nicer in PHP. I'm not a big fan of cookies but PHP makes a real mess of 'transparent' session ids with search engines - making it think you have infinite web pages.. so here goes

remember cookies arn't nice and create privicy issues so only use them when necessary


PHP ArrayList Class

2008-06-25 13:16:47 digg this!


PHP ArrayList Class - Having spent the last year working in Java, working with PHP now makes me cry and weep in anguish.. for many reasons, one of the main ones being its' complete inability to store more than 1 thing in anything other than an array

I have attempted to create a class that handles data in a marginally more friendly manner allowing you to interate through etc.. it's still a bit BETA but it speeds up my development times.. so here it is

With it you can while($arrayList->hasNext()){} and do all kinds of other crazy things that will bring endless listing joy to your life - mail me if you have any improvement suggestions


whois on linux

2008-06-19 07:21:08 digg this!


installing whois on a linux box

# sudo apt-get install jwhois

# yum install jwhois

or

browse to: http://packages.qa.debian.org/j/jwhois.html

find the latest version and

# wget http://ftp.debian.org/debian/pool/main/j/jwhois/jwhois_4.0.orig.tar.gz

tar xf jwhois_4.0.orig.tar.gz

# cd jwhois_4.0/

# ./configure

# make install

get your environment variables / path with:

# env
:: PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

# cd /usr/local/bin

create a symbolic link so you can call whois url

# ln -s jwhois whois

then put the link in the path

# mv whois /usr/local/bin


Firefox 3 - Http/1.1 Service Unavailable

2008-06-17 12:08:12 digg this!


Http/1.1 Service Unavailable - Mozilla's 'download' party seems to be a bit of a flop - the Microsoft moles in the marketing department really screwed them on that one ;)

search for DHCP servers on a network - dhclient

2008-06-16 09:33:26 digg this!


If you wish to search for DHCP servers on a network just type:
dhclient [interface]
and it will bring back information on all running DHCP servers on your subnet


compile kernel in gentoo

2008-06-10 08:40:34 digg this!


compile kernel in gentoo

cd /usr/src/linux/

make menuconfig

Linux Kernel v2.6.*-gentoo Configuration

make

make modules_install

cp arch/i386/boot/bzImage /boot/kernal-2.6.*-gentoo


Open Office - Unsatisfied Link Error

2008-06-09 09:55:04 digg this!


when running open office from a bootstrap routine or in headless mode for batch processing make sure the following settings to avoid an unsatisfied link error

soffice -accept="pipe,name=my_app;urp;"
java -Djava.library.path=/opt/openoffice.org/program java.app.class

useful reference on Oo: http://www.oooforum.org/forum/viewtopic.phtml?t=40263


PHP Luhn Checker - validates credit cards etc

2008-06-09 06:41:30 digg this!


This section of code validates a credit card or any other luhn number - useful as an initial card number check for merchant interfaces etc

function luhnCheck($number){

$sum = 0;
$alt = false;

for($i = strlen($number) - 1; $i >= 0; $i--)
{
$n = substr($number, $i, 1);
if($alt){
//square n
$n *= 2;
if($n > 9) {
//calculate remainder
$n = ($n % 10) +1;
}
}
$sum += $n;
$alt = !$alt;
}
return ($sum % 10 == 0);
}


Command Line Web Browser

2008-06-05 11:51:57 digg this!


If need to browse the world wide web and you are either running in an ssh window or you really hate the whole web 2 thing.. help is at hand

Centos
yum install lynx

Debian
apt-get intall lynx

run lynx then you can view this page like this...

icurtain - lights on the roundabout
[H] Blog IDAT205 IDAT204 IDAT203 IDAT201 AINT204 SOFT221 ISAD223 SOFT218 Linux JSF PHP Java[EE] Java[J2ME] SQL submit search for..________
Centos NFS Install

2008-06-04 11:41:15 digg this!

Download the Centos Boot image
Download the Centos DVD image and save it on an NFS enabled share on your lan

Install with Network boot CD

choose to boot: linux text

Choose Manual IPv4
192.168.1.* / 255.255.255.0
192.168.1.*
192.168.1.*

(NORMAL LINK) Use right-arrow or to activate.
Arrow keys: Up and Down to move. Right to follow a link; Left to go back.
H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list


Centos NFS Install

2008-06-04 11:41:15 digg this!


Download the Centos Boot image
Download the Centos DVD image and save it on an NFS enabled share on your lan

Install with Network boot CD

choose to boot: linux text

Choose Manual IPv4
192.168.1.* / 255.255.255.0
192.168.1.*
192.168.1.*

Choose NFS Install

Server: 192.168.1.29
Dir: /install/linux/centos/5.1

Auto install proceeds from here..


sql server - set db offline

2008-05-30 06:14:34 digg this!


if you can't track down all the life connections and you need to force changes:

use master
alter database db_name set offline with rollback immediate


java - find a number in a string

2008-05-07 01:39:01 digg this!


Pattern p = Pattern.compile("[0-9]");

Matcher m = p.matcher("asdas12dsad");

System.out.println(m.find());


Foreign Key Constraints and Persistence Issues in Seam

2008-04-30 09:30:19 digg this!


public String persist() { //this forces the persist function to persist IbUser before Rcs User and avoids the FKC issue getEntityManager().persist(getInstance().getIbUser()); return super.persist(); }

finding values through hibernate

@Override public String persist(){ //check if the nlc is duplicated here if(getEntityManager().find(JourneyLocation.class, this.instance.getNlc())!=null){ getFacesMessages().add(FacesMessage.SEVERITY_ERROR, "#{messages.nlcExists}") ; return null; }else{ return super.persist(); } }

http://kb.mozillazine.org/Browser.cache.disk_cache_ssl

2008-04-18 04:15:53 digg this!


http://kb.mozillazine.org/Browser.cache.disk_cache_ssl

Ubuntu 7.10 with Beryl on ATI Mobility Radeon X700

2008-04-11 04:00:41 digg this!


It took a day of playing but it is possible to get Beryl running with the proprietary ATI X700 drivers at a reasonable speed under Ubuntu (on an Acer Aspire 1691wlmi)

The biggest problem is the fact that the X700 chipset along with a bunch of others are black listed by compiz in the config file and therefore the system won't even attempt to run 3d acceleration

In the compiz config file located here:

/usr/bin/compiz

you will find a whole list of black-listed hardware based on drivers and PCI ids.
remove the PCI id of your card, for the pci-e x700 it'd included on the line

T="$T 1002:3152 1002:3150 1002:5462 1002: 5653 # ati x300 x600,x600 x700"

just remove it by preceeding it with a #
after you have done that you can install the native drivers, play around with your xorg config and the card responds fairly well.

you might also consider installing the XGL server
#sudo apt-get install xserver-xgl

To disable Xgl autostart for this user, create a file named ~/.config/xserver-xgl/disable


how to rip a dvd to mpg in 7 lines of perl

2008-04-01 09:55:50 digg this!


#!/usr/bin/perl -w
# 531-byte qrpff-fast, Keith Winstein and Marc Horowitz
# MPEG 2 PS VOB file on stdin -> descrambled output on stdout
# arguments: title key bytes in least to most-significant order
$_='while(read+STDIN,$_,2048){$a=29;$b=73;$c=142;$t=255;@t=map{$_%16or$t^=$c^=(
$m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t^=(72,@z=(64,72,$a^=12*($_%16
-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271);if((@a=unx"C*",$_)[20]&48){$h
=5;$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$
d=unxV,xb25,$_;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=$t&($d>>12^$d>>4^
$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9,$_=$t[$_]^
(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval

SQL - Composite Primary Keys

2008-03-19 04:02:13 digg this!


http://weblogs.sqlteam.com/jeffs/archive/2007/08/23/composite_primary_keys.aspx

Vista Style Buttons CSS

2008-03-11 10:47:08 digg this!


Resizable Vista style buttons with a gradient in XHTML/CSS

As I had to spend an entire afternoon trying to get these to work I might as well post them

To get your lovely Vista Style buttons just screen shot Vista or make a rectangle with 2 gradients that meet.. then add a boarder and blend the corner pixels onto whatever backdrop you want to put them on.

Vista Button CSS

.buttonLeft {
background-image: url(button-right.gif);
background-repeat: no-repeat;
background-position: top right;
display:block;
float:left;
/*external border spacing*/
margin:4px;
}

.buttonRight {
background-image: url(button-left.gif);
background-repeat: no-repeat;
background-position: top left;
display:block;
}

.buttonCentre{
/*line-height pushes the display block to the full height of the containing image*/
line-height:26px;
/*Inner boarders*/
margin-left:4px;
margin-right:4px;
background-image: url(button-centre.gif);
background-repeat: repeat-x ;
background-position: top left;
display:block;
}

span.buttonCentre:hover{
background: url(button-centre-hover.gif) ;
}
span.buttonLeft:hover {
background-image: url(button-right-hover.gif);
}
span.buttonRight:hover {
background-image: url(button-left-hover.gif);
}

And then all you have to do is make a few containing spans and you have your buttons

<span class="buttonLeft">
<span class="buttonRight">
<span class="buttonCentre">
buttonText
</span>
</span>
</span>

like this: buttonText

To conclude - these buttons are infinitely horizontally resizable and do display properly - however the hover does not work perfectly, if you hit the outer nested elements they will hover without making the internal elements hover..


Automatic Zimbra Backup

2008-03-10 05:37:00 digg this!


If you are backing up Zimbra to a remote NFS file system then you should probably mount it in the fstab r the init.d - bear in mind that if the remote box cannot be found on boot or shutdown the machine will hang for ages before it times out.

#mounts remote file system #init.d
mount remoteBox:/email/backup /mnt/emailbackup/
#fstab
remoteBox:/email/backup /mnt/emailbackup/ nfs rw,intr,bg 0 0

Zimbra's own script
#!/bin/bash
export time=`date +%Y-%m-%d_%H-%M-%S`
export backup_dir=/var/spool/zimbra/backup
export backup_file=$backup_dir/zimbra$time.tar.gz
export zimbra_dir=/opt/zimbra
mkdir -p $backup_dir
su zimbra --command="/opt/zimbra/bin/zmcontrol stop"
tar -czvf $backup_file $zimbra_dir
su zimbra --command="/opt/zimbra/bin/zmcontrol start"

Zimbra Backup Script

Put this in /etc/cron.daily

#!/bin/sh
#deletes all files from remot drive older than 7 days
find /mnt/emailbackup/ -maxdepth 1 -ctime +7 -daystart -exec rm "{}" \;

#run back up
/opt/zimbra/bin/zmfullbackup > /var/spool/zimbra/backup/backup.log

#move back up to remote drive
mv /var/spool/zimbra/backup/* /mnt/emailbackup


BBC World Stream

2008-03-09 17:40:42 digg this!


Click for BBC World Stream

Useful Regex for CSV to SQL

2008-03-07 10:30:51 digg this!


As a point of reference

how to convert a comma delimited file to an SQL insert
Assuming your data is the following

'key','value','0'
'key','value','1'

In notepad++ the syntax for search and replace would be as follows:
search: ('[^']+','[^']+','[^']+')
replace: (\1)
syntax varies depending on the flavour of regex

which can then have an insert statement added and...:
insert into table (key_value, value_blah, personal_id)
values
('key','value','0')
('key','value','1')

deleteing columns in Textpad
INSERT INTO "IB_RESOURCE_MESSAGE" (IB_MESSAGE_ID,IB_VALUE,IB_KEY,IB_BUNDLE_ID) VALUES (0,'Welcome #{identity.username}','loginSucceeded',0)

to delete the first value column (1, .... use the following
([0-9]+,
the plus will search for recurring instances of the pattern [0-9]


EJB3 EntityManager Find

2008-03-06 06:12:18 digg this!


@In("myEntityManager")
private EntityManager em;

...

MyObject myObject = em.find(MyObject.class, myObjectPrimaryKey);


java.sql.SQLException: User not found: SA [SOLVED]

2008-03-05 03:12:52 digg this!


WARN [org.jboss.system.ServiceController] Problem starting service jboss:service=Hypersonic,database=localDB
java.sql.SQLException: User not found: SA

It's possible that your jboss deployment has gone a bit squiffy.. try deleting the following:
jboss/server/default/tmp
jboss/server/default/data
jboss/server/default/work


Mulitple OR conditions in SQL

2008-02-26 06:08:58 digg this!


based on

ORDER_TRANSACTION
__________
1|ORDER__|
2|CREDIT__|
3|REFUND_|
4|PAYMENT|

Instead of the following:

SELECT
ot
FROM
OrderTransaction
AS
ot
WHERE
ot.transactionType.transactionTypeDesc = 'Credit'
OR
ot.transactionType.transactionTypeDesc = 'Refund'
OR
ot.transactionType.transactionTypeDesc = 'Payment'

you could use:

SELECT
ot
FROM
OrderTransaction
AS
ot
WHERE
ot.transactionType.transactionTypeDesc IN ('Credit','Refund','Payment')

or:

SELECT
ot
FROM
OrderTransaction
AS
ot
WHERE
ot.transactionType.transactionTypeDesc NOT IN ('Order')


Borders Voucher - Valid till Feb 29th 2008

2008-02-16 08:55:07 digg this!


Borders Voucher - Valid till Feb 29th 2008

Exception creating identity: domainName

2008-02-13 09:17:52 digg this!


caused by: java.lang.RuntimeException: Exception creating identity: domainName

Solution

your computer can't find itself

go to:

etc/hosts
make sure the loopback address refers to the name of the box you are running on ie
127.0.0.1 documentationServerBox localhost.localdomain localhost

for other information on linux network configs look at the redhat linux network guide


Seam - Database Image to Screen Output

2008-02-01 03:51:30 digg this!


front end

a4j:mediaOutput id = "telephone" element = "img" mimeTye = "image/png"
createContent = "#{imagePainter.drawImage}"
value="#{object.instance.objectId}"

in this code the object id is handed to the drawImage funtion - this function then looks up the record and populates et which has a byteArray stored on it - it then writes this out to the screen using a file output writer

back end

@Name("imagePainter")

public class ImagePainter {


@In("midasEntityManager")
private EntityManager em;


public void drawImage (OutputStream output, Object emblemTemplateId) throws IOException{


Object et = em.find(Object.class, objectId);

ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(et.byteArrayData());

FileUtilities.write(byteArrayInputStream, output, 1024);

}

/* private List getEmblemTypeById(String queryString, String emblemTypeId) { List reportSet = new ArrayList(); Query emblemQuery = em.createNamedQuery(queryString); emblemQuery.setParameter("emblemTypeId", emblemTypeId); reportSet = (List)emblemQuery.getResultList(); return reportSet; }*/

}

public static void write(InputStream input, OutputStream output, int bufferSize) throws IOException {
byte[] buffer = new byte[bufferSize] ;
int readSize = -1 ;
while ( (readSize = input.read(buffer)) != -1) {
output.write(buffer, 0, readSize);
output.flush();
}
try {
input.close();
} finally {
output.close();
}
}


Cannot insert explicit value for identity column

2008-01-28 03:58:53 digg this!


ERROR [org.hibernate.util.JDBCExceptionReporter] Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to OFF.

ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session

org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

Solution

Annotate the function in the bean with the following:

@GeneratedValue(strategy=GenerationType.AUTO)


French Financial Crisis - Jerome Kerviel

2008-01-25 10:15:04 digg this!


Friends of rogue trader Jerome Kerviel last night blamed his $7 billion losses on unbearable levels of stress brought on by a punishing 30 hour week.

Kerviel hid his November losses in a batch of wonderfully fresh croissant. Kerviel was known to start work as early as nine in the morning and still be at his desk at five or even five-thirty, often with just an hour and a half for lunch.

One colleague said: "He was, how you say, une workaholique. I have a family and a mistress so I would leave the office at around 2pm at the latest, if I wasn't on strike.

But Jerome was tied to that desk. One day I came back to the office at 3pm because I had forgotten my stupid little hat and there he was, fast asleep on the photocopier.

At first I assumed he had been having sex with it, but then I remembered he had been working for almost six hours."

As the losses mounted, Kerviel tried to conceal his bad trades by covering them with an intense red wine sauce, later switching to delicate pastry horns.

At one point he managed to dispose of dozens of transactions by hiding them inside vol-au-vent cases and staging a fake reception.

Last night a spokesman for Sócíété Générálé denied that Kerviel was over worked, insisting he lost the money after betting that the French were about to stop being rude, lazy, arrogant bastards.


ejb ql

2008-01-17 05:20:25 digg this!


SELECT SUM(p.orderTransaction.transAmount) FROM Payment AS p JOIN p.memberPaymentMethod AS mpm JOIN mpm.paymentMethod AS pm JOIN p.orderTransaction AS ot WHERE ot.currency.currencyCode = 'GBP' AND mpm.creationDate >= '01/01/2008' AND mpm.creationDate <= '01/07/2009' AND (p.authorisationCode IS NOT NULL OR pm.paymentMethodId NOT IN (8,4))

EJB QL Query Example

2008-01-16 10:58:55 digg this!


SELECT SUM(p.orderTransaction.transAmount) FROM Payment AS p JOIN p.memberPaymentMethod AS mpm JOIN mpm.paymentMethod AS pm JOIN p.orderTransaction as ot WHERE ot.currency.currencyCode = 'GBP' AND mpm.creationDate >= '01/01/2008' AND mpm.creationDate <= '01/07/2009' AND (p.authorisationCode IS NOT NULL OR pm.paymentMethodId NOT IN (8,4))

Object Relational Mapping in PHP

2008-01-15 03:39:44 digg this!


http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#PHP


Gateway on Centos

2008-01-10 09:33:02 digg this!


How to change your gateway in Centos

temporary change:

route del default gw 192.168.1.1

route add default gw 192.168.0.1

pemanent change

cd /etc/sysconfig/

nano network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=centosBox
GATEWAY=192.168.0.1


Changing CVS file permissions with chown

2007-12-13 04:08:44 digg this!


If someone has added something to CVS with incorrect permissions (ie. their own username instead of cvs) then you can do the following


Set Date Linux

2007-12-12 04:09:16 digg this!


Setting the date in linux

# date 121210312007

in the format - DDMMhhmmYYYY

# date

returns: Wed Dec 12 10:31:00 GMT 2007

type to commit to the hardware clock

# hwclock --utc --systohc


Find Files Linux

2007-12-10 03:29:19 digg this!


find [dir] -name '[name]'

# find / -name '*'


Nvidia MCP61 noapic linux network card bug

2007-12-07 10:22:21 digg this!


When using any board that utilises the Nvidia NForce 6100 (MCP61) chipset with Linux you will probably have to add the boot option of noapic as due to all the funky energy saving features on the board the chipset speed is all screwed up and Linux can't interface with any of the board management features.. that fixes the not being able to boot bug but can lead to others - with some kernel releases Linux disables IRQ11 and doesn't initialise a whole load of drivers properly.

On an Asus M2N-MX board running Centos 5.0 (kernal 2.6.18-8.el5) this can affect the network card causing it to erase all of the static settings and boot with DHCP every time you reboot

NForce APIC FIX

Upgrade to Centos 5.1 (kernel 2.6.18-53.el5PAE) which will boot with noapic enabled and initiate the network card correctly keeping the static settings or... apparently you can go into your bios and turn off all the power saving settings and then set static values for the memory speeds etc which might just make Linux boot with APIC enabled - but sounds like way too much hassle

You can get your current linux version by typing either of the following:


SecPay Enumerated Type

2007-12-07 07:30:03 digg this!


public enum SecpayErrorType {

authorised ("Transaction authorised by bank. auth_code available as bank reference"),

notAuthorised ("Transaction not authorised. Failure message text available to merchant"),

commsProblem ("Communication problem. Trying again later may well work"),

fraud ("The SECPay system has detected a fraud condition and rejected the transaction. The message field will contain more details."),

amountInvalid ("Pre-bank checks. Amount not supplied or invalid"),

insufficientParams ("Pre-bank checks. Not all mandatory parameters supplied"),

paymentRepresented ("Pre-bank checks. Same payment presented twice"),

startInvalid ("Pre-bank checks. Start date invalid"),

expireInvalid ("Pre-bank checks. Expiry date invalid"),

issueInvalid ("Pre-bank checks. Issue number invalid"),

LUHNFailed ("Pre-bank checks. Card number fails LUHN check"),

cardTypeInvalid ("Pre-bank checks. Card type invalid - i.e. does not match card number prefix"),

nameInvalid ("Pre-bank checks. Customer name not supplied"),

merchantInvalid ("Pre-bank checks. Merchant does not exist or not registered yet"),

merchantAccountCardTypeInvalid ("Pre-bank checks. Merchant account for card type does not exist"),

merchardAccountCurrencyTypeInvalid ("Pre-bank checks. Merchant account for this currency does not exist"),

CVV2Invalid ("Pre-bank checks. CVV2 security code mandatory and not supplied / invalid"),

timeOut ("Pre-bank checks. Transaction timed out awaiting a virtual circuit. Merchant may not have enough virtual circuits for the volume of business."),

noMD5 ("Pre-bank checks. No MD5 hash / token key set up against account");

private final String description; // constructor

SecpayErrorType(String description) {

this.description = description;

}

public String getDescription(){

Runnable r = new Runnable() {

public void run(){

}

};

Runnable s = new MyRunnable();

return description;

}

private class MyRunnable implements Runnable {

public void run(){

}

}

}


Open Source Solutions

2007-12-05 07:53:34 digg this!


Open source alternatives for common desktop tasks in Windows and Linux

CD Burning Software
InfraRecorder
Archiving and Compression
7-Zip
Desktop Publishing
Scribus
FTP Client
Filezilla
Image Editing
Gimp
Image Editing
InkScape
Office
Open Office
PDF Printer
PDFCreator
Media Player
VLC Player
Text/Source Editor
Notepad ++
Linux - Windows RDP client
rdesktop
Everything for free..
Ubuntu Linux

Enable Auto-Start SSH Redhat

2007-12-04 13:57:12 digg this!


chkconfig --add sshd

chkconfig --level 35 sshd on

/etc/rc.d/init.d/sshd start (just to start it up now)


Tag Library Descriptor - TLD files for Java Editors

2007-12-04 03:51:52 digg this!


xmlns:s="http://jboss.com/products/seam/taglib"
seam-ui.tld
xmlns:ui="http://java.sun.com/jsf/facelets"
jsf-ui.tld
xmlns:f="http://java.sun.com/jsf/core"
myfaces_core.tld
xmlns:h="http://java.sun.com/jsf/html"
myfaces_html.tld
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
rich.tld
xmls:a4j="https://ajax4jsf.dev.java.net/ajax"
a4j.tld

Java For Loop

2007-12-03 09:15:55 digg this!


for (OrderTransaction orderTransaction : secPayResultList) {

for(Payment payment : orderTransaction.getPayments()){

if(PaymentMethodType.CARD.equals(payment.getMemberPaymentMethod().getPaymentMethod().getType())){

//do a transaction in here

ValidateTransactionResult validateTransactionResult = doSecPayTransaction(payment.getReference());

if (validateTransactionResult.getValid() != true) { FacesMessages.instance().add("TransactionResult: " + validateTransactionResult.getMessage()) ;

}

}

}

}


Linux Start Up

2007-12-03 09:03:31 digg this!


/etc/rc.* contains symbolic links to all start up scripts

cnnet.hk scam

2007-12-03 06:33:53 digg this!


If you receive email from cnnet.hk purporting to be from the main domain name registrar in China be very sceptical. China's main registrar is http://www.cnnic.net.cn/ and this company appears to be some sort of dodgy scam set up to obtain private information.

Here is an example of an email received from cnnet:

Dear Manager,

We are China Net Technology Limited, which is the domain name register center in China.I have something need to confirm with you.

we have received an application formally,one company named "Worldpro Investment Limited" applies for the domain names( ...biz\....cn\....com.cn\....net.cn\....tw\....com.tw\....hk\....mobi etc.) and the internet Brand Name(...)on the internet Dec 3. 2007. We need to know the opinion of your company, because the domain names and keywords may relate to the usufruct of brand name on internet.

we would like to get the affirmation of your company,please contact us by telephone or email as soon as possible. Please let someone in your company who is responsible for trademark or intellectual right contact me freely.

Best Regards,

Angor Huang

Sponsoring Registrar:
China Net Technology Limited.
Tel:+(852)3075 9838
Fax:+(852)3177 1520
Email: angor.huang@cnnet.hk
Website: www.cnnet.hk

WHOIS INFORMATION:

Domain Name: CNNET.HK
Contract Version: HKDNR latest version

Registrant Contact Information:

Company English Name (It should be the same as the registered/corporation name on your
Business Register Certificate or relevant documents): LIZHONGWANG
Company Chinese name:
Address: XIANGGANG HONG KONG 519000
Country: CN
Email: domain@now.net.cn
Domain Name Commencement Date: 08-11-2007
Expiry Date: 08-11-2008
Re-registration Status: Complete
Name of Registrar: HKDNR

Administrative Contact Information:

First name: LIZHONGWANG
Last name: LIZHONGWANG
Company name: LIZHONGWANG
Address: XIANGGANG HONG KONG 519000
Country: CN
Phone: +852--30593010
Fax: +852--30593010
Email: domain@now.net.cn
Account Name: HK1997032T

Technical Contact Information:

First name: LIZHONGWANG
Last name: LIZHONGWANG
Company name: LIZHONGWANG
Address: XIANGGANG HONG KONG 519000
Country: CN
Phone: +852--30593010
Fax: +852--30593010
Email: info@netinchina.org.cn

Name Servers Information:

NS7.01ISP.COM
NS8.01ISP.NET


Setting up JBOSS Seam

2007-11-30 04:26:10 digg this!


from a command prompt/shell within the jboss-seam directory type the following:

seam new-project

seam generate-entities


Telediscount TOPUP

2007-11-26 17:16:24 digg this!


Telediscount TOPUP is a complete fraud.. they take your money for the text and then don't give you any minutes - you'll also be happy to know that there is no way to contact any one regarding it when you have problems.

RHEL (redhat) Install Manager

2007-11-26 04:36:06 digg this!


install package: yum -y install application_name

(gentoo/ubunto)get package: apt-get application_name


seam back end code references

2007-11-23 04:03:50 digg this!


@Name sets the front end reference point to the entity bean

@Name("userList")
public class UserList extends EntityQuery {

User user = new User();

public User getUser(){
return user;
}

}

Front end the references it via

#{userList.user}


Midas-Iflow CVS

2007-11-22 08:01:26 digg this!


Check out as a project configure using the new project wizard
_> Head
-> java
-> java project

iFlow

libs - add all
order & export - select all


Midas
projects - add iflow

JSF RichFaces - Get Page Name

2007-11-19 08:04:44 digg this!


to get the page ID of the current page = #{facesContext.viewRoot.viewId}


drop-down box in RichFaces

2007-10-30 06:49:50 digg this!



linux free drive-space command

2007-10-22 11:48:49 digg this!


df (disk free)

A, MX Record and Cname

2007-10-22 04:02:34 digg this!


www, @, * - A Record 205.178.189.131

MX Record mail.sub-domain.co.uk PRI 10

CName Alias - for subdomains


references and grouped searches in textpad regex

2007-10-16 03:40:48 digg this!


when you group searches in the textpad regex editor you have to escape the grouping brackets with a backslash otherwise it searches them as literal characters

for example:
\([0-9]\) will search for any number 0-9
but if you omit the the escape slash it will look for (1) for example


Rebellious Rainbow - mixed by Sah

2007-10-10 03:39:32 digg this!


Rebellious Rainbow - mixed by Sah is quite simply the best ragga jungle mix ever!!!

1. Soundmurderer - Stick Up (Quick Mix)

2. Istari Lasterfahrer - Teach Dem

3. Bong Ra - Rise Above

4. Krumble - Gasoline Serious Blast

5. Sixteenarmedjack & Thermador - Soundwar

6. Istari Lasterfahrer - Living In Concrete

7. General Malice - Manahbadman

8. Shitmat - Amen Babylon

9. General Malice - Infiltrate Dem Bumbaclot

10. Kgbkid - Sublimelion

11. Sah - Snoop Battybwoy (Dub)

12. Soundmurderer & SK1 - Tel'embodanustyle

13. Bong Ra - Bumbaclaat

14. Soundmurderer & SK1 - Call Da Police

15. 0=0 - Soda 411

16. FFF - Nun Inna Dat

17. Soundmurderer - Hardly Explained


Code Wank

2007-10-05 05:58:54 digg this!


code /ko?d/ [kohd] noun, verb, cod·ed, cod·ing.
wank /wæ?k/ [wangk] Chiefly British and Australian Slang: Vulgar

Code Wank - Definition: Creating code that does not relate to the core purpose of a project. Basically wanking around with peripheral tasks
- source. Dave Fleming


reg-ex

2007-10-03 12:09:17 digg this!


]+>

open ports in firewall etc

2007-09-25 09:38:52 digg this!


chown munin:munin /usr/share/munin/plugins*

chmod 0755 /usr/share/munin/plugins*

ln -s --target-directory=/etc/munin/plugins /usr/share/munin/plugins*

iptables -I RH-Firewall-1-INPUT -m state --state NEW -p tcp --destination-port 55 -j ACCEPT

iptables -nvL


Offcom Review of ITV news

2007-09-25 05:28:10 digg this!


Dear Mike

Many thanks for your email.

Ofcom is currently reviewing the provision of public service
broadcasting in the UK, and we will certainly take your views into
consideration throughout that review. I will also ensure that you are
sent a link to our initial report which will be published in Spring
2008, on which we would welcome your thoughts.

Best wishes
Rhona


:: Rhona Parry
Strategy Analyst
020 7981 3744
****@ofcom.org.uk

:: Ofcom
Riverside House
2a Southwark Bridge Road
London SE1 9HA
www.ofcom.org.uk



-----Original Message-----
From: mike [mailto:****@bluemedia.co.uk]
Sent: 19 September 2007 3:06 PM
To: PSBReview
Cc: ****@bluemedia.co.uk
Subject: Save ITV Local News?

I have always considered ITV to be the "welfare channel" - aimed
primarily at those so financially and socially disenfranchised that they
have no option but to watch the putrid low-brow filth that it airs. I
don't care about ITV or ITV local news and would love to see it
scrapped.. along with everything produced by Sky and BBC1.

Regards,
Mike

--
http://www.bluemedia.co.uk


Samba System Share

2007-09-20 08:31:28 digg this!


cd /etc/samba/
nano samba.conf

# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
security = SHARE

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
dns proxy = no
guest ok = yes
guest account = root

[filesystem]
path = /
guest ok = yes
writeable = yes
create mask = 0777


Message file sp1.msb not found - solution

2007-09-17 11:18:22 digg this!


export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/


SSH on Ubuntu

2007-09-17 05:52:22 digg this!


to install SSH on ubuntu type:
sudo apt-get install openssh-server


make mod_jk in Debian Sarge

2007-09-14 12:35:19 digg this!


under debian enter the following command to make sure your compiler environment is working

set up your environment with
apt-get install libtool autoconf gcc apache2-prefork-dev
great.. now we are ready to compile

copy the tomcat source native directory over to the server and from within native/ run the following

make sure the support dir is sitting at the same level

./configure --with-apxs=/usr/bin/apxs2
make
make install

then after all that

Libraries have been installed in:
/usr/lib/apache2/modules

Or download a precomiled binary from http://mirror.public-internet.co.uk/ftp/apache/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.26/i386/


Debian Java/Tomcat Configuration on Sarge

2007-09-14 11:04:21 digg this!


Following on from the previous article Java should now be located in

/usr/lib/j2re1.6-sun/bin

You will have to set up

JAVA_HOME and JRE_HOME

these can be set in

/etc/environment

add the lines

JAVA_HOME = "/usr/lib/j2re1.6-sun"
export JAVA_HOME

CATALINA_HOME= "/opt/Tomcat5.5/"
export CATALINA_HOME

or from the command line

export JAVA_HOME=/usr/lib/j2re1.6-sun/

etc.

first we have to build mod_jk for our environment

refer to my other article on building mod_jk

put mod_jk.so into /etc/apache2/mods-available or wherever else you want and then refer to it in the apache conf stick this in your httpd.conf # Load mod_jk module # Specify the filename of the mod_jk lib LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so then restart apache ./ /etc/init.d/apache2 restart

Debian Java Install on Sarge [fragment]

2007-09-14 10:25:34 digg this!


I dont have a clue what im doing with Debian so im sticking it all here in no particular order

for sarge:

add to etc/apt/sources.list

deb http://oss.oracle.com/debian unstable main non-free
deb http://ftp.sunet.se/pub/os/Linux/distributions/debian-multimedia sarge main
deb ftp://ftp.sunet.se/pub/os/Linux/distributions/debian-multimedia sarge main

then type apt-get update

installing java:

apt-get install java-package

gcc errors?
apt-get gcc install

download your JRE/JDK.bin to the director in which you are working then as a USER NOT ROOT (adduser blah - then follow prompts) type:

fakeroot make-jpkg jre-1_5_0_06-linux-i586.bin

or whatever ur bin is called.. if this bitches out with a module not found error your version of java-package is probably prior to 0.25 - you can check this by typing:

apt-cache policy java-package | head -2

at this stage you can try to find an up to date repository or you can just download a version of java-package higher than 0.24 and stick it in the directory then type:

dpkg -i java-package.deb

this might complain about unzip and soundlib.. to resolve this type:

apt-get -f install

this will resolve your dependency issues

now you should have a combiled JRE....deb sitting in your directory - if you dont then type

fakeroot make-jpkg jre-1_5_0_06-linux-i586.bin

ok.. so far

now we have the .deb file you should just be able to type

dpkg -i jre-1_5_0_06-linux-i586.deb

and Java will be installed

type

java -version

to varify this


Tomcat Installation and Setup on Windows

2007-09-13 09:53:30