Monday, December 22, 2008

OpenVPN สามารถใช้งานหลัง NAT ได้ทั้งได้ Server และ Client

http://www.itdestination.com/articles/openvpn/

วิธีเพิ่ม RDP Listening Port ของ Terminal Server

How can I add a new RDP listening port to Windows 2000/2003 Terminal Server?

http://www.petri.co.il/add_a_new_rdp_listening_port_to_terminal_server.htm

Monday, December 15, 2008

Enabling the ISA Server 2004 VPN Server

การ set vpn ให้ connect จาก WindowsXP,2003,XP ไปยัง ISA Server ที่อยู่หลัง NAT ผ่าน PPTP หรือ L2TP ถ้า ISA Server มี IP จริงสามารถใช้ L2TP ได้แต่ถ้าไม่มี IP จริงแล้วใช้การ Forward port จะต้องใช้ PPTP แทน โดย forward port 1723 TCP มาที่ ISA ด้วย
http://www.isaserver.org/articles/2004vpnserver.html

Tuesday, December 09, 2008

Open Port for PPTP VPN

ถ้าต้องการใช้งาน PPTP ที่อยู่หลัง Firewall หรือ NAT ทำให้ไม่ได้รับ IP จริง จะต้องทำการ forward port หรือเปิด port ให้กับ port 1723 TCP จึงจะสามารถใช้งานได้

ส่วน L2TP VPN จะไม่สามารถใช้งานได้ถ้าอยู่หลัง NAT เพราะว่าจะต้องมี IP จริง

Tuesday, November 25, 2008

Remote Assistance for Corporate

ปกติแล้วการจะใช้งาน Remote Assistance นั้นจะต้องมีการ invite ก่อนเสมอ แต่สำหรับการใช้งานแบบ Helpdesk ภายในบริษัทนั้น เราสามารถใช้ GPO เข้ามาช่วยให้ไม่ต้องมีการ invite ก่อนก็ได้ โดยมีวิธีการดังนี้

1. ใช้ GPO ไปที่ Computer Configuration/Administrative Template/System/Remote Assistance และ Enable Offer Remote Assistance
2. เลือก Helper ที่จะสามารถ remote เข้ามาใช้งานหน้าเครื่องได้ โดยให้อยู่ใน format ดังนี้ DOMAIN\USERNAME โดยที่ User นั้นจะต้องเป็นสมาชิกของ Local Administrator
3. จากเครื่องของ Helper ให้ไปที่ Help and Support/Tool/Offer Remote Assistance แล้วใส่ IP หรือชื่อเครื่องที่ต้องการ Remote เข้าไป
4. ที่หน้าเครื่องของ user จะมี popup ขึ้นมาให้ถามว่าจะยอมให้ remote เข้ามาควบคุมหรือไม่

NOTE
- ยังไม่ได้ทดสอบให้แน่ใจ หลายๆอย่าง เช่น การ block remote assistance , firewall
- ถ้า user ที่ไม่ได้อยู่ใน list ของ helper เวลา remote ไปจะขึ้นว่า Permission Denied
- เครื่องที่ connect เข้าไปถ้าไม่ได้อยู่ใน domain เดียวกัน จะไม่สามารถ remote เข้าไปได้
- ใน helper list สามารถเพื่ม group ก็ได้ ไม่จำเป็นจะต้องเป็น user เท่านั้น เช่น DOMAIN\administrators ก็ได้เหมือนกัน
- GPO ที่อยู่ติดกับ Offer Remote Assistance ก็คือ Solicited Remote Assistance เราสามารถ Disable เอาไว้ได้ ไม่มีผลต่อการใช้ Remote Assistance ใน Corporate
- เมื่อ Enable Offer Remote Assistance ใน GPO แล้วจะทำให้ตัวเลือกของ Remote Assistance ที่อยู่ใน tab Remote ของ System ได้ถูก Enable เอาไว้ด้วย แต่ยังไม่ได้ลองว่า user จะสามารถส่ง Invite ออกไปทาง Msn หรือทาง Email ได้หรือเปล่า

http://www.petri.co.il/enable_remote_assistance_offering_in_xp_2003.htm
http://www.petri.co.il/offer_remote_assistance_in_windows_xp.htm

Sunday, November 02, 2008

Event ID 7000 (Service Control Manager Timeout)

To work around this problem, increase the default timeout value for the service control manager in the registry.


To increase the timeout value in the registry, follow these steps:


If the ServicesPipeTimeout value is not available, add the new DWORD value, and then set its value data to 60000 in the Control key. To do so, follow these steps: a. Locate and then click the following registry key:


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet

b. Click the Control subkey.

c. On the Edit menu, point to New, and then click DWORD Value.

d. Type ServicesPipeTimeout, and then press ENTER.

e. Right-click the ServicesPipeTimeout DWORD value, and then click Modify.

f. Click Decimal.

g. Type a value of 120000, and then click OK.

The value is 120000 milliseconds and is equivalent to 120 seconds or to one minute.


Note This change does not take effect until the computer is restarted.

Wednesday, August 27, 2008

Iphone Installer / Cydia Repositories

http://xsellize.com/installer

Tuesday, August 26, 2008

Arcserve Job Script and Job Template

Job Scripts

You can save any type of job as a script. The script contains the source, destination, and options that you selected, as well as the schedule information. It also contains any filters you created to include and exclude files and directories.

Creating a script has the following advantages:
1. You can re-use the same settings at a later time.
2. You can copy your settings to a different network machine running BrightStor ARCserve Backup.
3. You can quickly resubmit regularly executed jobs after a job has been accidentally deleted.

