2014-03-18

Boot Disk


diskpart
list disk
select disk ?
clean
create partition primary
select partition 1
active
format fs=ntfs quick label=”Win8-RP-x64”
  -- OR -- FS=FAT32
exit

(g: windows 8 DVD)
C:\Windows\system32>g:
G:\>cd boot
  Run "bootsect /help" for detailed usage instructions.

G:\boot>bootsect /nt60 e:
   Target volumes will be updated with BOOTMGR compatible bootcode.
   Bootcode was successfully updated on all targeted volumes.
G:\boot>exit

xcopy g:\*.* e:\ /E /H /F

-----------------------

bcd
bcdedit
bootcfg
fixboot
fixmbr
bootsect


=========================

fdisk
fdisk /mbr
format [/s]
sys

=========================

fdisk
mkfs.ext4

=========================

2014-03-17

GRUB2 multiboot ISO


GRUB2 multiboot ISO 2018 update

USB:
/boot/grub
/boot/iso
/boot/image
/boot/tc4
/boot/tc5
/boot/syslinux

get USB UUID & Label:
> blkid



/boot/grub.sh


/boot/grub/grub.env (1024byte)


/boot/grub/grub.cfg




/boo/grub/grub_hd.cfg (Harddisk)


/boo/grub/grub_fd.cfg (Floppy)



/boo/grub/grub_pe.cfg (Windows PE)

Linux:

/boo/grub/grub_tci.cfg (Tiny Core Linux)

/boo/grub/grub_sl.cfg (Slax)

/boo/grub/grub_u.cfg (Ubuntu)


/boo/grub/grub_d.cfg (Debian)


/boo/grub/grub_cd.cfg (CDLinux)


/boo/grub/grub_cr.cfg (ChromeOS)


/boo/grub/grub_s.cfg (openSUSE)


/boo/grub/grub_ce.cfg (CentOS)
* rdshell
method 1:
set rootopt="root=live:LABEL=CentOS-${ver}-${bit}-${live}"

boot into rdshell

1a: boot from RAM
# mkdir 1 2
# mount /dev/<usb partition> 1
# cp 1/boot/iso/<Centos ISO> 2
# umount 1
  (remove USB)
# exit

1b: boot from USB
# mkdir 1 2
# mount /dev/<usb partition> 1
# mount -o loop 1/boot/iso/<Centos ISO> 2
# exit

method 2:
set rootopt="root=live:${ISO_Path}/${iso}"

boot into rdshell

2a: boot from RAM
# mkdir -p boot/iso 1
# mount /dev/<usb partition> 1
# cp 1/boot/iso/<Centos ISO> boot/iso
# /init

2b: boot from USB
# mkdir -p boot 1
# mount /dev/<usb partition> 1
# ln -s /1/boot/iso /boot
# /init

2014-03-14

Tiny Core Linux QEMU

xorg-server-dev
gettext-dev
glib2-dev
sdl-dev

./configure --prefix=/opt/qemu/qemu --interp-prefix=/opt/qemu/gnemul/qemu-%M

make

make install

/opt/qemu/qemu/bin/qemu-system-i386 -m 128 -cdrom /Source/android/android-x86-4.4-RC1.iso

/opt/qemu/qemu/bin/qemu-img create /mnt/sdb1/vBox/Win8/hd.img 10G


Win8 x86:
qemu-system-i386 -m 1024 -cpu core2duo -cdrom 9600.16384.WINBLUE_RTM.130821-1623_X86FRE_ENTERPRISE_EVAL_ZH-TW-IRM_CENA_X86
FREE_ZH-TW_DV5.ISO


2014-03-13

Windows


Disable Zip:
regsvr32 /u %windir%\system32\zipfldr.dll
regsvr32 %windir%\system32\zipfldr.dll


HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop
ScreenSaveActive
ScreenSaverIsSecure
ScreenSaveTimeOut

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
NoRun
NoSaveSettings

CodePage
950 Big5
949 Korean
936 GBK
932 Shift-JIS
65000 UTF-7
65001 UTF-8
20936 GB2312
437 Eng

1250 — East European Latin
1251 — Cyrillic
1252 — West European Latin
1253 — Greek
1254 — Turkish
1255 — Hebrew
1256 — Arabic
1257 — Baltic
1258 — Vietnamese


MySQL


mysql -u xxx -p

show tables;


生肖 天干 地支

干支年每60年為一個周期,生肖每12年一個周期

天干 甲 乙 丙 丁 戊 己 庚 辛 壬 癸 甲 乙
地支 子 丑 寅 卯 辰 巳 午 未 申 酉 戌 亥
生肖 鼠 牛 虎 兔 龍 蛇 馬 羊 猴 雞 狗 豬

天干 丙 丁 戊 己 庚 辛 壬 癸 甲 乙 丙 丁
地支 子 丑 寅 卯 辰 巳 午 未 申 酉 戌 亥
生肖 鼠 牛 虎 兔 龍 蛇 馬 羊 猴 雞 狗 豬

