Monday, May 14, 2012

Oracle select N latest entries

select * from (select * from monitor.at_process_log order by log_id desc) 
where ROWNUM <=10;
To accomplish the equivalent to MySql:
select * from sometable order by name limit 20,10
AskTom proposes:
select * from (select a.*, ROWNUM rnum from 
(select * from monitor.at_process_log order by log_id desc) a where rownum <= 20)
 where rnum >= 10;

Wednesday, May 9, 2012

Which Yum package provides this missing library?

yum whatprovides */libXext.so.6

Thursday, May 3, 2012

Install Cisco VPN 4.8.02 on Fedora 14 (2.6.35)

  1. tar xvfz vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz
  2. cd vpnclient
  3. sudo ./vpn_install
  4. You will probably get failures. If you get failures:
  5. wget http://projects.tuxx-home.at/ciscovpn/patches/vpnclient-linux-2.6.24-final.diff
  6. patch < ./vpnclient-linux-2.6.24-final.diff
  7. This step shows failures, but I don't care (*)
  8. wget http://lamnk.com/download/vpnclient-linux-4.8.02-64bit.patch
  9. patch < ./vpnclient-linux-4.8.02-64bit.patch
  10. sed -i 's/^CFLAGS/EXTRA_CFLAGS/' Makefile
  11. wget http://lamnk.com/download/vpnclient-linux-2.6.31-final.diff
  12. patch < ./vpnclient-linux-2.6.31-final.diff
  13. sudo sed -i 's/const\ struct\ net_device_ops\ \*netdev_ops;/struct\ net_device_ops\ \*netdev_ops;/' `find /usr/src -name netdevice.h`
  14. Update interceptor.c like explained in (**)
  15. sudo ./vpn_install
  16. sudo /sbin/service vpnclient_init start
  17. Create a profile like in (***) and substitute values
  18. cp *.pcf /etc/opt/cisco-vpnclient/Profiles directory
  19. vpnclient connect site-name (site-name is the same as site-name.pcf)
(*)
[jerome@monster] > patch < ./vpnclient-linux-2.6.24-final.diff
patching file GenDefs.h
Hunk #1 succeeded at 105 with fuzz 2.
Hunk #2 succeeded at 122 (offset 2 lines).
patching file interceptor.c
Hunk #3 FAILED at 111.
Hunk #4 succeeded at 142 (offset 5 lines).
Hunk #5 FAILED at 364.
Hunk #6 FAILED at 921.
Hunk #7 FAILED at 949.
4 out of 7 hunks FAILED -- saving rejects to file interceptor.c.rej
(**) Replace
static void interceptor_init(struct net_device *);
with
static
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
int
#else
int __init
#endif
interceptor_init(struct net_device *);
(***)
[main]
Description=sample user profile
Host=<x.x.x.x>
AuthType=1
GroupName=<GroupName>
GroupPwd=<GroupPwd>
EnableISPConnect=0
ISPConnectType=0
ISPConnect=
ISPCommand=
Username=<Username>
UserPassword=<UserPassword>
SaveUserPassword=1
EnableBackup=0
BackupServer=
EnableNat=1
CertStore=0
CertName=
CertPath=
CertSubjectName=
CertSerialHash=00000000000000000000000000000000
DHGroup=2
ForceKeepAlives=1