To use a script, go to the Job Status Manager and use the Add Job button. When you specify the job script name, all of the information that you set when you saved the job script will be used, including the files and directories and the scheduling information.

Create and Use Job Scripts

To create a script, perform the following procedure:
1. Set up the job.
Select the source, destination (if required), scheduling method, and any options or filters.
2. Click Start.
3. Fill in the requested security (and for backups, agent) information.
4. When the Submit Job dialog appears, click Save. (ปุ่ม save job ที่อยู่ทางด้านขวามือ ของ Dialog)
The Save Job Script dialog appears.
5. Give the script a name.
BrightStor ARCserve Backup scripts are stored in the BrightStor ARCserve Backup home directory by default, extension ".asx". You can specify a different directory in which to save your script. You can also provide a job description in the edit text box.
6. Click Save.

Note: You can also save job scripts using the Save or Save As options from the File menu.
To use a script, perform the following procedure:
1. Open the Job Status Manager.
2. Click Add Job. (ไม่ได้อยู่ใน menu แต่ให้ click ขาวในหน้า Job Status)
3. Specify the script file name.

Job Templates

A job template contains a series of settings such as the destination, options, and schedule information for the job. Similar to job scripts, a template can also contain any filters you created to include and exclude files and directories.

Job templates are different from job scripts because they provide the flexibility to repeat custom backup schedule settings on other BrightStor ARCserve machines. Because the job template does not retain the backup source information as the job script does, the template files can be copied and applied to any new server source running BrightStor ARCserve Backup. Job scripts, on the other hand, cannot be modified to accommodate new server sources.

You can choose from seven default job templates or you can create a custom template to meet your individual backup needs. The default job templates are designed to meet specific backup tasks such as rotation scheme, backup method, and GFS options. The default job templates can be accessed from the File menu when you choose the Open Job Template option.

Create Job Templates

You can create a custom job template that you can save for future jobs on any BrightStor ARCserve Backup machine.

To create a job template:
1. Open the Backup Manager by selecting Backup Manager from the Quick Start menu.
2. Make selections for your backup job by accessing the Source, Destination, and Schedule tabs.
3. Submit your job by clicking the Start button.
4. Click Save Template in the Submit Job dialog box to save your new job template with an .ast filename extension.

While default job templates are stored in the Templates/Jobs folder in the BrightStor ARCserve Backup directory, you can save your template in any directory you want. To open your custom job template on a local machine or from a remote server, access the File menu and choose the Open Job Template option. Once the job template is open, you can submit your job.

Zyxel Backup and Restore Config

ftp to zyxel with user root
for backup get rom-0
for restore put rom-0
zyxel will auto reboot

all information include ip address and user/password will change to new config

Thursday, August 07, 2008

ท่อ PVC

ท่อ PVC ให้ใช้ยี่ห้อท่อน้ำไทย

ท่อเดินเมนทั่วไป ชั้น 8.5 ขนาด 2 นิ้ว
ท่อเดิน ขึ้นบ้านทุกจุด 1 นิ้ว
พอจะออกมาที่ จุดก๊อก จึงลดโดยใช้ข้อลดเหลี่ยม
จาก 1 เป็น 1/2 นิ้วครับ

จุดที่มีการเปลี่ยนจากท่อ PVC เป็นเหล็ก
ต้องใช้ข้อต่อเกลียวใน แบบทองเหลือง ฝังในตัว PVC ครับ

ท่อน้ำทิ้ง ชั้น 5 ขนาด 2 นิ้ว
ท่อส้วม ชั้น 5 ขนาด 4 นิ้ว

ชั้น 8.5 หมายถึง ทนแรงดันได้ 8.5 kg/ ตารางซม. ครับ
ชั้น 5 หมายถึง ทนแรงดันได้ 5.0 kg/ตารง ซม. ครับ

ทุกๆ 1 kg หมายถึง เท่ากับ แรงดันที่เกิดจากน้ำสูง 10 เมตรครับ
ดังนั้น 8.5 หมายถึง ทนแรงดันได้ เท่ากับ การตั้งแท้งค์น้ำไว้สูง 85 เมตรครับ
ซึ่งยังไม่เห็นมีใครทำ

อย่างมาก 25 เมตรก็สูงลิบแล้ว

(ยกเว้นอาคารใหญ่ๆ) จะเป็นระบบท่ออีกอย่างหนึ่ง

เครดิต น้าพร@pantip

Tuesday, July 22, 2008

Note for Receriver

Astro ทอง ใช้ encryption แบบ NDS Version 1 หรือบางทีเรียกว่า VideoGuard

LNB ของ Astro เป็นแบบ Universion คือ LO = 09750 , HI = 10600, Threshold = 11700
LNB ของ UBC ใช้ LO/HI = 11300 , Threshold = 11700
LNB ของ C-band ใช้ 05150 ทั้ง LO/HI , Threhold = 11700

Tuesday, May 27, 2008

How to convert an IP address from the firewall log into a dotted IP address.

แบบที่ 1

SELECT
CAST(SourceIP / 256 / 256 / 256 % 256 AS VARCHAR) + '.' +
CAST(SourceIP / 256 / 256 % 256 AS VARCHAR) + '.' +
CAST(SourceIP / 256 % 256 AS VARCHAR) + '.' +
CAST(SourceIP % 256 AS VARCHAR) AS [Nice Source Ip], FirewallLog.*
From FirewallLog

แบบที่ 2 สร้าง Function เอาไว้ให้เรียกใช้งานได้ง่าย

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

CREATE FUNCTION [dbo].[ConvertLongIP]
(
@LongIP bigint
)

RETURNS varchar(15)
AS
BEGIN

