3 November 2011

LINUX - How can I get my external router IP?

curl -s http://checkip.dyndns.org/ | cut -d ' ' -f 6 | sed s/"body\|html\|<\|>\|\/"//g

or just visit http://www.whatismyip.com/

11 October 2011

LINUX - su: incorrect password

The problem is that "su" has to be suid in order to read from the shadow file of your system to verify the password you have given. 

By issuing "chmod 777 *" you deleted the suid bit (777 = 0777). 

You have to reset this bit by executing "chmod 4755 /bin/su".

20 June 2011

ORACLE - Disable password expiry

Unlike older releases, Oracle11g sets password expiry by DEFAULT. Get rid of these with:

SQL> alter profile default limit
failed_login_attempts unlimited
password_life_time unlimited;

6 June 2011

18 May 2011

ORACLE - Instance started using a PFILE or an SPFILE ?

Use the following query on a started instance (nomount, mount or open):

SQL> select count(*) from v$spparameter where value is not null;
If the result of this query is zero, the instance was started using a PFILE. If the result is a non-zero value, the instance was started using an SPFILE.

Explanation:When an instance has been started using a server side parameter file (SPFILE), which is a new feature in Oracle Server 9.0.1, the v$spparameter contains NOT NULL values for several parameters. When an instance has been started using the 'classic' PFILE, this view only contains NULL values.


To check which spfile you are using run below command. If you are using spfile you will get a value otherwise you will not see any value.

SQL> show parameter spfile


26 April 2011

LINUX - Listing today's files only

# ls -l --time-style=+%D | grep `date +%D`

ORACLE - To check list of inactive users or inactive sessions

In many cases you need to check the list of inactive users or inactive sessions in your database. 

The script below produces the list of inactive users and inactive sessions. Run the script using sysdba 

set heading on feedback on pages 100 lines 140

column userinfo heading "ORACLE/OS User" format a19
column machine heading "Client Machine" format a20
column terminal heading "Terminal" format a10
column process heading "Parent|Process ID" format a10
column spid heading "Shadow|Process ID" format a10
column seq# heading "Wait|Sequence" format 99999990
select s.username||' '||s.osuser userinfo,s.machine, s.terminal, s.sid, s.serial#,
p.spid,
s.process , w.seq#
from v$session s, v$process p
,v$session_wait w
where p.addr = s.paddr
and s.sid = w.sid
and w.event = 'SQL*Net message from client'
and s.status = 'INACTIVE'
order by s.osuser, s.machine
/

Wordpress - Local installation in Vmware

If you're interested in exploring website design with WordPress, this guide will help you set up a WordPress instance on your local mach...