Monday, January 25, 2010

Oracle dbca press finish nothing happens

If you press finish at the end of database creation of dbca and nothing happens, it is (in my case) an X problem. What I did was not to use the X server on windows instead I installed X11 on linux and used that one and it went smoothly.

Saturday, January 23, 2010

Sunday, January 03, 2010

Linksys WAP54GS to act as router with dd-wrt

to make WAP54GS a router
1. Install dd-wrt
2. change the assignment of WAN port from vlan1 to vlan0
3. TADA!!!!!

/etc/sysconfig/desktop

/etc/sysconfig/desktop to choose the window manager permanently

Friday, January 01, 2010

vmware change MAC

in the virtual machine (config) vmx file:

# ethernet0.addressType = "generated"
# RANGE ALLOWED: 00:50:56:00:00:00-00:50:56:3F:FF:FF
ethernet0.addressType = "static"
# ethernet0.generatedAddress = "00:0c:29:94:43:71"
ethernet0.Address = "00:0c:29:94:43:70"

Wednesday, December 09, 2009

rsync without SSH

rsync -av rsync://server/rsync_share_name

Monday, November 30, 2009

slow sendmail startup

When sendmail is slow at startup do either of these things in /etc/hosts
127.0.0.1 localhost.localname machinename

or

192.168.1.100 machinename.domainname

if you have only machinename sendmail will be slow

Friday, October 23, 2009

firefox download flash

do a about:cache?device=disk and search for the URL or filename


many thanks to
http://labnol.blogspot.com/2005/11/save-flash-from-firefox-and-ie.html

Wednesday, October 21, 2009

MYSQL grant REMEBER 'user'@'server'

REMEMBER THIS:
grant all on DB1 to 'user'@'localhost' identified by 'password';

putty connect to session instead of server from command line

to make putty connect to session (based on the name of the session) instead of server from command line DO:

putty @SESSION_NAME

putty default font permanent

To change the default font in putty change the font settings in the Default Settings in the main window

Thursday, October 15, 2009

linux upgrade problem

If you get something like "there are multiple partitions labelled /, they must be unique" simply use remove the label by:

tune2fs /dev/sda2 -L ''

# HOORAY

Sunday, October 11, 2009

error reading information on service keytable: No such file or directory

if you get
error reading information on service keytable: No such file or directory
error: %trigger(kbd-1.08-10.2.i386) scriptlet failed, exit status 1

rpm -e kbd-1.08-10.2 --noscripts

Grub set default boot option just once

echo "savedefault --default=1 --once" | grub --batch
reboot

Remote upgrade linux RHEL redhat 3 to 4

1. mount the installation cd and copy vmlinuz and initrd.img to /boot renaming them to vmlinuz_remote and initrd_remote.img
2. vi /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda2
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Enterprise Linux AS (2.4.21-15.EL)
root (hd0,0)
kernel /vmlinuz-2.4.21-15.EL ro root=LABEL=/
initrd /initrd-2.4.21-15.EL.img
title Remote Install
root (hd0,0)
kernel /vmlinuz_remote ks=hd:hda1:/ks.cfg vnc vncconnect=192.168.162.1 ramdisk_size=8192
initrd /initrd_remote.img

replace the above devices with the ones on your system(hd:hda1->points to /boot)
3. vi /boot/ks.cfg
#System language
lang en_US
#Language modules to install
langsupport --default=en_US
#System keyboard
keyboard us
#System mouse
mouse generic3ps/2
#network
network --bootproto static --ip 192.168.162.129 --netmask 255.255.255.0 --gateway 192.168.162.1 --nameserver 192.168.162.1 --hostname l
#Use interactive kickstart installation method
interactive
#Use hard drive installation media USE YOUR OWN HARDDRIVE
harddrive --dir=/iso --partition=hda2 #replace with your own device (this points to /)
bootloader --location=mbr
#Reboot after installation
reboot
#Upgrade existing installation
upgrade
%pre

#!/bin/sh

mkdir /tmp/boot # create mount point
#-USE YOUR OWN HARDDRIVE ADDR
# mount filesystem on /dev/sda1 onto /tmp/boot (hiding mount's boot dir)
# /dev/hda1 point to /boot
mount -t ext3 /dev/hda1 /tmp/boot
# so below here /tmp/boot/... is actually /boot/... on harddrive device
# 'date' preserves original grub.conf through multiple boot attempts
cp /tmp/boot/grub/grub.conf /tmp/boot/grub/grub.conf.$(date"+%Y%m%d-%H%M%S")
cp /tmp/boot/grub/grub.conf /tmp/boot/grub/grub.sve
cp /tmp/boot/grub/grub.bak /tmp/boot/grub/grub.conf

4. put your CD or DVD iso in /iso, they can be multiple isos

5. just to be safe try loading the second option to grub you just added once as below, so if things went wrong you can come back

echo "savedefault --default=1 --once" | grub --batch
reboot

Saturday, October 10, 2009

Linux YP NIS config with autofs

1. mkdir /data/user10

2. useradd -g users -d /data/user10 user10

3. vi /etc/auto.master
# add this
/data auto.data --ghost

4. vi /etc/auto.data
* /data/& #something like this

5. vi /var/yp/Makefile
make an auto.data entry just like auto.home

6. do a make in var/yp

7. on the client service autofs restart

Saturday, June 06, 2009

ubuntu network configuration

root@ali-desktop:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto usb0