DECLARE @DotIP varchar(15),
@bin varbinary(4)
select @bin = cast(@LongIP as varbinary(4))
select @DotIP = cast(convert(int,substring(@bin,1,1)) as varchar(3)) + '.'
+ cast(convert(int,substring(@bin,2,1)) as varchar(3)) + '.'
+ cast(convert(int,substring(@bin,3,1)) as varchar(3)) + '.'
+ cast(convert(int,substring(@bin,4,1)) as varchar(3))
RETURN @DotIP
END

การลบข้อมูลใน SQL 2005 ที่เก่ากว่า 90 วัน

แบบที่ 1
DELETE FROM WebProxyLog where LogTime < (getdate() - 90) DELETE FROM FirewallLog where LogTime < (getdate() - 90) แบบที่ 2 ดีกว่า ลบได้แน่นอนกว่า delete from firewalllog where datediff(dd,logtime,getdate()) > 90
delete from webproxylog where datediff(dd,logtime,getdate()) > 90
select logtime from firewalllog where datediff(dd,logtime,getdate()) > 1

ได้ผล แต่ต้องรอ 2 วัน ดีกว่าการใช้ แบบที่ 1

ถ้าใช้ SQL Express Edition ที่ไม่มี Scheduler จะต้องใช้ Schedules Tasks ของ Windows แทนเช่น
sqlcmd -S .\ISALOG -d ISALOG d:\ISALOG\cleandatabase.sql
แล้วค่อยใส่คำสั่ง delete from ... ลงไปในไฟล์ cleandatabase.sql

-S = ชื่อ server , . หมายถึง localhost , \ISALOG คือชื่อ Instant
-d = ชื่อ database
-i = ชื่อ sql script

http://msdn.microsoft.com/en-us/library/aa258269(SQL.80).aspx

Monday, May 26, 2008

วิธี Block MSN หรือ Windows Live Messenger

Concept ใช้ได้กับ Firewall เกือบทุกตัว
ให้ Block MSN protocal ที่ใช้ port 1863 เพื่อเป็นการบังคับให้ MSN เปลี่ยนไปใช้ port 80 HTTP จากนั้นค่อยทำการ block signature ของ MSN นั่นก็คือการ Block Request URL ที่มี string gateway/gateway.dll เป็นส่วนประกอบ

การ Block Signature โดยใช้ ISA Firewall
1. ไปที่ rule ที่มี http protocal รวมถึง rule ที่ยอมให้ออกหมดทุก protocal (ทุก protocal หมายถึง ทุกอันที่ define เอาไว้ใน protocal definition ดังนั้นจึงรวม http protocal เข้าไปด้วย) แล้ว click ขวาเลือก Configure HTTP
2. ไปที่แถบ Signature กดปุ่ม Add ใส่ข้อมูลตามนี้
Name = Block MSN
Search in = Request URL
Signature = gateway/gateway.dll


Note
สรุป port และ URL ของบริการที่ MSN ใช้
http://support.microsoft.com/kb/927847

Tuesday, May 20, 2008

ISA 2004/2006 logging using local SQL 2005

การ Config ในส่วนของ SQL Server

- Install Microsoft SQL 2005 Express Edition
- ปัจจุบันออก SP3 แล้ว จะรวมมาใน package เลย
- ในหน้า Registration Information ให้เอา checkbox Hide advace configuration option เพื่อให้สามารถตั้งชื่อ Instant ได้ให้ชื่อว่า ISALOG
- Service Account ให้เลือกเป็น Local System ตรงนี้สำคัญมากว่าจะต้องทำให้ User ที่ใช้ run service ISA Firewall กับ SQL2005 เป็น User เดียวกันไม่งั้นจะ start SQL Log ไม่ได้ ในเวป isaserver.org เป็นกรณีที่ SQL Server เป็น Server คนละตัวกับ ISA Firewall แต่ในกรณีนี้เราต้องการให้อยู่บน server เดียวกัน ดังการการ setting จึงต่างกันนิดหน่อย
- เลือก Windows Authentication Mode
- Add User to the SQL Server Administrator Role จะเป็นการเพื่ม user ที่เป็นคน install sql 2005 ให้อยู่ใน administrator role ของ SQL 2005 จะเลือกหรือไม่ก็ได้ (เลือกเอาไว้ดีกว่า)
- หลังจาก Install เสร็จแล้ว ให้ไปดูที่ Service ของ Microsoft Firewall และ SQL Server (ISALOG) run ด้วย user เดียวกันคือ Loal System ถ้าไม่ตรงก็เปลี่ยนให้ตรงกัน
Note ถ้ามีปัญหา start SQL ไม่ได้แล้วถ้าไปดูใน eventlog จะเห็นว่า error มันเกิดจากการที่ user ที่ใช้ run service ไม่ผ่าน มันไม่ได้เป็น user เดียวกับที่ไปกำหนดให้ใช้ในตอน config log ของ ISA ด้วย สังเกตุได้จากในขั้นตอนนั้นใส่ user อะไรไปก็จะ Test ผ่านหมด
- Install Microsoft SQL Server Management Studio Express
- เปิด SQL Studio Express ขึ้นมาเพื่อสร้าง Database ISALOG เอาไว้ที่ Drive D: (ถ้าไม่กำหนดเอง มันสร้างไว้ที่ Drive C:) เพราะว่าต้องเก็บ log เอาไว้ 90 วันตามพรบ ใช้เนื้อที่มาก
- ที่ Object Explorer แตกออกมาให้เห็น Database แล้ว Click ขวาเลือก New Database ตั้งชื่อ Database = ISALOG
Owner = NT AUTHORITY\SYSTEM
Path = D:\ISALOG
- สร้าง Table FirewallLog และ WebProxyLog ขึ้นมาให้อยู่ใน Database ISALOG โดยใช้ script FWSRV.SQL และ W3PROXY.SQL ที่มีมาให้อยู่แล้วใน ISA2006 folder
- ไปที่ Menu File/Open แล้วเปิด fwsrv.sql และ w3proxy.sql พิมพ์เพิ่มเข้าไปข้างบนว่า
USE ISALOG
เพื่อเป็นการบอกให้สร้าง table เอาไว้ใน Database ISALOG แล้วสั่ง Execute
- ย้อนกลับไปดูใน Datbase ISALOG จะเห็นว่ามี table เพิ่มขึ้นมา 2 table คือ dbo.firewalllog และ dbo.webproxylog
- เปิด SQL Server Surface Area Configuration ขึ้นมาแล้วไปที่ Remote Connection เปลี่ยนจาก Local connection only เป็น Local and remote connection -> Using TCP/IP only
- เปิด SQL Server Configuration Manager ขึ้นมา ไปที่ Protocal for ISALOG -> ICP/IP = Enable
ไปแถบ IP Address แล้ว Enable ทุก IP Address , ลบ Dynamic Port ออกให้ว่างๆ, TCP Port ใส่ 1433 ทุกอัน , Enable = Yes ทุกอัน
- OK แล้ว Restart SQL Service
- ไม่จำเป็นต้อง assign permission อะไรใน Database ISALOG เพราะ system สามารถเขียนข้อมูลลงไปได้อยู่แล้ว

