Archives

You are currently viewing archive for September 2009
Category: MS tips
Posted by: hajime osako
Category: Linux tips
Posted by: hajime osako
HOWTO: Turning off or disabling SELinux

Temporarily:
echo 0 > /selinux/enforce

Permanent:
vi /etc/sysconfig/selinux

SELINUX=disabled
Category: Oracle
Posted by: hajime osako
Get table and index DDL the easy way

set heading off;
set echo off;
Set pages 999;
set long 90000;

spool ddl_list.sql

select dbms_metadata.get_ddl('TABLE','DEPT','SCOTT') from dual;


# funcy spool file name
COLUMN system_date NEW_VALUE YYYYMMDD
SELECT to_char(sysdate,'YYYYMMDD') system_date FROM DUAL;

spool myspool_&&YYYYMMDD..log


select dbms_metadata.get_ddl('INDEX','DEPT_IDX','SCOTT') from dual;

spool off;
Category: Oracle
Posted by: hajime osako
Oracle :: Tablespace Information

Or

select file_name, bytes, autoextensible, maxbytes, tablespace_name from dba _data_files;
Category: Linux tips
Posted by: hajime osako
Creating an ext3 File System

/sbin/fdisk /dev/hdX
/sbin/mkfs -t ext3 /dev/hdXY
Category: Linux tips
Posted by: hajime osako
Category: Web dev
Posted by: hajime osako
Python thread dumps

import sys
import traceback
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter

def stacktraces():
code = []
for threadId, stack in sys._current_frames().items():
code.append("\n# ThreadID: %s" % threadId)
for filename, lineno, name, line in traceback.extract_stack(stack):
code.append('File: "%s", line %d, in %s' % (filename, lineno, name))
if line:
code.append(" %s" % (line.strip()))

return highlight("\n".join(code), PythonLexer(), HtmlFormatter(
full=False,
# style="native",
noclasses=True,
))
Category: Linux tips
Posted by: hajime osako