iface usb0 inet static
address 192.168.111.2
netmask 255.255.255.0

auto eth0
iface eth0 inet dhcp

Tuesday, May 26, 2009

Couldn't make mmap of X bytes - mmap

mount -t tmpfs none /var/cache/apt
mkdir -p /var/cache/apt/archives/partial
apt-get update

Monday, May 11, 2009

pango ARM cross compile

./configure --prefix=/home1 --host=arm-ip-linux-gnueabi LDFLAGS=-L$YOUR_OWN_COMPILED_GLIB_DIR (eg /opt/lib)

Saturday, May 09, 2009

GLIB ARM Cross compile

IPLinux GLIB BUILD

cat config.cache

glib_cv_stack_grows=yes
ac_cv_func_posix_getpwuid_r=yes
ac_cv_func_posix_getgrgid_r=yes
glib_cv_uscore=yes

./configure --host=arm-linux --cache=config.cache

Saturday, April 25, 2009

samba passwordless login

smbpasswd -a ali

/etc/samba/smb.conf
security=share
[public]
path = /home/ali
read only = no
guest ok = yes
public = yes
browsable = yes
force user = ali

Tuesday, April 21, 2009

ubuntu howto stop X from auto start

sudo update-rc.d -f gdm remove

Thursday, April 16, 2009

VOIP FXO FXS

REMEMBER

FXO = Foreign Exchange Office is connected to PSTN.
FXS = Foreign Exchange Subscriber is connected to a normal phone.

http://www.patton.com/technotes/fxs_fxo.pdf

Tuesday, April 14, 2009

DISPLAY to connect to X from SSH

export DISPLAY=`who -um | awk '{print $8}' | tr -d '()'`:0.0

Saturday, April 11, 2009

Thursday, April 09, 2009

Wive 0.61 on DWL-G700AP

When installing Wive on DWL-G700AP remember that after putting the access point in TFTP mode you have to use the EXACT ip address "192.168.1.6" for tftp regardless of whatever the actual LAN interface IP is.

Saturday, March 28, 2009

trixbox backup and restore

Install tbm-backup trixbox module in both machines, create a backup in BOTH machines, restore the backup from old machine into the new one (mysql password for asteriskuser may not be the same so before the restoration of the backup file make them the same).

windows 2003 limit bandwidth usage per IP