การ Config ใส่ส่วนของ ISA Server

- เปิด Edit System Policy(อยู่ใน Task Pane ของ Firewall Policy)/ Logging/ Remote Logging /
แถบ General -> Enable this configuration group
- ไปที่ Monitoring /Logging /Configure Firewall Loggin เลือก SQL Database / Option
Server = ชื่อของ ISA Firewall
Port = 1433
Database = ISALOG
Table = FirewallLog (หรือ WebProxyLog)
Uncheck Force data encryption เพราะเราใช้ Local Database ไม่ใด้ใช้ Remote Database
เลือก Use Windows authentication
User = อะไรก็ได้ ไม่มีผลเพราะใช้งานโดย Local System
Password = อะไรก็ได้ ไม่มีผลเพราะใช้งานโดย Local System
กด Test จะผ่าน

Testing
- เปิด SQL Studio Express ขึ้นไปแล้วไปที่ New Query พิมพ์ว่า
select * from dbo.firewalllog แล้วกดปุ่ม Execute จะเห็น log ที่เก็บไว้
- ทดสอบ Webproxylog พิมพ์ว่า
select * from dbo.webproxylog
- อย่าลืมให้เลือก Database ISALOG ตรง Dropdown ด้านซ้ายบนด้วย ไม่งั้นจะ error เพราะว่ากลายเป็นการ query จาก database อื่น

Note

- ISA 2004 ใช้ ODBC แต่ ISA 2006 ใช้ Direct Access to SQL
- อย่าทำ Compress Disk กับ drive ที่เก็บ data file ของ SQL เพราะจะทำให้ performance ตกลง 500%
- เว็ปที่มีประโยชน์เกี่ยวกับ ISA อีกเวปนึง
http://www.elmajdal.net/ISAServer/

Thursday, May 15, 2008

GFI Webmonitor V.4

White List - จะ bypass กฎทุกอย่างเช่น block hi5 แต่ถ้าใส่ user ที่ไม่ต้องการ block เอาไว้ใน white list แล้วจะเข้าได้ หรืออาจจะสามารถใส่ ip หรือ hostname ของ site ที่ต้องการเข้าก็ได้เช่น *.google.com, *.yahoo.com จะทำให้ site พวกนี้ผ่านกฎทุกกฎ ดังนั้นให้ใช้อย่างระมัดระวัง

Black List - ถ้ามีชื่ออยู่ใน black list จะห้ามทุกอย่าง

Web Filtering Policies - สามารถ Edit ได้ว่าต้องการให้ Filter content ไหนออกไปได้บ้าง อาจจะนำมาใช้กับ MSN ก็ได้(ไม่ได้ผลลองแล้ว) โดยทั่วไปจะใช้ไม่ให้เข้าเวปพวกที่มี Adult Content

Download Control Policies - สามารถเอาไว้ block ไม่ให้ download ไฟล์บางประเภทได้โดยดูจาก Content-type อาจจะเอามาประยุกต์ใช้ไม่ให้ download ไฟล์บางนามสกุลได้

Virus Scanning Policies - สามารถไปกำหนดให้ Scan Virus กับไฟล์ประเภทไหนบ้าง แล้วขึ้นจะให้ขึ้น Download Status Windows หรือเปล่า ถ้าเจอ Virus จะให้ทำยังไงเช่น delete หรือ warn

Whitelist = *.eset.com สำหรับ update nod32
Blacklist = *.hi5.com

Saturday, May 10, 2008

Schedule Task

ใน Run As ให้ใช้ NT AUTHORITY\SYSTEM โดยที่ไม่ต้อง set password จะทำให้ใช้ได้ตลอด ไม่ต้องกังวลเรื่องที่จะเปลี่ยน pasword แล้ว task ไม่ยอม run

Wednesday, April 30, 2008

SM Bus Controller Driver Download

SM Bus Controller
ต้องลง Intel® Chipset Software Installation Utility สามารถ download ได้จาก http://downloadcenter.intel.com/Product_Filter.aspx?ProductID=816

