Tuesday, June 17, 2014

Javascript: force client to reload javascript files

Ctrl+F5

or add a version information in file specification, and change it every time the js file is updated

<script type="text/javascript" src="file.js?1.1"></script>

Thursday, June 5, 2014

OSX: from 10.9.2 to 10.9.3

Install the OS X Mavericks 10.9.3 Update (Combo)
Use MultiBeast 6.3 with this conf.

Reboot, et voila:

Wednesday, June 4, 2014

XEmacs: show ^M (\r)

M-x find-file-literally /path/to/file

Saturday, May 24, 2014

HTC Pico/Explorer: Extend external memory after CM10.2 install

Use this link to download MiniTool Partition Wizard Home Edition

http://download.cnet.com/MiniTool-Partition-Wizard-Home-Edition/3000-2094_4-10962200.html?part=dl-6285158&amp;subj=dl&amp;tag=button

1. Connect your SD card to PC through USB mode
2. Run the downloaded file (pwhe8.exe)
3. Select your SD card 2nd partition and right click to select DELETE option
4. Again select your 2nd partition (unallocated space at this moment) and right click to select CREATE option
5. Select partition type as ext4 and drive as primary (Not logical) from popup window
6. At last select the apply button from tool bar (first button)

Done - you created a EXT4 partition

 Then install Mounts2Sd from Google Play, then
1. After installing the app, open it and allow root access
2. Configure install script
3. Enable applications, data , cache, etc.
4. Reboot

Friday, May 23, 2014

Oracle: Stop a datapump job run via crontab

Show datapump jobs
select * from dba_datapump_jobs;
Stop a datapump job
DECLARE
   handle NUMBER;
BEGIN
    -- Format: DBMS_DATAPUMP.attach('[job_name]','[owner_name]');
    handle := DBMS_DATAPUMP.attach('SYS_EXPORT_FULL_02','SYSTEM');
    DBMS_DATAPUMP.STOP_JOB(handle, 1, 0);
END;

Tuesday, May 13, 2014

Perl md5

perl -MDigest::MD5 -e 'print Digest::MD5::md5_hex("mbqt")'

Tuesday, May 6, 2014

Use quotes in a perl one-liner

 cat /media/host/vbox.txt | perl -e 'while (<>) { print "'"'"'$1'"'"',\n" if /^(\d+)/; }'

Thursday, April 24, 2014

Oracle: select from list of values

select distinct column_value from table(sys.odcinumberlist(1,1,2,3,3,4,4,5));
or
select column_value from table(sys.dbms_debug_vc2coll('One', 'Two', 'Three', 'Four'));

Tuesday, April 1, 2014

ORA-01555: snapshot too old: rollback segment number 61 with name "_SYSSMU61_1706556987$" too small

SQL> select max(maxquerylen) from v$undostat;

26687
Add 20% to this value and update UNDO_RETENTION parameter.
SQL> ALTER SYSTEM SET UNDO_RETENTION = 32024;

Wednesday, March 26, 2014

Update CPAN perl packages

cpan upgrade /(.*)/

Sunday, March 23, 2014

Mavericks 10.9.2: network lost after upgrade

Symptom: network stopped working suddenly after Mavericks upgrade
History:
  1. Updated Mavericks to 10.9.2 using Combo update
  2. Re-installed conf. using MultiBeast 6.2.1
  3. Reboot
  4. Network KO
  5. Repair permissions: sudo diskutil repairPermissions /
  6. Reboot

Friday, March 21, 2014

Friday, February 28, 2014

Oracle: monitoring long tasks

SELECT start_time, username, target, sofar blocks_read, totalwork total_blocks, round(time_remaining/60) minutes FROM v$session_longops WHERE sofar <> totalwork;

Friday, February 14, 2014

PL/SQL: how to deal with nullable variables in query

where decode(column, variable, 0) is not null

Friday, January 17, 2014

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

Find the blocking session port, and then kill the process listening on that port.
SELECT O.OBJECT_NAME, S.SID, S.SERIAL#, P.SPID, S.PROGRAM,S.USERNAME,
S.MACHINE,S.PORT , S.LOGON_TIME,SQ.SQL_FULLTEXT 
FROM V$LOCKED_OBJECT L, DBA_OBJECTS O, V$SESSION S, 
V$PROCESS P, V$SQL SQ 
WHERE L.OBJECT_ID = O.OBJECT_ID 
AND L.SESSION_ID = S.SID AND S.PADDR = P.ADDR 
AND S.SQL_ADDRESS = SQ.ADDRESS;
[root@dwh1 ~]# netstat -ap | grep 22735
tcp        1      0 dwh1.prod.mbqt:ncube-lm     dwh1.prod.mbqt:22735        CLOSE_WAIT  19050/oracledwhmbqt 

[root@dwh1 ~]# kill -9 19050

VirtualBox: force guest IP address

> sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:B5:56:05
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=static
#IPADDR=192.168.2.8
IPADDR=192.168.1.101
NETMASK=255.255.255.0
TYPE=Ethernet
DNS1=8.8.8.8
DNS2=8.8.4.4
Then restart network
> sudo service network restart