1. squid with delay pools support
(http://markus.revti.com/2007/06/installing-squid-cache-for-windows/)

2. softperfect bandwidth manager
(http://markus.revti.com/2009/01/squid-transparent-proxy-server-on-windows-server-2003/)

Tuesday, March 17, 2009

Saturday, March 14, 2009

multiple domain controllers (DC) on the same LAN

Use the DHCP of one of the DCs and split the LAN into 2 SUB-LANS
this is done using a superscope in the DHCP of domain controller.

- one scope 192.168.1.0/255.255.255.128
- another scope 192.168.1.128/255.255.255.128

The two sub scopes will not be able to access one another

Put one of the servers in first scope and the other in the second one.

In the scope options each have their own DNS and default route

To make the clients become a member of a certain scope fix the clients MAC address and create a reservation

Saturday, March 07, 2009

vmware guest OS on windows RRAS host OS problem

If you need to have vmware installed on a machine with RRAS, because of incompatibilities between proxy arp of RRAS and vmware your guest OS packets will not be routed, what you need to do is:
[in this example host machine has 2 NICs. One toward Internet and one local.]
1. Add a NIC to the host machine. (not virtual)
2. In the guest OS bridge one NIC to the Internet NIC of the host OS and the other to the newly added NIC of the host OS (which is connected to the local LAN)
3. Assign an IP address to the host and guest machine (the same range as the host machine)

Walla! ping outside

Wednesday, March 04, 2009

vnc enterprise vncconfig problem

run vncconfig with the -service parameter to change the config of the service mode not user mode
"E:\Program Files\RealVNC\VNC4\vncconfig.exe" -service

Sunday, February 15, 2009

mysql import and export

export:
mysqldump -u user -p db > dump.sql

import:
mysql -u user -p db < dump.sql

Friday, February 13, 2009

howto install cpanel

It is not free, needs a licence from cpanel.net after the trial period
Installing cPanel on a linux box is as simple as:
cd /home
wget layer1.cpanel.net/latest
sh latest
from: http://paragonhost.wordpress.com/2006/11/16/howto-install-cpanel-on-a-linux-os-server/

Tuesday, February 03, 2009

experts exchange free readonly account

http://www.experts-exchange.com/registerFree2.jsp

Saturday, January 31, 2009

Office 2003 Slow send in Vista

simply remove all office 2007 components on your PC and things will be cooooooool :)

Tuesday, December 30, 2008

نیاز به حساب درست و حسابی بانکی و نتایج اعتماد




ما سرویس "حساب بانکی آمریکا" را در سایت ابزارها ازگوگل پیدا کردیم http://www.abzarha.com

پول دادیم (130 هزار تومان). و برای ما با پست یک عدد کارت فرستادند و یک بروشور.

بعد 2 بار سعی کردیم طبق فرمایشات فروشنده پول ترنسفر کنیم به دیوار خوردیم.

با خدمات مشتریان صادر کننده کارت در آمریکا تماس گرفتیم و فرمودند این فقط کارت است حساب بانکی نیست.

سعی کردیم در پی پل رجیستر کنیم دوباره به دیوار خوردیم.



جواب های این فروشنده محترم جناب آقای مهدی جزینی را بینید.


نامه دوم و جواب ایشان
-----Inline Attachment Follows-----

Dooste aziz in hesabha hich moshkeli nadare! (lotfan bejaye karhaye bachegane kami ham be harfhaye man deghat konin bad nist !!!) ini ke shoma migin paypal ekhtar mide ke nemitoone add kone. ehtemalan az shanse shoma boode. (motasefane hamishe ham shanse bad dare khooneye kasaii ro mizane ke az hame talabkaran !!! ) gooya kasi ehtemal midam shomareye hesabesho dar paypal masalan yeki do adad pasopish zade (ke hesabe shoma boode) va hamoontor ke midoonin vaghti kasi shomare hesabi ro be paypal add kone. hata ghabl az confirm oon. hich rahi baraye pak kardane oon nadare. magar inke shoma ba customer support paypal tamas begirin va begin >>> ehtemalan kasi shomareye hesabe shoma ro be eshtebah dar paypalesh add karde ke confirm ham nashode. va oonha ba kamale meyl va be sadegi pas az gereftane etelaati az shoma va taiide oon be sadegi oono pak mikonan ta shoma betoonin hamoon banketoon ro add konin. be hamin sadegi. dige vaghte pasokhgooii bishtar ro be shoma nadarimchoon saremoon sholooghebe khatere 5 toman sood dahane tarafo service nemikonan ke shoma kardin !!!bye

On Tue, Dec 30, 2008 at 2:23 AM, Ali Sadeghi-Ardestani wrote:

Dear Sir,Looks like my account number which no one knew except you and me has been already registered in paypal. Please check attachment.

Regards,
Ali Sadeghi Ardestani
نامه اول و جواب ایشان
dooste man eshtebah az ma naboode bank be ma etela nadade bood ke tarigheye doroste wire be in accountha chi hast. choon taze oomade. hamoontor ke dobare khedmatetoon email kardam shoma bayad be soorati ke dar file attach shode dar in email dadam havale konin na mostaghim!

va agar balad nistin ke yek sarafi dorost peyda konin inkar ro ham baratoon anjam midam vali dige baghish be ma marboot nist. ma ke nabayad ta payane omre donya shoma ro support konim!!! ma faghat forooshandeiim. har moshkeli darin dige ba poshtibaniye hamoon bank tamas begirin moshala englishetoon ham ke khoobe!!!

in linke yek sarafi dar tehran hast ke ba (bank of america) ham kar mikone:
http://www.ketabeavval.ir/Profile/?id=136433

dige baghish be ma marboot nemishe bazam migam ma faghat forooshandeiim va support ba hamoon telephoni hast ke dar broshooretoone



On Mon, Dec 29, 2008 at 3:35 PM, Ali Sadeghi-Ardestani wrote:
Dear Sir,

After the attached transaction was rejected twice by two different exchange houses and I lost 135,000 TOMANS for money transfer costs and right after I got the Bank of America Transfer Information from you, I talked to customer support and told them that I need to have this account to buy stocks so the my brokrage firm that is buying the stocks for me needs to have access to my account using a direct method like
ACC NUMBER+NAME+BANK+ROUTING or any other method like this.

They said and I quote "Your account with us is not connected to a bank, so you can not get your brokerage firm to access your account. All you can do with this card is to get your employer to put your salary here and you can then get cash from ATMs". Alhamdolella I did not try the second method you offered otherwise I would have lost more. They asked where I got the card from and I gave them your website, they said that I can ask you for the same card but the Visa enabled one. I do not think you have it, because I asked you once.

When I asked about transfers from paypal, they said I can use paypal but as you may already know paypal has really strict rules about fraud and once they get a feeling that your activity is strange they simply block your account just like my old paypal account.

Now what I am asking you is to refund me and get your card back and also to remove the "HESABE BANKI AMRIKA" from your website because it is misleading and very simply put not TRUE not forgetting how time/money consuming it is to come to the above conclustion.

Regards
Ali Sadeghi Ardestani

Monday, December 29, 2008

Excel find nth occurrence of a string within another

Function FindN(sFindWhat As String, _
sInputString As String, N As Integer) As Integer
Dim J As Integer

Application.Volatile
FindN = 0
For J = 1 To N
FindN = InStr(FindN + 1, sInputString, sFindWhat)
If FindN = 0 Then Exit For
Next
End Function

Sunday, December 28, 2008

Napoli Pizza



I liked it, esp the Chano with extra garlic sauce one.

Friday, December 26, 2008

utorrent slow download

remember to update tcpip.sys using http://www.lvllord.de/?url=downloads&lang=en every time you install a service pack. This helps increase the number of half open connections from 10 to 50. And downloads will explode.

Thursday, December 25, 2008

create RPM repository from ISO DVD CD

Thanks to http://www.cyberciti.biz/tips/redhat-centos-fedora-linux-setup-repo.html
# mkdir -p /var/www/html/centos/5/os/i386
# mount -o loop /path/to/centos.iso /var/www/html/centos/5/os/i386

** (put it in /etc/fstab later)

createrepo /var/www/html/centos/5/os

# vi /etc/yum.repos.d/iso.repo
[My ISO Repository]
baseurl=http://$IP_ADDRESS/centos/5/os/
enabled=1
gpgcheck=0

service httpd restart

** not other servers is the subnet can use this repository as well as this service onto which the iso resides

Sunday, November 09, 2008

Wordpress Persian (Farsi) bluehost

1. Install wordpress from bluehost interface
2. Install the farsi patch from wp-persian.com
3. edit the wp-config-sample.php and remove the below:

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

Sunday, October 05, 2008

mysql change database charset to unicode

SELECT concat('ALTER TABLE `', t.`TABLE_SCHEMA`, '`.`', t.`TABLE_NAME`, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') as stmt

FROM `information_schema`.`TABLES` t

WHERE 1

AND t.`TABLE_SCHEMA` = 'database_name'

ORDER BY 1

Friday, October 03, 2008

OLAT email problem

once you could not send emails and came accross this:

DEBUG: setDebug: JavaMail version 1.3

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,gnu.mail.providers.smtp.SMTPTransport,nferrier@tapsellferrier.co.uk]

java.lang.NoSuchMethodException: gnu.mail.providers.smtp.SMTPTransport.(javax.mail.Session, javax.mail.URLName)

you should install java mail components, I installed:

geronimo-javamail-1.3.1-api-1.1-4jpp

sun-mail-1.4-3jpp

classpathx-mail-1.1.1-4jpp.2




And the problem was solved.

Tuesday, September 23, 2008

jdk installation

when installing jdk depenging on the version for JRE to work correctly as well

java-sun-compat

has to be installed too.

for example for jdk-6u6-linux-i586.rpm to work along with tomcat you need to install java-1.6.0-sun-compat-1.6.0.06-1jpp.i586.rpm as well, otherwise tomcat and the applications that need jre 1.5 upwards will not work.

Friday, September 05, 2008

Strange Linux PPTP problem

When using Linux PPTP service web pages fail to load completely [freeze] (aka common PPTP MTU problem) all one has to do is to:

> cat /etc/ppp/ip-up.local
#!/bin/bash
/sbin/ifconfig $1 mtu 1400

Thursday, September 04, 2008

Tor problem

When Tor can not connect the first thing you do is to check the date/time of your machine!

Friday, August 01, 2008

Jalali Date - Javascript

Jalali date in java script as active desktop element
it can be downloaded from:
http://sites.google.com/site/alisade/Home/fdate.zip?attredirects=0

Sunday, July 06, 2008

a simple bash prompt PS1

export PS1="\[\e[32;1m\]\d \t\[\e[36;1m\]\n\u@\h\n\[\e[31;1m\]\w > \[\e[0m\]"

Thursday, June 12, 2008

openvpn config parameter seems compulsory

Although I used to do openvpn TLS without the "tls-auth ta.key 0" directive for years, now it looks like it has become compulsory, otherwise handshake will not occcur completely although the first
TLS: Initial packet from xxx.xx.xx.xx:1194, sid=42fb5c72 1f286ab1
is exchanged with no problems

Saturday, June 07, 2008

linux disable single user mode

do not try to disable the single user mode instead use a grub password.

Monday, May 19, 2008

Join a computer to windows 2003 domain

When joining a computer to a windows 2003 box remember to add the .com at the end of the domain name otherwise the dns will not find the SRV record of the domain name

Monday, March 31, 2008

free totally legal Nastaliq font by http://www.scict.ir/

http://www.box.net/shared/bh9ioqs2ss originally from http://www.scict.ir/

Sunday, March 16, 2008

command line download accelerator for windows

AXEL is a command line accelerator for the *nix, I have compiled it under cygwin and have put it here:

http://www.box.net/shared/avraot95w8

Enjoy!

Saturday, March 15, 2008

iptables enable passive mode ftp

just do this:
modprobe ip_conntrack_ftp

Tuesday, March 11, 2008

red hat root login in telnet,...

edit /etc/pam.d/login and /etc/pam.d/remote and

comment out

auth required pam_securetty.so

Monday, March 03, 2008

crontab does not accept

crontab does not accept commands with `command to execute` within command line

Saturday, March 01, 2008

Simple web sharing in apache

httpd.conf:

Alias /cbt "/users/WWW"

Order Allow,Deny
Allow from All

Wednesday, February 27, 2008

Error: Can't open Display

although you do an xhost + still you cannot do an xclock so:

on the machine connecting to the other do a
vi /etc/X11/gdm/gdm.com

DisallowTCP=false


** REMEMBER to check iptables

Tuesday, February 26, 2008

XTERM execute parameter

XTERM -e (exexute switch) MUST be the last one passed to XTERM.

Sunday, February 24, 2008

Oracle Move from one computer/directory to another

1. Edit and replace paths in

/etc/oratab
/etc/rc.d/rc5.d/S99zzoracle_orasid
/etc/rc.d/init.d/orastop_orasid
/etc/rc.d/init.d/listener_orasid
/etc/rc.d/init.d/orastart_orasid
/etc/rc.d/rc6.d/K10zzoracle_orasid
/etc/rc.d/rc0.d/K10zzoracle_orasid
/etc/rc.d/rc3.d/S99zzoracle_orasid
/etc/rc.d/rc1.d/K10zzoracle_orasid
/etc/oraInst.loc

2. Edit and replace paths in
listener.ora tnsnames.ora

3. login as sys as sysdba (listener must be on and database mounted)
create pfile='/apps/oracle/OraHome1/dbs/initorasid.ora' from spfile='/apps/oracle/OraHome1/dbs/spfileorasid.ora'

4. Edit /apps/oracle/OraHome1/dbs/initorasid.ora and change paths

5. Now do the reverse
create spfile='/apps/oracle/OraHome1/dbs/spfileorasid.ora' from pfile='/apps/oracle/OraHome1/dbs/initorasid.ora'

6. The last step is to alter internal files names:
alter database rename file '/home/gf_admin/oradata/gftt/control01.ctl' to '/apps/gf_admin/oradata/gftt/control01.ctl';
alter database rename file '/home/gf_admin/oradata/gftt/control02.ctl' to '/apps/gf_admin/oradata/gftt/control02.ctl';
alter database rename file '/home/gf_admin/oradata/gftt/control03.ctl' to '/apps/gf_admin/oradata/gftt/control03.ctl';
alter database rename file '/home/gf_admin/oradata/gftt/redo01.log' to '/apps/gf_admin/oradata/gftt/redo01.log';
alter database rename file '/home/gf_admin/oradata/gftt/redo02.log' to '/apps/gf_admin/oradata/gftt/redo02.log';
alter database rename file '/home/gf_admin/oradata/gftt/redo03.log' to '/apps/gf_admin/oradata/gftt/redo03.log';
alter database rename file '/home/gf_admin/oradata/gftt/system.dbf' to '/apps/gf_admin/oradata/gftt/system.dbf';
alter database rename file '/home/gf_admin/oradata/gftt/temp.dbf' to '/apps/gf_admin/oradata/gftt/temp.dbf';
alter database rename file '/home/gf_admin/oradata/gftt/tsdata.dbf' to '/apps/gf_admin/oradata/gftt/tsdata.dbf';
alter database rename file '/home/gf_admin/oradata/gftt/tsindex.dbf' to '/apps/gf_admin/oradata/gftt/tsindex.dbf';
alter database rename file '/home/gf_admin/oradata/gftt/undotbs.dbf' to '/apps/gf_admin/oradata/gftt/undotbs.dbf';

Saturday, February 23, 2008

oracle spfile and pfile

startup using spfile
STARTUP

startup using pfile
STARTUP PFILE=’C:\oracle\product\10.2.0\admin\MarlonDB\initMarlonDB01.ora’

convert one to another:
CREATE SPFILE=’C:\oracle\product\10.2.0\db_1\database\spfileMarlonDB01.ora’ FROM PFILE=’C:\oracle\product\10.2.0\admin\MarlonDB\initMarlonDB01.ora’;

CREATE PFILE=’C:\oracle\product\10.2.0\admin\MarlonDB\initMarlonDB01.ora’ FROM SPFILE=’C:\oracle\product\10.2.0\db_1\database\spfileMarlonDB01.ora’;

Saturday, February 16, 2008

linux increase swap

mkdir /opt
dd if=/dev/zero of=swapfile01 bs=1024M count=1
mkswap swapfile01
swapon swapfile01

vi /etc/fstab

/opt/swapfile01 swap swap defaults 0 0

Thursday, February 14, 2008

oracle 9i export

if exporting from an oracle 9 instance ended in error you have to run $ORACLE_HOME/rdbms/admin/catexp.sql first.

Thursday, February 07, 2008

connect to network resources on another domain

To connect to network resources in form of \\server\share on a computer which is a member of a domain other than the one you are and when you get "There are currently no logon servers available to service your request" error, do the following

1. You should know the exact share name on the server that you are connecting to.
2. explorer->Tools->Map network drive
3. specify the share name
4. user other username and password
5. Specify DOMAIN_NAME\username as username

Tuesday, February 05, 2008

whenever you come accros this.....

symbol errno, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

you have to set LD_ASSUME_KERNEL=2.4.1 in the environment of whatever user trying to run Oracle tools like dbca

Wednesday, January 30, 2008

Ubuntu as nis client for Solaris

Since YP reports map files from Solaris to have dots like auto.master instead of underscores like auto_master; /etc/init.d/autofs must be changed to replace underscores with dot just like REDHAT.


a varible UNDERSCORETODOT=1 is added under the debian section and when the value is checked I replceed the below statement

map=`basename $map | sed -e s/^auto_home/auto.home/ -e s/^auto_mnt/auto.mnt/`

with

map=`basename $map | sed -e s/auto_/auto./g`

now all underscores are converted into dots.

Monday, January 28, 2008

oracle 9 default alret log

$ORACLE_HOME/rdbms/log

Monday, January 07, 2008

ethernet conenction bonding RHEL

This one works
http://www.howtoforge.com/network_card_bonding_centos

Sunday, January 06, 2008

linux create iso

dd if=/dev/cdrom of=/root/my_cd1.iso

Saturday, January 05, 2008

Solaris Automount NFS with linux clients

Solaris Box:
0. /et/defaultdomain :: Put NIS domain name here

1. vi /etc/dfs/dfstab
share -F nfs -o rw /apps1
share -F nfs -o rw /home1
share -F nfs -o rw /data

2. vi /etc/auto_master
/apps1 auto_apps -nosuid,nobrowse

3. vi /etc/auto_apps
oracle -ro s2:/apps1/oracle
gf_admin -rw s2:/apps1/gf_admin

4. vi /var/yp/Makefile
Copy the section auto_home and auto.home and create corresponding auto_apps and auto.apps sections

5. make

6. *TO DO*: to prevent the NIS server from automounting its own directories and consecutively not seeing the contents of those - falsely automounted - directories I removed the "files nis" tags in front of automount in /etc/nssswitch.conf

Linux Box:
7. /etc/sysconfig/network :: put NISDOMAIN=$nisdomainname

8. /etc/yp.bind :: specify server and NIS Domain name

Wednesday, December 26, 2007

Password proetct pages in Apache

create a password encoded .httaccess file with

http://www.4webhelp.net/us/password.php
http://shop.alterlinks.com/htpasswd/htpasswd.php
http://www.htmlite.com/HTA006a.php

in form of user:encoded_password

then add the following to corerct section in httpd.conf file

AuthUserFile /full/path/to/.htaccess
AuthType Basic
AuthName "Authorization Required"
Require valid-user

restart apache

Monday, December 24, 2007

Cacti on Windows

The following have to be set in the cacti->settings

PATH
spine path is to be set
rrdtool font is to be set like c:/cacti/arial.ttf

GENERAL
RRDTOOL version must match the installed rrdtool

Saturday, December 15, 2007

NIS AUTOMOUNT

1. server: /etc/exports, define exportable directories

/users *(rw,no_root_squash,no_all_squash,sync)
/apps *(ro,sync)

2. server: service nfs restart

3. server: /var/yp/Makefile, edit to include auto.* in make all
(YP server is to be installed first)

4. server: /etc/auto.master :: <--- REMEMBER NO /etc in front of auto.*
/users auto.home --ghost
/apps auto.local --ghost

5. server: /etc/auto.home ::
* -rw dcssrv4:/users/&

6. server: /etc/auto.local ::
oracle -ro dcssrv4:/apps/oracle
gf_admin -ro dcssrv4:/apps/gf_admin

7. server: cd /var/yp;make

8. server: service ypserv restart

9. client: edit /etc/nsswitch.conf :: automount nis files

10. client /etc/sysconfig/network :: put NISDOMAIN=xxxxxxx

11. client /etc/yp.conf :: put domain NISDOMAIN server XXXX

12. client: service ypbind restart & service autofs restart

look at http://penguin.triumf.ca/recipes/nis-auto/index.html
(it has an error, check the instrucion #4 above)

Wednesday, December 12, 2007

geoframe document errors

1. gf_admin must be of group dba
2. chmod 775 /home/oracle

Tuesday, December 11, 2007

qemu resize image file

1. qemu-img convert system.qcow -O raw system.raw
2. dd if=/dev/zero of=system.raw seek=N obs=1GB count=0 (N=final size)
3. qemu-img convert system.raw -O qcow growed-system.qcow

Monday, December 10, 2007

QEMU change cdrom

1. start qemu with -monitor stdio option along with other options
2. press CTRL+ALT+2 to enter CLI mode and CTRL+ALT+1 to exit
3. enter command "change cdrom isofilename.iso"

Sunday, December 09, 2007

remember you stupid that

files that start with . (dot) in linux will be hidden from plain ls, Gnome deskop,...

Wednesday, December 05, 2007

Oracle SNMP for Cacti monitoring

from http://forums.cacti.net/about6209.html
Step 0 : Enverionment

OS : SunOS dbateam 5.8
Oracle Version: 8.1.6

Step 1 : Stop Sun's snmpdx process.

login as root account:
1-0
%ps -ef | grep snmp | grep -v grep
root 6438 1 0 Sep 10 ? 0:01 /usr/lib/dmi/snmpXdmid -s bscss02d
root 6427 1 0 Sep 10 ? 0:20 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
%
%kill -9 6438 6427

1-2
# ps -ef | grep mib
root 6405 1 0 Nov 01 ? 0:24 mibiisa -r -p 32934
root 2373 1 0 Oct 21 ? 3:23 mibiisa -r -p 32882
root 6512 1 0 Nov 01 ? 0:25 mibiisa -r -p 32956
root 6578 1 0 Nov 01 ? 0:26 mibiisa -r -p 32977
root 6620 1 0 Nov 01 ? 0:01 mibiisa -r -p 32998
root 6558 1 0 Nov 01 ? 0:24 mibiisa -r -p 32972
root 6434 1 0 Nov 01 ? 0:30 mibiisa -r -p 32941
root 7284 7280 0 19:03:46 ? 0:00 mibiisa -r -p 40714
# kill -9 6405 2373 6512 6578 6620 6434 7284

1-3
check process of oracle snmp
%ps -ef | grep peer
root 6607 1 0 Nov 01 ? 0:06 ./encap_peer -t 1162 -s 1160 -c CONFIG.encap
root 6605 1 0 Nov 01 ? 0:13 ./master_peer CONFIG.master NOV
%kill -9 6607 6605


Step 2 : Start Oracle Snmp

2-0: check $ORACLE_HOME/network/snmp/peer/CONFIG.master
COMMUNITY public
ALLOW ALL OPERATIONS
USE NO ENCRYPTION
MANAGER xxx.xxx.xxx.xxx
SEND ALL TRAPS

2-1: check $ORACLE_HOME/network/snmp/peer/CONFIG.encap
AGENT AT PORT 1161 WITH COMMUNITY public
SUBTREES 1.3.6.1.2.1.1,
1.3.6.1.2.1.2,
1.3.6.1.2.1.3,
1.3.6.1.2.1.4,
1.3.6.1.2.1.5,
1.3.6.1.2.1.6,
1.3.6.1.2.1.7,
1.3.6.1.2.1.8,
1.3.6.1.4.1.11.2
FORWARD ALL TRAPS;

2-3: check start_peer
SNMPD=/usr/lib/snmp/snmpdx
SNMPD_CONFIG=/etc/snmp/conf
SNMPD_OPTIONS=-y


2-4: loging as root

%/bin/ksh
%export ORACLE_HOME=/oracle/816/product/8.1.6
%cd $ORACLE_HOME/network/snmp/peer/
%./start_peer -a
Starting master_peer ...
./master_peer CONFIG.master NOV >master_peer.out 2>&1 &
Done!

Starting encap_peer ...
./encap_peer -t 1162 -s 1160 -c CONFIG.encap >encap_peer.out 2>&1 &
Done!

Starting /usr/lib/snmp/snmpdx ...
/usr/lib/snmp/snmpdx -y -c /etc/snmp/conf -p 1161 >snmpd.out 2>&1 &
Done!

check files ( master_peer.out,encap_peer.out,snmpd.out )
there will be no content,if start oracle snmp success,like ..
%ls -ltr *.out
-rw-r--r-- 1 root other 0 nov 2 19:11 master_peer.out
-rw-r--r-- 1 root other 0 nov 2 19:11 encap_peer.out
-rw-r--r-- 1 root other 0 nov 2 19:11 snmpd.out

startup oracle listener for dbsnmp
su - oracle account
agentctl start
%snmpwalk -Os -v 1 -c public 172.16.28.223 1.3.6.1.4.1.111

Tuesday, December 04, 2007

Windows: computer cannot connect to some sites

Windows: Computer cannot connect to some websites to which other have absolutely no problems connecting:

ipconfig /flushdns

can help A LOT!!!

Thanks to my brother Moslem Saleh

Monday, December 03, 2007

Tuesday, November 27, 2007

Oracle minimal client installation

1. Oracle basic client/or basic lite in case you need only English language. (oracle litebasic for windows is only 8 megs, how beautiful is that!)

2. These environment variables are to be set:

$ENV{'ORACLE_HOME'} = "d:/oracle";
$ENV{'TNS_ADMIN'} = "d:/oracle";
$ENV{'LD_LIBRARY_PATH'} = "d:/oracle";

3. Put tnsnames.ora in the path specified by $ENV{'TNS_ADMIN'}

Sunday, November 25, 2007

DBD::Oracle Activestate Perl on Windows

1. Oracle 9 oci.dll has problems with the function calls within oralce.dll by Activestate

2. Do not use the Graphical Perl Package Manager use ppm install/uninstall command prompt tool instead

3. Download the Oracle instant client avaiable from Activestate. (agree to the oracle disclaimer at the end of the ppm install DBD-oracle)

4. If after complete installation of DBD-Oracle still you got messages like procedure entry point not found, replace the oralce client oci.dll with the ones provided by activestate.

You are good to go

Monday, November 19, 2007

Oracle Sort Paging

Oracle does not have the keyword limit like mysql, you have to select couple of rows and limit them by rownumbers, this may cause problems when sorting because you may only sort the set that you have selected, so first select and sort all then limit by rownums

select * from
    (select p.*, rownum r from
        (select * from all_objects order by object_name) p
    where rownum < 20)
where r > 10;

THANKS ASKTOM

Friday, November 16, 2007

bash echo problem with filenames with whitespaces

taken from http://textsnippets.com/posts/show/1105 --thanks so much guys

Bash Internal field seperator has to be changed to $'\n' like this

export IFS=$'\n'

now when u do
for i in `ls`;echo $i;done

spaces will not be treated as field seperators and consequently the whole filename is displayed completely.

Sunday, November 11, 2007

ORACLE 9 installation document error

ALTHOUGH oracle 9 installation document tells you that ORACLE_BASE does not have to be set prior to installation of oracle, THIS IS TOTAL BULLSHIT!!!!! YOU HAVE TO SET ORACLE_BASE.

Monday, November 05, 2007

solaris install window decoration/theme

solaris install window decoration/theme with http://www.blastwave.org CSW qt and kde packages. (all installed in default locations)

./configure --with-qt-dir=/opt/csw/kde-gcc --with-qt-includes=/opt/csw/include

** in case KDE libs were not being found although they were installed remove QT libs from $LD_LIBRATY_PATH just keep KDE libs,

*** REMOVE anything you added to LD_LIBRARY_PATH in case your applications started behaving erratically.

Tuesday, October 30, 2007

Solaris manual default gateway change

route add -net 0.0.0.0/0 163.183.37.1

Solaris Ethernet connectivity related files

/etc/hosts
/etc/nodenames
/etc/hostname.[device]
/etc/defaultrouter
/etc/defaultdomain
/etc/nodename

Monday, October 29, 2007

Perl regular expressions

(a*b*)* in perl == ((a*b*)*)

matches can be accessed in internal var$ $1,..$n
complete match is in $&

[a-zA-Z0-9] = \w

(\w*) = macthes anything alphanumeric + "_"

$line =~ m/((\w*-*)*)/; will match combinations of above plus "-"
$result = $1;
or
$result = $line =~ m/((\w*-*)*)/;

Tuesday, October 23, 2007

Read man pages directly

nroff -man smbmount.8 | more

Putty login with no password

1. ssh-keygen -t rsa -C ali@ali.com -f ~/.ssh/id_rsa
2. mail -s "my private ssh key" ali@ali.com < ~/.ssh/id_rsa
3. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2
4. chmod 600 ~/.ssh/authorized_keys2
5. download http://the.earth.li/~sgtatham/putty/0.60/x86/puttygen.exe
6. Convert the save key from email and save as private key file.
7. in Putty->SSH->Auth select the file.

To disable password based login after creating the public/private key pair

change the following in /etc/ssh/sshd_confing
PermitRootLogin no
PasswordAuthentication no
UsePAM no

*** REMEMBER NOT TO LOSE THE private key
HAVE PHUN

Monday, October 22, 2007

Oracle drop user error

ORA-00600: internal error code, arguments: [qmxiUnpPacked2], [121], [], [], [],
solution:
connect as sysdba
1)SQL> shutdown immediate

2)SQL> startup migrate