สำหรับ Sound Driver
Hotfix KB888111 UAA สำหรับ SP3 ยังไม่มี ต้องใช้ของ SP2 ไปก่อนโดยไปหลอกให้เห็นเป็น SP2 โดยการแก้ registry key HKLM\SYSTEM\ControlSet001\Control\Windows\CSDVersion = 200 จาก 300 แล้วค่อย install KB888111 สำหรับ SP2 แล้วค่อย install audio driver

Saturday, April 26, 2008

ISA2006 Backup and Restore

Backup ทั้งหมด

Export
1. เปิด ISA Server Management ขึ้นมา แล้ว right click ที่ ชื่อ ISA Server เลือก Export (Backup) ทำตาม Wizard
2. ถ้าต้องการ export user passwd ที่ได้มีการ set ไว้ใน ISA จะต้องติ๊กที่ Export confidential infomation ด้วย เพื่อให้เราใส่ passwd ในการ encrypt ข้อมูลเหล่านี้เพื่อความปลอดภัย
3. ถ้ามีการ set user เพื่อ delegate จะต้องเลือก Export user permission settings ด้วย

Import
1. การ import ก็ทำคล้ายกัน แต่จะมี option ให้เลือกว่าจะ Import หรือ Overwrite(restore)
- import ข้อมูลที่ import เข้ามาจะถูกเพื่มเข้าไปเข้าไปใน configuation (ข้อมูลปัจจุบันไม่หายทั้งหมด)
- overwrite(restore) จะเข้าไปทับข้อมูลปัจจุบันทั้งหมด(ข้อมูลปัจจุบันหายหมด) เอาไว้ใช้ในกรณีที่ ISA พัง

Note
ข้อมูลที่ Export ออกมาไม่สามารถเอาไปใช้ข้าม version กันได้เช่นระหว่าง Standard กับ Enterprise ใช้กันไม่ได้

Backup แค่บางส่วน
ให้เลือก object ที่ต้องการ backup แล้ว right click เลือก import/export หรืออาจจะเลือกจาก Task Pane ก็ได้

Monday, April 21, 2008

วิธีใช้ Windows Server 2008 แบบไม่หมดอายุ

1. เวลา Install ไม่ต้องใส่ Cdkey และ Disable Auto Activate
2. Disable Service SL UI Notification เพื่อจะได้ไปสามารถลบไฟล์ออกได้
3. Take Ownership ของไฟล์เหล่านี้
c:\windows\system32\SLLUA
c:\windows\system32\SLUI
c:\windows\system32\SLUINotify.dll
4. Restart และลบไฟล์เหล่านี้ออก หรือถ้าสามารถลบออกได้โดยไม่ต้อง Restart ก็ลบไปเลย
5. Restart และทดสอบโดยการตั้งเวลาล่วงหน้าไป 1 ปี และลอง Restart อีกที แล้วลองเข้า Windows Update ถ้าทำได้ปกติ ก็แสดงว่าผ่าน

Friday, April 18, 2008

Oracle Backup

การ Backup แบ่งเป็น

1. Logical Backup
คือการ export ข้อมูล ออกมาเก็บไว้ใน dump file ข้อดีคือง่าย และไม่ต้องปิดการใช้ฐานข้อมูลขณะที่ export ปกติจะ export ข้อมูลทั้งหมดของ user แต่สามารถเลือกให้ backup ทั้ง databast หรือแค่บาง table ก็ได้

ตัวอย่างคำสั่งที่ใส่ไว้ใน batch file เช่น

exp userid=[user]/[passwd] file=[database.dmp] log=[logfile.log] rows=y

"E:\Oracle Backup\rar.exe" a -df -m5 -agYYYY-MM-DD .\Backup\ *.dmp

2. Physical Backup
เป็นการ backup ไฟล์ที่ประกอบเป็นฐานข้อมูลจริงๆ ซึ่งประกอบไปด้วย
- Control File
- Data File
- Redo Log File
- Parameter File
- Password File
- Archive File
แบ่งออก 2 แบบ คือ Cold Backup กับ Hot Backup

Cold Backup หรือ Full Backup
ประกอบด้วย 3 step คือ
1. shutdown oracle ด้วย utillity ที่ชื่อว่า svrmgrl (สำหรับ oracle8i แต่ถ้าเป็น oracle9i จะสั่งจาก SQL*Plus ซึ่งจะต้อง login ด้วย role sysdba ซึ่งเปรียบเสมือน root ของ oracle มีสิทธิ์ทำได้ทุกอย่าง)
EX
SVRMGR> connect internal (เปรียบเสมือน root ของ oracle8i )
default password of internal = oracle
SVRMGR> shutdown immediate หรือ shutdown normal

2. copy file ฐานข้อมูลต่างๆข้างบนไปเก็บไว้ในที่ปลอดภัย
EX
copy oracle_file backup_media
อย่าลืมจด path ของไฟล์เหล่านั้นเอาไว้ด้วย เวลา restore คืนจะได้เอาไปใส่ไว้ได้ถูก path

3. startup oracle
EX
SVRMGR> startup

Hot Backup
เป็นการ copy file คล้ายกับ cold backup แต่ไม่ต้อง ปิดฐานข้อมูลก่อน แต่วิธีทำจะซับซ้อนกว่า และสามารถใช้กับฐานข้อมูลที่ทำงานแบบ Archive Mode ได้เท่านั้น

1. สั่งเริ่มต้นการทำ Hot Backup ของ tablespace โดยใช้คำสั่ง
SVRMRG> alter tablespace tablespace_name begin backup;
2. คัดลอกไฟล์ของ tablespace ที่สั่งทำ backup ไปเก็บไว้ยังดิสก์สำหรับสำรองข้อมูล โดยใช้คำสั่ง copy
3. สั่งหยุดการทำ Hot Backup ของ tablespace โดยใช้คำสั่ง
SVRMRG> alter tablespace tablespace_name end backup;
4. สั่งให้ฐานข้อมูล switch log file เพื่อให้เกิดการทำ checkpoint ขึ้นในฐานข้อมูล
SVRMRG> alter system switch logfile;

