Thursday, April 2, 2009

How to check the madwifi driver version

I recommend two approaches to doing this -

1. Check the version while the driver loads through logging in
the kernel ring buffer. If you missed that and find it difficult
to track the ring buffer do the following -
a. Clear the kernel ring buffer -
$> dmesg -c


b. Remove and reload the driver -
$> modprobe -r ath_pci; modprobe ath_pci


c. Check the kernel buffer for the version
$> dmesg
....
ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
wlan: 0.8.4.2 (0.9.3.1)
ath_pci: 0.9.4.5 (0.9.3.1)
ACPI: PCI Interrupt 0000:00:0a.0[A] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
ath_rate_sample: 1.2 (0.9.3.1)
....

Shows the driver versionas 0.9.4 or whatever is your version.


2. Another approach is by locating the installed kernel module
ath_pci. Go to the directory /lib/module/kernel-version/ run the following command at this path to check the
version -
$> strings ath_pci.ko | grep version

You should see something like the following on your screen -
EEPROM version invalid
version=0.9.3.1
srcversion=7E85FB5DC8AA00A7F8867D8

Monday, March 30, 2009

Can't add venet0 to bridge

You may encounter this if you are considering bridging a point
to point device. This happens when the P2P device is not a
standard ethernet device. I have encountered this problem
while trying to bridge the wired interface eth0 with the
venet0 interface to the VPSes in an OpenVZ environment.
As of the kernel version 2.6.18-openvz-18-51.3d2-486
this feature is not available.

Command line image manipulation linux

Command line image editing is possible by the use of a
linux tool named- convert.
This tool is capable of
converting between image formats as well
as resize an image, blur, crop, despeckle, dither, draw on, flip,
join, re-sample, and much more.

What is the difference between resource reference and resource injection in EJB 3.0 ?

The Resource references and Resource injection are used to describe the process, "Dependency injection". But they differ as,

Resource Reference  
1) It uses annotation to reference objects that the container has access to but are not necessarily directly associated with EJB. 
2) The resource could be a Database, a JMS destination such as queue or topic, or a timer service.
3) Example, "@Resource" annotation is used to indicate resource reference.
4) Sample Code  
  @Resource(name=”jdbc/OracleDS”, resourceType=”javax.sql.DataSource”)  
   
Resource Injection

1) It uses other annotations to inject references to objects directly related to EJB.
2) EJB specific data.
3) Examples include "@EJB" and "@PersistenceContext".
4) Sample Code
  @EJB( name=”ejb/calci”, beanInterface=Calculator.class,
  beanName=”calci”, description=”This bean is used for calculations.”)
  private Calculator calci;
 
Note:
You want to set up multiple resource references at once at the class level. Here’s a sample:
@Resources({
@Resource(name=”queue”,type=”javax.jms.Queue”)
@Resource(name=”datasource”,type=”javax.sql.DataSource.class),
})
public class Test{
...
}