3)SQL> spool patch.log

4)SQL> @?/rdbms/admin/catpatch

5)SQL> spool off

Oracle create database and user

Oracle create user in 3 steps;
1. RUN DBCA successfully.
2. SQL> create user username identified by password default tablespace users temporary tablespace temp;
3. SQL> grant connect, resource to username;

Sunday, October 21, 2007

mysql startup on solaris

cd /usr/local/mysql1/bin
./mysql_install_db --user=mysql --ldata=/sqldata
./mysqld_safe --datadir=/sqldata --user=mysql &

Saturday, October 20, 2007

Solaris Samba Mount using shlight

shlight //srv0r/Segnts/Gest/SUPPORT //root/win -U alisadeghi -P alipassword -W domain

Saturday, September 22, 2007

Solaris Default Route

edit /etc/defaultrouter
route add default $ROUTER_IP_ADDRESS

Tuesday, September 11, 2007

make Perl modules on Solaris with GCC

To prevent the usual problems due to the lack of CC on solaris, you should download and install GCC from sunfreeware.com then change the following parameters in the Makefile and do make & make install

1. Change CC=cc to CC=gcc or ln -s gcc to cc
2. Change
CCCDLFLAGS = -KPIC
to
CCCDLFLAGS =
3. Change
OPTIMIZE = -xO3 -xspace -xildoff -xarch=v8
to
OPTIMIZE =
4. Change
CCFLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO
to
CCFLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO

source: http://atmail.com/view_article.php?num=251
We thank the superman above who initially wrote this!

Monday, September 03, 2007

HTML within Perl code

print<<"tab1";
#HTML CODE GOES HERE
tab1

Thursday, August 09, 2007

Install Cisco VPN Client on Linux

#!/bin/bash

# Fedora Core Cisco VPN Client install notes by Jason Roysdon - http://jason.roysdon.net/
# Creative Commons Attribution-ShareAlike 2.5 - http://creativecommons.org/licenses/by-sa/2.5/
# http://jason.roysdon.net/credits.html

# This patch allows the Cisco VPN Client 4.8.00 (0490) to install with the 2.6.19 kernel.
# It should work for other distros, but here are my FC5/FC6-specific notes.
#

# original source of fix:
# http://www.tuxx-home.at/cmt.php?article=/2006/12/07/T09_36_48/index.html
# patch:
# http://www.tuxx-home.at/projects/cisco-vpnclient/vpnclient-linux-2.6.19.diff

# Run as this as root

# fc3 had the kernel source info with the kernel rpm before, but as of kernel-2.6.12-1.1372_FC3 the following is required:
yum -y install kernel-devel
# with fc5, I now have to install the following for my P4 which looks like an SMP:
yum -y install kernel-smp-devel.i686