วิธีการหาที่อยู่ของไฟล์ที่ต้อง Backup

1. Data File
select file_id,file_name from dba_data_file;
หรือ
select file#,name from v$datafile;
2. Control File
select name from v$controlfile;
หรือ ดูจากไฟล์ initSID.ora ซึ่งเป็น parameter file ของฐานข้อมูลก็ได้ ตรงบันทัด CONTROL_FILE
SID คือ System Identifier หรือชื่อของฐานข้อมูล เช่นถ้าเรามี database ชื่อ SUN ก็จะมีชื่อ control file ว่า initSUN.ora
3. Redo Log File
select group#, member from v$logfile;

4. ดูว่ามีฐานข้อมูลอะไรบ้าง และสามารถทำ hot backup ได้หรือไม่
select name, created, log_mode from v$database;
ถ้า log_mode = archivelog แสดงว่าสามารถทำ hot backup ได้
ถ้า log_mode = noarchivelog แสดงว่าทำ hot backup ไม่ได้

5. ดูว่ามีไฟล์อะไรที่ถูกสั่งทำ hot backup บ้าง
select * from v$backup;

Note
- view จะขึ้นต้นด้วย v$ สามารถดูได้จาก Oracle Enterprise Manager (OEM) ใน Schema SYS ว่ามี view อะไรบ้าง เช่น v$parameter , v$pwfile_users, v$tablespace เป็นต้น
- OEM สามารถใช้ดูว่าใน oracle มี database อะไรอยู่บ้าง และใน DB นั้นมี user , tablespace, schema อะไรอยู่บ้างได้
- เราสามารถใช้ OEM ช่วยในการดูตำแหน่งของไฟล์ต่างๆได้ง่ายขึ้นเช่น
control file ดูได้จาก Storage/Controlfile
datafile ดูได้จาก Storage/Tablespaces/ชื่อของ tablespace ซึ่ง 1 tablespace อาจจะประกอบไปด้วยหลายๆไฟล์ก็ได้ , ต่างนามสกุลกันก็ได้
Redo Logfile ดูได้จาก Stroage/ Redo Log Groups

Tuesday, April 08, 2008

Zyxel add forward port more than 12 rules

โดย Default แล้วสามารถตั้งค่า forward port ใด้ใน Web Admin หรือ SMT คือ 12 rules แต่ถ้าใช้ CI จะสามารถ set ได้ถึง 24 rules ต่อ 1 server set มีได้ทั้งหมด 10 server set และสามารถ set ค่าได้แบบละเอียดคือ

- สามารถตั้งชื่อ rule ได้ -> คำสั่ง rulename เช่นเวป config จะเห็น rule แรกที่มีชื่อว่า DMZ อันเดียว
- Server Port Range -> คำสั่ง svrport
- Server IP -> คำสั่ง forwardip
- Internal Server Port Range -> คำสั่ง intport ไม่ได้ใช้
- Remote Host IP Range -> คำสั่ง remotehost ไม่ได้ใช้
- Lease Time
- Protocal

ตัวอย่างการตั้งค่า rule ที่ 13 ให้ forward port 3390 ไปที่ ip 192.168.15.1

ras> ip nat server load 1 # load server set 1
ras> ip nat server disp 1 # display rule of server set 1
ras> ip nat server edit 13 forwardip 192.168.15.1 # add forward to server 192.168.15.1
ras> ip nat server edit 13 svrport 3390 3390 # add server port 3390
ras> ip nat server edit 13 active yes # enable rule
ras> ip nat server save # ไม่ค่อยแน่ใจว่าทำเสร็จแล้วต้อง save หรือเปล่า
ถ้าไม่ได้ต้องใช้ autoexec.net
ถ้าทำผิดต้องการยกเลิกสั่ง
ras> ip nat server edit 13 clear # ล้างบันทัดที่ 13 ทั้งหมด ต้องทำใหม่ตั้งแต่ต้น

Sunday, March 30, 2008

FXS and FXO

FXS = Foreign eXchange Subscriber
เป็นส่วนเชื่อนต่อที่มีคุณสมบัติต่อไปนี้
1. มี Dial Tone
2. มี Battery สำรองไฟ
3. มีกระแสไฟของสัญญาณ Ringing ซึ่งจะถูกส่งมาจากชุมสายโทรศัพท์
บางครั้งจะเรียกว่า Plug on the wall หรือช่องต่อโทรศัพท์ที่มีอยู่ตามผนังนั่นเอง

FXO = Foreign eXchange Office
เป็นส่วนเชื่อมต่อที่มีอยู่บนตัวเครื่องโทรศัพท์ โดยจะรับสัญญาณที่มาจาก FXS เพื่อทำหน้าที่ในการ On Hook หรือ Off Hook เพื่อให้สัญญาณโทรศัพท์ที่ส่งมานั้นครบวงจร

การที่จะทำให้ระบบโทรศัพท์ใช้งานได้จะต้องมีการเชื่อมต่อระหว่าง FXS ที่มาจากชุมสายโทรศัพท์ หรือ PABX มาเชื่อมต่อเข้ากับ FXO ของเครื่องโทรศัพท์

การเชื่อมต่อที่ผิดเกิดจากการที่นำ FXS มาต่อกับ FXS หรือ FXO มาต่อกับ FXO เช่นการนำเครื่องโทรศัพท์ 2 เครื่องมาต่อกัน จะไม่สามารถใช้งานได้