天干 戊 己 庚 辛 壬 癸 甲 乙 丙 丁 戊 己
地支 子 丑 寅 卯 辰 巳 午 未 申 酉 戌 亥
生肖 鼠 牛 虎 兔 龍 蛇 馬 羊 猴 雞 狗 豬

天干 庚 辛 壬 癸 甲 乙 丙 丁 戊 己 庚 辛
地支 子 丑 寅 卯 辰 巳 午 未 申 酉 戌 亥
生肖 鼠 牛 虎 兔 龍 蛇 馬 羊 猴 雞 狗 豬

天干 壬 癸 甲 乙 丙 丁 戊 己 庚 辛 壬 癸
地支 子 丑 寅 卯 辰 巳 午 未 申 酉 戌 亥
生肖 鼠 牛 虎 兔 龍 蛇 馬 羊 猴 雞 狗 豬

Oracle


nls_date_language=american
set NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS
set NLS_LANGUAGE=AMERICAN
set NLS_LANG=AMERICAN.UTF8

@set NLS_LANG=Traditional Chinese_Hong Kong.ZHT16BIG5
@set NLS_LANG=Simplified Chinese_China.ZHS16CGB231280
@set NLS_LANG=Traditional Chinese_Hong Kong.UTF8
@set NLS_LANG=Simplified Chinese_China.UTF8
@set NLS_LANG=Traditional Chinese_Hong Kong.ZHT16BIG5

set NLS_LANG=American_America.UTF8

例:
・日本語(EUC)の場合
unix# setenv LANG 'ja'
unix# setenv LANG 'ja_JP.EUC'
unix# setenv NLS_LANG 'Japanese_Japan.JA16EUC'

・日本語(SJIS)の場合
unix# setenv LANG 'ja_JP.PCK'
unix# setenv LANG 'ja_JP.Shift_JIS'
unix# setenv NLS_LANG 'Japanese_Japan.JA16SJIS'

・日本語(UTF-8)の場合
unix# setenv LANG 'ja_JP.UTF-8'
unix# setenv NLS_LANG 'Japanese_Japan.UTF8'
unix# setenv NLS_LANG 'American_America.UTF8'

・繁体字中国語(Big5)の場合
unix# unset LANG
unix# setenv LANG 'zh_TW.Big5'
unix# setenv NLS_LANG 'Traditional Chinese_Hong Kong.ZHT16BIG5'

・簡体字中国語(GB2312)の場合
unix# unset LANG
unix# setenv LANG 'zh_CN.EUC'
unix# setenv NLS_LANG 'Simplified Chinese_China.ZHS16CGB231280'




===================================


set pagesize 10000
SET SQLBLANKLINES ON
SET SQLBLANKLINES OFF
SET SQLT[ERMINATOR] {;|c|ON|OFF}
set serveroutput on;

set verify off
column segment_name    format a25
column segment_type HEADING "Type"  format a12
column blocks HEADING "Allocated|Blocks" format 999999999
column Used HEADING "Consumed|Blocks" format 999999999
column p HEADING "Percent|Used"  format 999999999

==================================


select sysdate from dual;

===================================

set serveroutput on;
DECLARE
i integer;
begin
i:=1234;
delete from xxx1 where id in (i);
delete from xxx2 where id in (i);
delete from xxx3 where id in (i);
delete from xxx4 where id in (i);
end;
/


DECLARE
i integer;
j integer;
begin
select nvl(id, 999) into i from dual, xxx where id(+)=100000;
if SQL%NOTFOUND THEN
DBMS_OUTPUT.PUT_LINE('SQL%NOTFOUND: ');
END IF;
DBMS_OUTPUT.PUT_LINE('J: ' || i);
end;
/

set serveroutput on;
DECLARE
i integer(10);
begin
i := 0;

XXX(
'001','Remark',i
);
end;
/


BEGIN
DBMS_JOB.CHANGE(
job => 841,
next_date =>  to_date('22-12-2006 18:00:00','dd-Mm-yyyy HH24:MI:SS'),
interval => 'trunc(decode(sign(to_number(to_char(sysdate,''hh24mi''))-1730),1,sysdate+1,sysdate))+18/24',
what => NULL
);
END;
/


select
 trunc(decode(sign(to_number(to_char(sysdate,'hh24mi'))-1730),1,sysdate+1,sysdate))+18/24
from dual;

select
 trunc(decode(sign(to_number(to_char(to_date('2006-12-22 17:32','yyyy-mm-dd hh24:mi'),'hh24mi'))-1730),1,sysdate+1,sysdate))+18/24
from dual;

select to_char(sysdate,'hh24mi') from dual;


alter index xxx rebuild unrecoverable;
alter index xxx rebuild;
alter index xxx rebuild tablespace xxx;


UNDO:

 AS OF TIMESTAMP (TO_TIMESTAMP('2010-04-07 18:10:00', 'YYYY-MM-DD HH24:MI:SS'))

select status,last_update,update_by from xxx AS OF TIMESTAMP (TO_TIMESTAMP('2010-04-07 18:24:55', 'YYYY-MM-DD HH24:MI:SS')) where id=1234;