mkdir -p /opt/download
cd /opt/download

echo You must login to CCO manually and attempt to download the client for their ftp server to recognize your request:
echo http://cisco.com/cgi-bin/tablebuild.pl/vpnclient-3des
wget -c --user=YOUR-CCO-USER --password=YOUR-CCO-PW http://ftp-sj.cisco.com/cisco/crypto/3DES/vpn/client/linux/vpnclient-linux-x86_64-4.8.00.0490-k9.tar.gz
wget -c --user=YOUR-CCO-USER --password=YOUR-CCO-PW http://ftp-sj.cisco.com/cisco/crypto/3DES/vpn/client/linux/vpnclient-linux-4.8.00.0490-readme.txt

tar xfvz vpnclient-linux-x86_64-4.8.00.0490-k9.tar.gz
cd vpnclient

# get 2.6.19 patch
wget -c ftp://jason.roysdon.net/pub/jroysdon/linux/vpnclient-linux-2.6.19.diff
patch -i vpnclient-linux-2.6.19.diff

# create /usr/local/bin, as on FC6 it doesn't exist by default
mkdir -p /usr/local/bin

# run the install, take the defaults
./vpn_install

# I want my non-root user to be able to start the vpn
chmod 4111 /opt/cisco-vpnclient/bin/cvpnd

# start the service the first time
/etc/init.d/vpnclient_init start

# I like to quickly be able to see what connections I have with a custom 'vpnlist' command:
echo echo > /usr/local/bin/vpnlist
echo echo /etc/opt/cisco-vpnclient/Profiles/ >> /usr/local/bin/vpnlist
echo ls -b /etc/opt/cisco-vpnclient/Profiles/ >> /usr/local/bin/vpnlist
echo echo >> /usr/local/bin/vpnlist
chmod 4111 /usr/local/bin/vpnlist

# I use runlevel 4 for when I'm trying to preserve battery or want a fast bootup and want minimal services running
chkconfig --level 4 vpnclient_init off