ปกติแล้ว PABX จะแบ่งออกเป็น 2 ส่วนคือ
1. CO Line หรือสายนอก มีคุณสมบัติเป็น FXO Interface เอาไว้ใช้เชื่อมต่อกับสายนอกที่มาจากชุมสาย (FXS)
2. Extension หรือ สายใน ซึ่งเป็น FXS Interface เพื่อให้เครื่องโทรศัพท์ภายใน office มาต่อและสามารถใช้งานได้

VOIP Phone Adapter
เช่น Linksys PAP2T (2 FXS) จะใช้ได้กับ 2 หมายเลข ใช้กับเครื่องโทรศัพท์แบบทั่วไปได้

Voice Gateway
จะเหมือนกับ VoIP Phone Adapter เพียงแต่สามารถรองรับได้หลายหมายเลขกว่าเช่น 4 ports , 8 ports จะแยกเป็น FXO , FXS ขึ้นอยู่กับการใช้งาน เช่น Linksys SPA 3102

ไม่แน่ใจ
- fxs จะเอามาต่อกับ card ที่รับสายนอก(fxo) ของ pabx เพื่อเวลาโทรออกจะได้ออกจาก voip เสมือนว่า fxs เป็นสายนอกอีกอันหนึ่ง
- fxo จะเอามาต่อกับ card สายใน (fxs) ที่ออกจาก pabx เสมือนกับเป็นสายในหมายเลขหนึ่ง

Thursday, March 06, 2008

การเพิ่ม Custom Time Server เข้าไปในแถบ Internet Time ของ Windows XP, 2003

ไปที่ Register Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers
เพิ่ม String Value = 3 ใส่ค่า pool.ntp.org
Default = 3

Monday, March 03, 2008

การใช้ KIS Block Internet Explorer

Kaspersky Internet Security V.6.0

เป็นการใช้ Firewall ใน Anti Hacker / Setting/ Rule of Applications/
เลือก iexplorer กดปุ่ม Edit ตรง HTTP, HTTPS ให้เปลี่ยนจาก Allow ไปเป็น Block

การตั้ง Exclude สำหรับ File Anti-Virus
อยู่ที่ Protection กด Setting / Trust Zone/ Exclusion Mask
ใส่ชื่อไฟล์หรือ folder ลงไปก็ได้ จะใส่แบบ Absolute หรือไม่ก็ได้ สามารใช้ widecard ร่วมด้วยก็ได้ เช่น
- ทุกๆไฟล์ที่อยู่ใน folder work ของทุกๆ folder ใส่เป็น work\*.*
- abc.* หรือ abc.12* ก็ได้

Group Policy Disable Error Reporting

Using GPO

Computer Configutation/Administrative Templates/Error Reporting
Display Error Notification = Disable
Advanced Error Reporting settings/Report operating system errors = Enable

Manual Setting

Control Panel/System/Advanced/Error Reporting

Saturday, March 01, 2008

การแก้ปัญหา Arcserve Backup Incomplete

Backup Incomplete

เกิดจากการที่ backup บางไฟล์ไม่สำเร็จ เนื่องจากโดน lock เอาไว้ แก้ได้โดยการใช้ Filter ที่อยู่ในหน้า backup เพื่อทำการ exclude ไฟล์ที่มีปัญหาออกไป โดยการ click ขวา แล้วเลือก Filter เลือก File Pattern หรือ Directory Pattern แล้วใส่ path เต็มๆของ file หรือ folder ลงไป เช่น ไฟล์ d:\work\mywork.txt หรือ folder d:\work

Note
- สำหรับ Directory Pattern นั้น ห้ามใส่ \ ปิดท้ายโดยเด็ดขาด เช่นห้ามใส่ว่า d:\work\

Saturday, February 23, 2008

Startup Delayer (Freeware)

มีประโยชน์มากเอาไว้ตั้งเวลา Delay startup program ตอน boot เครื่อง เช่นต้องรอให้โหลดอะไรบางอย่างเสร็จก่อนถึงจะ start program ได้

Saturday, January 26, 2008

Hostname Logger v 1.2 for ISA Server

ไม่ต้องเสียเงินซื้อ loghostname แล้วครับ มีให้ใช้ฟรีๆ ที่นี่เลย
http://www.elmajdal.net/ISAServer/HostLogger.aspx
http://www.elmajdal.net/ISAServer/

client ที่เป็น Secure Nat จะใช้ block Domain Name กับ URL Set ไม่ได้ผล เพราะ Secure Nat มันจะไม่ resolve IP ไปเป็น domain name ให้

Tuesday, January 22, 2008

Auto Logon with Domain Account

ปกติแล้วเครื่องที่เป็นสมาชิก Domain จะถูก Disable Auto Logon เอาไว้อยู่แล้ว จะต้องไปแก้ไข Registry HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

AutoAdminLogon = 1

DefaultDomainName = <ชื่อ Domain ของเราในแบบ Netbios> ### ก็คือที่แสดงอยู่ใน dropdown ที่จะให้เลือกตอน Logon นั่นเอง

DefaultUserName = <ชื่อ User ที่จะให้ Auto Logon> ### จะต้องเป็น Blank Password

Note
บางทีถ้าเปลี่ยน DefaultDomainName แล้วอาจจะทำให้ค่า AutoAdminLogon reset กลับไปเป็น 0 ได้ จะต้องเข้ามาทำซ้ำอีกครั้ง

เสร็จแล้วสั่ง RUN > control userpasswords2 แล้วเพิ่ม Domain User ที่ต้องการให้ Auto Logon เข้ามา
เลือก Group Membership ให้เป็น Administrators (ของ Local Computer) ทดสอบด้วยการ Restart

Note
- ถ้าต้องการให้ Autorun โปรแกรมหลังจากที่ Logon เสร็จสามารถทำ Shortcut ไปใส่เอาไว้ใน Startup ของ User นั้นๆได้

- ควรเพิ่มความปลอดภัยให้กับ User นี้โดยการกำหนด Workstation ที่จะสามารถ Logon ได้โดย Logon to Workstation และ User cannot change password.

Monday, January 21, 2008

Reverse Lookup Zones and Event ID 40961

Reverse DNS records, aka PTR records, are used when you have an IP address you need to resolve to a name. While it is not 100% necessary to create a reverse lookup zone in your Active Directory domain this is a popular error.

Event Type: Warning Event Source: LSASRV Event Category: SPNEGO (Negotiator) Event ID: 40961 Date: 1/1/2005 Time: 12:30:45PM User: N/A Computer: COMPUTERNAME Description: The Security System could not establish a secured connection with the server DNS/prisoner.iana.org. No authentication protocol was available.

So what is prisoner.iana.org? Well its a blackhole of sorts. RFC 1918 defines three zones called 10.in-addr.arpa, 16.172.in-addr.arpa, and 168.192.in-addr.arpa on three DNS servers called blackhole-1.iana.org, blackhole-2.iana.org and prisoner.iana.org containing these zones. When a client updates its DNS PTR record it will update the reverse lookup zone xxx.xxx.in-addr.arpa. If you have a reverse lookup zone configured, it will be successful. However if you do not have a reverse lookup zone, thanks to RFC 1918, it will try to register itself with prisoner.iana.org (or one of the other blackhole servers) and fail.

To resolve this issue create a reverse lookup zone. It is ok to ignore this warning but best practice would be to configure a reverse lookup zone.

Tuesday, January 08, 2008

GPO ที่น่าสนใจ

GPO ที่น่าสนใจ

1. User Configuration / Administrative Templates / System / Ctrl+Alt+Del / Remove Task Manager --> Disable

2. User Configuration / Administrative Templates / Control Panel / Prohibit Access to Control Panel --> Disable

3. User Configuration / Administrative Templates / Control Panel / Force Classic Control Panel Style --> Enable

4. User Configuration / Administrative Templates / Desktop / Remove My Computer Icon on the Desktop --> Disable

5. User Configuration / Administrative Templates / Windows Components / Windows Explorer / Remove the Folder Options menu item from the Tools menu --> Disable

6. User Configuration / Administrative Templates / Windows Components / Windows Explorer / Turn on Classic Shell

7. Computer Configuration / Windows Settings / Security Settings / Local Policies / Security Options / Shutdown: Allow system to be shut down without having to log on

8. Computer Configuration/ Windows Settings/ Security Setting / Security Option/ Account: Guest Account Status = Disable

9. Computer Configuration/ Windows Settings/ Security Setting / Security Option/ Account: Rename Administrator Account

10. Computer Configuration/ Windows Settings/ Security Setting / Security Option/ Account: Rename Guest Account

11. Users Configuation/Administrative Template/Windows Settings/Internet Explorer/
เกี่ยวกับ Auto Complete

Friday, January 04, 2008

Terminal Services Manager and Terminal Services Configuration

Windows Server 2003 ยอมให้มีใช้ Remote Desktop ได้พร้อมกัน 2 session เท่านั้น บางทีถ้า session ค้าง เนื่องมาจากการออกด้วยวิธีการ Disconnect แทนที่จะเป็น Logoff หรือด้วยเหตุผลอื่นเช่นต้องการ run โปรแกรมทิ้งเอาไว้ จะทำให้ session เต็ม เราสามารถที่จะ connect กลับไปยัง session ที่เปิดทิ้งเอาไว้ หรือ สามารถที่จะ Reset Sessess นั้นทิ้งไปได้

Option ต่างๆมีดังนี้

1. Connect
สั่ง Connect Session สามารถ Connect กับ Session ของใครก็ได้ที่เรารู้ password ถ้าเจ้าของ session ยัง logon อยู่ จะถูกแตะออกไปแทน แล้วเราจะเข้าไปแทนที่ session นั้นแทนโดยหลุดออกจาก session ของเราเอง

2. Disconnect
สั่ง Disconnect Session โดยที่ Application ต่างๆยังคงทำงานอยู่

3. Send Message
ส่งข้อความถึงกัน โดยขึ้นมาเป็น Popup Message

4. Remote Control (Shadow Session)
มีความสามารถเหมือน PcAnywhere จะสามารถเลือก option นี้ได้ก็ต่อเมื่อ อีก session ไม่ได้ Disconnect เท่านั้น และไม่สามารถเรียกได้จาก Console , สามารถตั้งได้ว่าเจ้าของ session ต้องให้ความยินยอมก่อน หรือไม่ก็ได้ (จาก Terminal Services Configuration) Defaule Hotkey คือ CTRL+* ที่กดจาก Keypad ถ้าใน Notebook จะกดไม่ได้ต้องไปเปลี่ยน * ให้เป็นอย่างอื่น

5. Reset
ลบ Session ที่ค้าง(ไม่ทำงาน, hang)อยู่ออก ใช้เมื่อ Session ค้างเท่านั้น นอกนั้นให้ใช้ logoff แทน

6. Status
ดู Session Stat Counter

7. Logoff
Logoff user ที่ค้างอยู่ออกจาก session

Note
รายละเอียดการใช้งานต่างๆสามารถอ่านได้ใน Help