๘/๓๑/๒๕๕๔
centos not found network card
network.hwaddr: 00:22:64:8a:8d:3c
network.hwaddr: b4:99:ba:a8:97:a5
network.hwaddr: b4:99:ba:a8:97:a4
cd /etc/sysconfig/network-scripts/
cp ifcfg-eth1 ifcfg-eth2
nano ifcfg-eth2
DEVICE=eth1
TYPE="Ethernet"
ONBOOT="yes"
USERCTL="no"
HWADDR="00:22:64:8a:8d:3c"
BOOTPROTO="static"
IPADDR="172.19.0.1"
NETMASK="255.255.0.0"
GATEWAY="110.164.189.17"
linux ___tmpxxxx network card not found
Network interfaces named ___tmpxxxx when HWADDR is not specified Article ID: 36572 - Created on: Nov 18, 2009 2:46 PM - Last Modified: Dec 15, 2010 9:55 AM Issue Ethernet interface keeps changing into '__tmpxxxx'. When server is rebooted, interfaces are named as '__tmp' instead of ethx. Invalid network interface name after reboot Environment Red Hat Enterprise Linux 5.3 initscripts-8.45.25-1.el5-x86_64 Resolution To prevent this from occurring, the "HWADDR=" parameter should be used in /etc/sysconfig/network-scripts/ifcfg-ethx as follows: Ethernet Device DEVICE=ethx BOOTPROTO=static HWADDR=xx:xx:xx:xx ONBOOT=yes Root Cause What happens is: 1. initrd loads modules. Generally not network ones, unless you've specifically configured it to do so. 2. udev loads modules. It loads them in parallel. This means that if you have multiple network drivers in the machine, they will race against each other for device assignment. 3. when a network device is created, /lib/udev/rename_device is run to attempt to coerce the device name into whatever device name is mapped to that MAC address in the ifcfg files. Otherwise, you just get the order they happen to initialize in (which can change from boot to boot) 4. rest of boot runs (during which you can do other things) Due to the fact udev does not load modules sequentially (#2), you will get non-deterministic ethernet device ordering if you have multiple network drivers in the machine. It's inevitable. So, it is required to use HWADDR= in the ifcfg files to accomplish that mapping. You could also use udev rules directly (with NAME=).
๕/๐๔/๒๕๕๔
๔/๐๓/๒๕๕๔
ซ่อม lcd liberta lxl-750m
ไม่มีไฟจ่าย r .47 ไหม้
ic fan7601 แตก
C L55 474 แตก
TR FQPF 5N60C ซ๊อต
อะไหล่ทดแทน
FAN7601 => UC3842
L55 474 => 47nK63
ปัญหา
ไม่สามารถหา TR FQPF 5N60C หรือตัวแทนได้
ซ่อมไม่ได้
๒/๑๔/๒๕๕๔
CentOS + Asterisk + MySQL
#yum -y install mysql-devel
in asterisk-addon directory
#./configure --with-mysqlclient=/usr/sbin
๑๑/๐๕/๒๕๕๓
MySQL find duplicate reccords
select address, count(impt_key) as count_impt
from table
group by impt_key
having count_impt > 1
order by count_impt;
๙/๒๙/๒๕๕๓
Voltage Stabilizer
The function is to stabilize or filter an AC voltage from the alternator to get a clean DC voltage. A clean DC voltage is required for electronics equipment to operates in optimum condition. The alternator voltage output is regulated and still has AC noise which will cause a humming noise to a power amplifier.
This circuit will filter both low frequency noise and high frequency noise. The lower value capasitor will filter high frequency noise while higher value capasitor will filter low frequency noise.
*** All capasitors voltage value is minimum 16V (recomended). Do not use lower than 16V capasitor.
ปกติตอนเราขับรถ เครื่องสตาร์ทติดแล้ว เราจะใช้ไฟจาก Alternator 13.8 V แทนไฟจาก Battery 12 Volt ซึ่งไฟจาก Alternator ได้จากการหมุนตัดกันของขดลวดซึ่งถือว่าเป็นไฟ AC ที่ต่อกันแบบ Star ซึ่งจะต้องมีความถี่หรือ Cycle แน่นอน จริงๆแล้วในตัว Alternator จะมี ตัว Regulator ช่วยให้ไฟนิ่งอยู่แล้ว คือไม่เกิน 13.8 Volt
จากคุณสมบัติของ C ที่จะมีค่า XC หรือค่าความต้านทานของ C ต่อไฟสลับที่เรียกกันว่า Impedance เราจึงสามารถที่จะเลือกกรองเฉพาะความถี่ที่ไม่ต้องการทิ้งลงกราวด์ไปได้ นั้นก็คือ ณ ถี่ความถี่นั้น ค่า xc จะมีค่าเป็น 0 Noise ที่เกิดขึ้นจึงวิ่งผ่านลงกราวด์ไปแทน ไม่หลุดผ่านออกไปยัง Battery หรืออุปกรณ์อิเล็กทรอนิกส์ส่วนต่างๆในรถยนต์ ประมาณคล้ายๆ Cross Over Network ของลำโพงอะไรประมาณนั้น ทำไฟ DC ที่ได้ที่มีความราบเรียบมากยิ่งขึ้น การทำงานของอุปกรณ์อิเล็กทรอนิกส์ต่างๆก็มีประสิทธิภาพดีขึ้นเช่นกัน
เนื่องจาก Noise ที่เกิดขึ้นนั้นมีหลายความถี่ เราจึงต้องใช้ C หลายๆค่ามาต่อขนานกัน เพราะถ้าเราใช้ C ค่าเยอะๆตัวเดียว มันก็จะสามารถกรองได้แค่เพียงความถี่เดียว ด้วยเหตุนี้เราจึงใช้ C หลายๆค่าแทน เพื่อที่จะกรองความถี่ของสัญญาณรบกวนได้มากกว่าหนึ่งความถี่ แต่ถ้าเราใช้ C ค่าเยอะๆแทนมันก็จะกลายไปเป็น C Rectifier ไปแทนซะงั้น อันนั้นน่าจะเหมาะสมกับ Volt Stabilizer มากกว่า
โดยวงจร Noise filter จะไม่ได้ทำการตัดยอดคลื่นนะครับ การตัดยอดคลื่นลักษณะนั้นจะเป็นการที่วงจรขยายเกิดการ Saturated คือขยายเกินกว่ากำลังที่วงจรจะสามารถทำได้ ทำให้เกิดการขิบยอดคลื่นของสัญญาณเกิดขึ้น เราจึงได้ยินเสียงออกมากผิดเพี้ยนไปนั้นเอง
เครื่องมือและอุปกรณ์
- หัวแร้ง ตะกั่ว บัดกรี คีมตัดขา
- แผ่นวงจรอเนกประสงค์
- C electrolyte 4700uF 2 ตัว
- C electrolyte 1000uF 2 ตัว
- C electrolyte 470uF 2 ตัว
- C electrolyte 220uF 2 ตัว
- C electrolyte 100uF 2 ตัว
- C electrolyte 47uF 2 ตัว
- C electrolyte 22uF 2 ตัว
- C electrolyte 10uF 2 ตัว
- C electrolyte 4.7uF 2 ตัว
- C Ceramic Disc 0.01uF 2 ตัว
- ขายึด Fuse พร้อม Fuse 20A
- หลอด LED 1 หลอด
- Resistor เอาซัก 1.8kOhm ไว้ Limit กระแส กันหลอด LED ขาด
การติดตั้งใช้งาน
REF
http://www.erakii.org/th/diy/automotive/615-12-volt-dc-noise-filter-for-car
http://www.focusfanatics.com/forum/showthread.php?t=166823
http://diy.mozaks.net/bbs/view.php?bbs_id=engine_diy&doc_num=2
๘/๑๐/๒๕๕๓
Change MAC address
--------------------
Credit:
Kyle Lai, CISSP, CISA
KLC Consulting, Inc.
www.klcconsulting.net
Artical URL: HYPERLINK "http://www.klcconsulting.net/change_mac_w2k.htm"
--------------------
Changing the MAC address in W2K and XP
(this page stolen from http://www.klcconsulting.net/change_mac_w2k.htm because I wanted a copy in my notes here so I wouldn't lose it)
Method 1:
This is depending on the type of Network Interface Card (NIC) you have. If you have a card that doesn't support Clone MAC address, then you have to go to second method.
-
Go to Start->Settings->Control Panel and double click on Network and Dial-up Connections.
-
Right click on the NIC you want to change the MAC address and click on properties.
-
Under "General" tab, click on the "Configure" button
-
Click on "Advanced" tab
-
Under "Property section", you should see an item called "Network Address" or "Locally Administered Address", click on it.
-
On the right side, under "Value", type in the New MAC address you want to assign to your NIC. Usually this value is entered without the "-" between the MAC address numbers.
-
Goto command prompt and type in "ipconfig /all" or "net config rdr" to verify the changes. If the changes are not materialized, then use the second method.
-
If successful, reboot your systems.
Method 2:
This method requires some knowledge on the Windows Registry. If you are not familiar with Windows Registry, just use the SMAC tool to change the MAC addresses, or consult with a technical person before you attempt on the following steps. Also, make sure you have a good backup of your registry.
a. Goto command prompt and type "ipconfig /all", and
I. Record the Description for the NIC you want to change.
II. Record the Physical Address for the NIC you want to change. Physical Address is the MAC Address
figure 1.
b. Goto command prompt and type "net config rdr", and you should see something like
figure 2.
c. Remember the number between the long number (GUID) inside the { }. For example, in the above "net config rdr" output, for MAC address "00C095ECB793," you should remember {1C9324AD-ADB7-4920-B02D-AB281838637A}. You can copy and paste it to the Notepad, that's probably the easiest way. (See figure 2.)
d. Go to Start -> Run, type "regedt32" to start registry editor. Do not use "Regedit."
e. Do a BACKUP of your registry in case you screw up the following steps. To do this
I. Click on "HKEY_LOCAL_MACHINE on Local Machine" sub-window
II. Click on the root key "HKEY_LOCAL_MACHINE".
III. Click on the drop-down menu "Registry -> Save Subtree As" and save the backup registry in to a file. Keep this file in a safe place.
f. Go to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}. Double click on it to expand the tree. The subkeys are 4-digit numbers, which represent particular network adapters. You should see it starts with 0000, then 0001, 0002, 0003 and so on. (See figure 3.)
Figure 3.
g. Go through each subkey that starts with 0000. Click on 0000, check DriverDesc keyword on the right to see if that's the NIC you want to change the MAC address. The DriveDesc should match the Description you recorded from step (a.-I.). If you are not 100% sure about the DriverDesc, then you can verify by checking if the NetCfgInstanceID keyword value matches the GUID from step (c).
If there is no match, then move on to 0001, 0002, 0003, and so on, until you find the one you want. Usually 0000 contains the first NIC you installed on the computer.
In this demonstration, 0000 is the NIC I selected. (See figure 3.)
h. Once you selected the subkey (i.e. 0000), check if there is a keyword "NetworkAddress" exist in the right side of the window. (See figure 3.)
I. If "NetworkAddress" keyword does not exist, then create this new keyword:
i. Click on the drop down menu "Edit -> Add Value".
ii. In the Add Value window, enter the following value then click OK. (See figure 4.)
Value Name: = NetworkAddress
Data Type: = REG_SZ
Figure 4.
iii. String Editor window will pop up at this time (see figure 5.)
iv. Enter the new MAC address you want to modify. Then click OK.
(There should not be any "-" in this address. Your entry should only consist of 12 digits as seen in the figure 5.)
II. If "NetworkAddress" keyword exists, make sure it shows the keyword type is REG_SZ, and it should show as NetworkAddress:REG_SZ: . This keyword might not have a value at this time.
i. Double click on the keyword NetworkAddress and the String Editor window will pop up. (See Figure 5.)
ii. Enter the new MAC address you want to modify. Then click OK.
(There should not be any "-" in this address. Your entry should only consist of 12 digits as seen in the figure 5.)
Figure 5.
j. There are 2 ways to make the new MAC address active. Method I does not require a system reboot:
I. Goto Start->Setting->Control Panel, and double click on "Network Neighborhood".
WARNING: Make sure you understand that you WILL lose the network connection after completing step "ii." below, and
if you have a DHCP client, you will get a new IP address after completing step "iii."
i. Select the Network Adaptor you just changed the MAC address.
ii. Right click on the selected Network Adaptor and click "Disable."
Verify the status column for this adaptor changes to "Disabled"
iii. Right click on the selected Network Adaptor and click "Enable."
Verify the status column for this adaptor changes to "Enabled"
iv. If for any reason it cannot be disabled or re-enabled, you have to
reboot your system to make the changes effective.
II. Reboot your Windows system.
k. Once completing step j (if rebooting the system, wait until the reboot is completed), go to command prompt, type "ipconfig /all" to confirm the new MAC address.
Restore The TRUE Hardware burned-in MAC Address:
-
Remove the entry you added:
If you followed Method 1, then go back to the advanced properties window and remove the entry you add.
If you followed Method 2, then remove the "NetworkAddress" keyword you added in the registry.
-
Use step (j) above to activate the change you make.
-
Once rebooted, go to command prompt, type "ipconfig /all" to confirm the original MAC address.
If MAC Address changes does not work:
If for whatever reason the MAC address cannot be changed using method 2, make sure you restore the registry setting by following the "Restore The TRUE Hardware burned-in MAC Address" instruction above. If necessary, restore the registry you just backed-up to get your system back to the original state. You can do this by clicking on the drop-down menu "Registry->Restore," and restore your backup registry file.
or use SMAC
------------------------------
Another good article on changing MAC addresses
http://www.tech-faq.com/change-mac-address.shtml which leads to
another program that appears geared more torwards XP and can change MAC addresses http://students.washington.edu/natetrue/macshift/ but if for some reason that link evaporates you can find a local copy here
๗/๒๙/๒๕๕๓
Printer LQ fix
stylus pro
-เปดเครื่องแลวหัวพิมพเลื่อนมาที่คลีนแลวไฟกระพริบทุกดวง เปลี่ยน eeprom 93c46
stylus photo 895
-ขึ้น error c1 พิจารณาตลับหมึกวาหมดหรือไมและดูหนาสัมผัสชิบดวย
hp deskjet 1220c
-เปดเครื่องแลวหัวพิมพขยับเปนจังหวะทางซายมือแลวหยุด เปลี่ยน สายแพหัวพิมพ
hp deskjet 1125c
-เครื่องไม ready พิจารณาหัวพิมพ
dfx-5000
-เปดเครื่อง 10 ติ๊ดแลวไมทํ างาน เปลี่ยน m/b ตามคูมือแจงวาตัวdrive p/h เสีย
dfx-5000
-ดัง 10 ปปแลวเงียบหัวพิมพไมขยับ เพราะ stk6884 { cr motor drive } เสีย วิธีเช็คถอดออกแลวลองเปดดูเครื่อง
dfx-5000
-จะทํ างานไดแลวหยุดไปซึ่งจากเดิมไมทํ างานเลยแลวรองปปอยางเดียว
dfx-5000
-ดัง 2 ปปแลวเงียบ ทํ าความสะอาด connector hp sensor สกปรกมีคราบโดนนํ้ าแลวใชได
dfx-5000
-เปดเครื่องทํ างานแตเมื่อกดฟดไมวาfront หรือ rear จะคางแลวหมุนตลอดที่motor
ดานขางคาง สายขาดดานขาง
dfx-8000
-เปดมารองติ๊ด ๆ แลวไมทํ างานเพราะ detector inter lock เสีย ใหชอรตใชงานไปเลย
dfx-8000
-โหลดกระดาษไมดี แกไขเปลี่ยน tractor front left
dfx-8000
-เปดเครื่องดัง2 ปปแลวคางไฟติดสองดวงแตกดอะไรไมทํ างาน สวิสฝาครอบมีปญหาแกไขใหม
dfx-8000 note
-{รุนนี้ตอนเปดเครื่องตองปดฝาเครื่องดวยทุกครั้งมิฉะนั้นไมทํ างาน}
dfx-8000
-เปดเครื่องดัง ติ๊ด ๆ ติ๊ด ๆ แลวหัวพิมพวิ่งชนดานซายแลวหยุด เพราะ driver board เสีย
dlq-3000
-เปดเครื่องดัง 3 ติ๊ดแลวหยุดตัวหมุนตลับหมึกไมหมุน หนาจอ show please turn off แกไขในระบบเฟองหมุนผาหมึก
dlq-3000
-ขัดของทํ าให senser timing งอ ดัดแกไขใหม
HP LJ4si note
-{ fusing เสียเปลี่ยนทั้งอัน ในฟวซิ่งจะมีกานsensor สึกบอย กานsensor ของregister สึกเสียเปลี่ยนทั้งชุด
HP LJ4si
-ลูกยางโหลดกระดาษดานหนาเสียเปลี่ยน 1ชุดมี3ตัว ชุด lasorอยูดานบนเสียเปลี่ยนทั้งชุด ชุด transfer roller แถบ
HP LJ4si
-ยางดํ า หามจับเอาไวคายประจุ }
lq-1050+ note
-{หัวพิมพ 1050+ใชกับ 1050ได แต หัวพิมพ 1050เอามาใชกับ 1050+ไมได }lq-1070+ เปดเครื่องcr moterวิ่งกึก ๆ แลวไฟที่panelติดทุกดวงพรอมกัน5ครั้ง แกไข hp sensor shortกัน
lq-1170i
-ปริ้นตารางในexcelแลวสะดุดหัวกระแทกดานซายถาพิมพในwordปกติเปลี่ยน carriage unit ใหมใชได
lq-1170i
-พิมพดัง,พิมพสะดุด เปลี่ยน rd assy ใหม
lq-1170i note
-{ ใน1170i ไมมีการตั้ง auto line feed แสดง แต 1170 มี auto line feed
show และตอไปนี้จะเปนวิธีตั้ง
lq-1170i auto line feed ใน1170i คือจะใหมี หรือไมใหมี โดย กดปุม pitch คางไวแลว
เปดเครื่อง เมื่อปลอยปุม pitch
lq-1170i
-ดัง 2 ครั้ง = มี auto line feed แตถาดัง 1 ครั้ง = ไมมี auto line feed แลวปด
เครื่องแลวเปดใหมก็เสร็จสิ้นขั้นตอน}
lq-2170i
-motor lf. ไมทํ างานเมื่อกดฟดจะดังกึก ๆ เพราะไอซีตัวไดร pf moter เสีย
lq-2170i
-ไฟติดทุกดวงหัวพิมพไมวิ่ง rom เสียเปลี่ยนใหมหาย
lq-2170i
ปุม font กด led ไมเปลี่ยนแปลง แกไขไลทขา gatearray ic2 ใหมหาย
lq-2170i
เปดเครื่องบางครั้งplatenหมุนบางครั้งไมหมุนเมื่อใสกระดาษA4ดานหลังจะ
รองติ๊ด ๆ หรือเขาไปไดหนอยเดียวแลว
lq-2170i
หยุดแตใสกระดาษดานหนาทํ างานปกติ เพราะ detector paper front เสีย
lq-2170i
พิมพกระดาษตอเนื่องแลวรองติ๊ด ๆ แลวหยุด ไฟ pause ติดบอย แกไขเปลี่ยน
sw b =2 ใชได
lq-2170i
เมื่อโยกคันโยกไปตํ าแหนงกระดาษA4ดานหลังเมื่อใสกระดาษA4ดานหลังไม
ดูดกระดาษ แตพอมาใสดานหนารอง
lq-2170i
ติ๊ด ๆ เพราะ ตํ าแหนง sw b ผิดตํ าแหนงอยู วิธีเชค เมื่อโยกคันโยก sw b ตองงอ
1 ตัว ไมใช 2 ตัว ใหสังเกตดวย
lq-2170i
เปดเครื่องไฟกระพริบ เพราะสายหัวพิมพเสีย
lq-2170i
พอโหลดกระดาษ A4ดานหลังขึ้นมายังไมทันสุดแลวรองติ๊ด ๆ แตโหลดดาน
หนาใชได เพราะ platen gear แตก
lq-2170i
เปดเครื่องขึ้นมา plenten หมุนตลอดและใสกระดาษจะรองติ๊ด ๆ ตลอดเพราะมี
ลูกยางชวงที่ตอกับ plenten เลื่อนไป
lq-2170i
ทับ sensor front pe แกไขโดนเลื่อนลูกยางกลับตํ าแหนงเดิมแลวยึดกับกาวชาง
lq-2170i
เวลาใชงานกระดาษ A4 ปกติแตเมื่อใชกระดาษตอเนื่องไมวาจะดานหนา
หรือดานหลังเวลาโหลดกระดาษเขาเครื่อง
lq-2170i
จะดังติ๊ด ๆ ตลอดและไฟ paper out กระพริบตลอด เพราะ connecter sw b
ตัวเลือกกระดาษจากคันโยกเสีย
lq-2170i
เปดเครื่องหัวพิมพวิ่งกึกเดียวแลวหยุดไฟกระพริบทุกดวง เพราะสาย sensorhp ขาด
lq-2170i
เปดเงียบพัดลมหมุนแลวหยุดหัวพิมพไมขยับ เปลี่ยนp/h ใหมหาย
lq-2170i
ใช4 copy เวลาพิมพจะติดบางไมติดบาง เพราะลูกคาตั้งขนาดกระดาษไวที่
0 ทํ าใหไมมีแรงกด
lq-2170i
ไมฟดกระดาษเพราะคันโยกปรับกระดาษหักทํ าใหอยูผิดตํ าแหนง เปลี่ยน
และตั้งคันโยกใหม
lq-2170i
พิมพตารางเปนเสนประ เปลี่ยนระบบการเลื่อนบรรทัดอัตโนมัติเปน ไม
เลื่อน ในคา default ก็ใชได
lq-2170i
หัวพิมพวิ่งไปที่ตํ าแหนงโหลดกระดาษเขามา แลวกลับไปกลับมาเพราะ
สายpanel หลวมแกไขใหมใชได
lq-2180i
พิมพติดบางไมติดบาง เชน5บรรทัดไมติด บรรทัดที่6-8ติด และ9-10ไมติด
เปนตนเพราะแกน plenten งอเปลี่ยนใหม
lq-2180i
เปดเครื่องหัวพิมพวิ่งแลวหยุดจากนั้นเปดปดไมวิ่ง เพราะ tr หัวพิมพ short
ce ทดลองโดยปลดสายหัวพิมพทีละเสน
lq-2550
เมื่อใชกระดาษตอเนื่องจะฟดกระดาษออกแลวขึ้น E10 เปลี่ยนSolenoid ดาน
ขวาใหม
lq-2550
ตลับหมึกไมหมุนเพราะสายพานหลุด
lq-300
พิมพในวินโดวใช font 180*180 พิมพเพี้ยน แกไขตองเปลี่ยนเปนใชfont Crodai
UPC มิฉะนั้นตองเปลี่ยนเปน
lq-300 360*360 เปนอังคนา เทานั้น
lq-570+
ไฟติดทุกดวงหลังเปดเครื่องหัวพิมพวิ่ง{หลังจากเปลี่ยนm/bและrom}เพราะ
บอรดpanel short
lq-670
ฟดกระดาษ A4 ดานหนาพอเขาไปขางในจะถอยมาที่หัวพิมพแลวรองติ๊ด ๆ
sensor jam แกไขเปลี่ยนสายหัวพิมพ
lq-670
เปดเครื่องแลวไฟกระพริบทุกดวง สายหัวพิมพเสียเสนที่ตอ sensor วัดอุณหภูมิ
หัวพิมพ
lq-670
อาการโหลดกระดาษทาง cut sheet ไมเขารองตลอด เพราะลูกยาง paper eject
roller drive ลื่น ใหขัดใหม
lx-300
ไฟไมเขา มีQ1,Q2 และ r คา10/5w เสีย
m/b 1170i note{ คาโอหมที่วัดไดดวย DMM ระหวางไฟ 5v กับ Gnd จะได 825โอหมปกติ }
m/b 1170i เปดเครื่องปกติแตกดฟดไมทํ างานมอเตอรรองติ๊ด ๆ เปลี่ยน pu1501 ทํ าหนาที่
ไดรมอเตอรpaper feed
m/b 2070 ไฟ5vเหลือ4vจับramจะรอนวัด คตท.ไฟ5vได46โอหมปกติ1900โอหมเพราะ
ic1,ic2,rom,ram
m/b 2170 ไฟpanel กระพริบทุกดวง เปลี่ยน ic1 ตัวซีพียู
m/b 2170 วัดบอรดได 6โอหมเปลี่ยน ic2,ic9 เบอรls06
m/b 2170 วัดบอรดได 1 โอหมจากปกติ 1900 โอหมเพราะ ic 1 ซีพียูชอรทมาเปลี่ยนใหมก็
ใชได
m/b 2170
วัดบอรดได 2 โอหม เพราะ ic2 gate array , และ ic 9 74LS06 short
เปลี่ยนใหมใชได
m/b 2180i note
{ โอหมปกติ 90 โอหม }
m/b dlq3000 note
{โอหมปกติ 160 โอหม}
m/b dlq3000
อาการโหลดกระดาษ A4 ตลอดแลวขึ้นไฟ paper out เปลี่ยน eeprom เบอร93c46
{8ขา} อาการคลายรุน2170
p/s 1170
ระเบิดมา เปลี่ยน fet k1342,tr a1680 ,c4408,c1815,a1015,r 0.43โอหม3w
p/s 2070
ไฟไมเขา เพราะ r start ขาดคา 150k ตํ าแหนง r28
p/s 2070
ไมทํ างาน เพราะ เฟทชอรต ตํ าแหนง Q1
p/s 2070
เปดเงียบเพราะ r startขาดตํ าแหนง r18คา 150k/0.5w
p/s 2070
shortมาฝง primary เปลี่ยน d2,th1,Q1,Q31,r12
p/s 2070
ไฟ5v ไมออก เปลี่ยน c58,c55 short เปนซีไมกาตัวสีเหลือง
p/s 2170
วัดปลดโหลดปกติแตเมื่อตอโหลดทํ าใหm/b gatearrayพัง เพราะ Q31 ลีค
p/s 2170
ไฟ5vออกปกติไฟ35vออก30v เพราะ zd85 short
p/s 2170
พัดลมหมุนสักพักแลวหยุด เพราะzd52,zd87,d1,zd53 short เปลี่ยนใหมหาย
p/s 2170
ไฟ5vไมออก เพราะ r53,r88ขาดและ Q51 short
p/s 2170
เปดเงียบไฟ300vปกติ เพราะ r start ขาดคา 68k ตํ าแหนง r28
p/s 2170
ไฟ5vไมออก เปลี่ยน ic59,Q51
p/s 2170
เปดขึ้นมาfuse ขาด เปลี่ยน Q1,Q2 เพราะ short
p/s color200 shortมา มี f1,Q1,Q2,d2
มีหลายรุนหลายยี่หอ
SKRIVARE
HP LaserJet 2/3 printer.
Fel : Where can I source replacement "anticlick" pads that go under the solenoid on the
solenoid/sensor pcb (paper control pcb) RG1-0719 or RG1-2549?
Åtgärd : HP laser printer parts are available at PC Service Source 1-800-727-2787
http//www.pcss.net/. They sell service manuals and will fax you parts manual pages. Great
company.
Espon Stylus Color IIs printer
Fel : that does not "print" with the color or the b/w ink cartridges. Printer cartridge and head
move along the paper normal but does not put out any ink. The customer had previously used
a "non-brand" ink cartridge on printer. I suspect the printer heads.
Åtgärd : Epson printers heads will only take original ink cartridgre. New heads cost around
gpd 66.00, service manual gpd28.00, handling charges gpd 10.00. Available from Unicomp
Ltd, Bourne Est,Borough Green,Kent TN15 8DG tel 01732-780303 fax 01732-780643.
Service manual needed to adjust new software for new heads.
Okidata 120 GE5250E dot matrix printer.
Fel : It uses a 6-pin DIN plug to interface a computer. Is it possible to change the plug to a
standard printer plug? The DIN plug is mounted to a removable PCB, electrically connected
to the main board by a 30 pin connector.
Åtgärd : This printer was especially adapted for the Commodore 64/128 computers. Not only
would you have to replace the connector but also the whole interface circuit and the printer''s
firmware. Not a viable option considering the age of the machine.
Oki ML-520 printer.
Fel : When printing it will progressively move the print across the page from left to right, a
few characters at a time. We have tried replacing the space motor, sometimes this helps but a
lot of the time it does not. This problem is most noticeable when doing a menu print.
Åtgärd : kolladata kabeln from main logic PCB till skrivar huvudet .denna kan ibland orsaka
detta fel . Also the little nylon backing roller which sits behind the rack may have a worn flat
spot. Denna kan också orsaka det..
HP laserjet3 printer
Fel : has error 50. Usually I replace the triac or the two resistors connected in the ac power
module. This does not solve the error. I have four other power modules with same problem.
Åtgärd : Error 50 implies a Fuser error. Besides faults in the AC power module, in the fixer
assembly, the fuser lamp itself, or the in-line thermal fuse, or the thermo-switch, can go open,
so check for continuity (low-ohm''s) through these. Sometimes, unfortunately, the DC
Controller boards on the LJ 3''s can fail and give a type 50 error, and need replacing. But
before replacing, first check the two cables to the DC controller, at J206 & J208, and the
solder on the connectors. However, if your problem was localized to the AC power board,
after all, then besides the Triac and those two resistors, check the triac driver optoisolator IC,
and look for any bad solder on the connectors. Also, if you see any of those bright green Sony
electrolytic caps anywhere, check if they leaked. If so, you need to clean up well under them,
๕/๐๕/๒๕๕๓
ภาษีเงินได้บุคคลธรรมดา ภงด.90 ภงด.91 ภงด.94
ภาษีเงินได้บุคคลธรรมดา
การผิดสัญญาซื้อขายเงินผ่อนซึ่งผู้ขายได้รับคืนทรัพย์สินนั้น
วิศวกรรม สถาปัตยกรรม การบัญชี ปราณีตศิลปกรรม
การเกษตรและการอุตสาหกรรม การขนส่ง หรืออื่น ๆ นอกจากที่ระบุในมาตรา 40 (1) – (7)
ผู้มีหน้าที่ยื่นแบบยื่นแบบแสดงรายการภาษีเงินได้บุคคลธรรมดา ภ.ง.ด.91
ผู้มีเงินได้พึงประเมินตามมาตรา 40 (1) – (8) มีหน้าที่ยื่นแบบแสดงรายการปีละ 2 ครั้ง กล่าวคือ
ผู้มีหน้าที่ยื่นแบบแสดงรายการภาษีเงินได้บุคคลธรรมดา ภ.ง.ด.90
(แต่มิใช่เงินได้ตามมาตรา 40 (1) แห่งประมวลรัษฎากร ประเภทเดียว) ตามเกณฑ์ดังนี้
ผู้มีหน้าที่ยื่นแบบแสดงรายการภาษีเงินได้บุคคลธรรมดา ภ.ง.ด.94
ไม่ว่าจะมีเงินได้ประเภทอื่นนอกเหนือจากที่กำหนดไว้รวมอยู่ด้วยหรือไม่ตามเกณฑ์เดียวกันกับที่กำหนด สำหรับผู้มีหน้าที่
ยื่นแบบ ภ.ง.ด.90 ดังกล่าวข้างต้นไม่ว่าเมื่อคำนวณภาษีแล้วจะมีภาษีต้องเสียหรือไม่ก็ตาม
กำหนดเวลา สถานที่ยื่นแบบ และชำระภาษี
กำหนดเวลายื่นแบบ
ของทุกปี ในเวลาราชการผู้มีหน้าที่ยื่นแบบ ภ.ง.ด.94 พร้อมทั้งชำระภาษี(ถ้ามี)
ตั้งแต่วันที่ 1 กรกฏาคม- 30 กันยายน ของทุกปี
สถานที่ยื่นแบบ
การชำระภาษี
การขอผ่อนชำระภาษีเป็น 3 งวด ตามมาตรา 64 แห่งประมวลรัษฎากร
และต้องชำระภาษีที่ยังไม่ได้ชำระพร้อมเงินเพิ่มด้วย
คำเตือน
(เศษของเดือน ให้นับเป็น 1 เดือน) ของเงินภาษีที่ต้องชำระและต้องระวางโทษเปรียบเทียบปรับ
กรณีไม่ยื่นแบบแสดงรายการภายในกำหนดเวลาไม่เกิน 2,000 บาท
๓/๒๑/๒๕๕๓
Logical Procedures for the Design Of a High-End Subwoofer System
| Author: Wayne Harris (Click HERE to view more articles by Wayne Harris.)
|
When designing a woofer system for a high-end auto sound installation, you should stick to a very logical and straightforward procedure. The most important factors are size, performance, cost, and ease of fabrication.
The first step is to decide how much room you want to dedicate to your woofer system; generally, the bigger the system, the better. This decision will inevitably affect the other parameters of the design process. High-performance systems generally require large woofers and large enclosures. This usually raises the price of the system and lengthens the amount of time required for construction.
After you have decided on how much space your woofer system will occupy, you must determine what type of enclosure is right for your particular application. The simplest type of woofer system is the "infinite baffle." The infinite baffle is nothing more than a barrier that separates the front of the speaker from the rear of the speaker; this barrier is called a baffle board. A typical infinite-baffle installation in an auto sound system consists of mounting the woofer(s) on the rear deck of the vehicle or on the back of the rear seat. In any infinite-baffle design, it is very important that no path exists for sound to reach from the rear of the speaker to its front. If this happens, cancellation will occur and bass output will be reduced.
An infinite-baffle system is probably the easiest way to install woofers in your vehicle. You can expect good performance from such an installation, and since there are no boxes to design or build, installation time and cost are kept to a minimum. Unfortunately, there are several disadvantages to the infinite baffle. When a speaker is mounted in an enclosure, the air inside the enclosure acts like a spring against the speaker cone, and he resulting buildup in pressure provides mechanical damping and prevents excessive cone movement. But an infinite-baffle installation does not use an enclosure, so the mechanical damping is poor, resulting in "hang-over" and lack of definition. The power handling of the speaker will also be compromised since the infinite baffle provides very little control over cone excursion.
The second type of system is the "sealed box," and it is similar to the infinite-baffle design. A sealed box is just that: a completely airtight enclosure. Since the speaker is mounted in one face of the enclosure, there are no paths for sound to travel from the rear of the speaker to its front. Sealed boxes are very easy to design and build, and they generally perform well with almost any driver. Superb damping, good power handling, solid low-frequency response, and simplicity of design and construction make the sealed-box enclosure an ideal choice for many installations.
There are some drawbacks to using a sealed box, however. Using a box that's too small can have adverse effects both on your system's output level and on its deep-bass performance. Efficiency is another matter of concern; typically, sealed-box systems are less efficient than vented systems (see below) and require more power and equalization to achieve comparable output levels.
The best performance will be obtained by mounting the woofer in a "vented box." Vented systems, also known as ported or bass-reflex systems, use a duct to help fine tune the driver's performance. A good vented design provides essentially flat response to just above a low-frequency 3-dB downpoint, with system output rolling off at some rate below that frequency. As frequency approaches that at which the box is tuned, system output from the vent increases and is driven to full acoustic output by an ever-reducing excursion of the woofer itself. At this frequency, output comes almost exclusively from the vent and woofer excursion is at a minimum. This is quite different from a sealed system, where cone excursion increases four times for every octave of reduction in frequency. Reduced excursion means lower distortion, since the vent is not subject to the mechanical suspension limitations of the speaker. The excursion-controlling aspect of a good vented design is of fundamental importance, particularly in high-performance systems where high acoustic output and low distortion are desirable.
The biggest disadvantages of vented enclosures are the increased complexity of their design, poor performance when designed improperly, and unloading of the speaker at frequencies below the tuning frequency. However, note that most speaker manufacturers provide specifications, construction plans, and tuning charts that allow you to construct a vented system rather easily.
Once you've selected the type of enclosure, you can begin the process of selecting the driver(s). For an infinite-baffle system, a low-compliance driver is required. This type of speaker usually has a tight (accordion) surround and a large magnet, both of which compensate for the poor damping inherent in typical infinite-baffle systems.
Sealed systems, on the other hand, require high-compliance drivers. In order to provide good low-frequency output without excessive damping, these speakers almost invariably have loose, roll-edge suspensions. If a small sealed box is to be used, the cone should be constructed of fairly heavy material and be capable of long excursions. Typical heavy cone materials are plastic, polypropylene, and plasticized (treated) paper.
Vented systems, like infinite-baffle systems, work best with low-compliance drivers. The reduced excursion properties of vented systems allow the use of a much tighter cone. This results in less distortion, better transient response, and better cone control. Additionally, these drivers tend to be more efficient because of their lighter paper cones. It should be noted, however, that just about any speaker will work in this type of enclosure – as long as the enclosure is properly designed.
To select the size of the driver(s), you must consider the box volume available and the acoustic output de- sired. Most manufacturers offer charts that specify the recommended volume required for their speakers. Typically, 10-inch woofers require a volume of 1 to 1.5 cubic feet, 12-inch woofers require 1 to 3 cubic feet, and 15-inch woofers require 4 to 10 cubic feet.
As you probably have guessed, large woofers will almost always out-perform small woofers in any installation. The reasons for this are simple. Acoustic output is directly related to the volume of air displaced by the cone. This displacement is similar to the bore and stroke of a piston in an engine. In the case of a woofer, the bore is the area of the speaker cone and the stroke is the excursion. It is obvious that increasing the diameter of the driver or its excursion will increase its maximum output.
Typically, speakers less than 8 inches in diameter are incapable of producing sufficient acoustical power at low frequencies without tremendous excursion. On the other hand, speakers larger than 15 inches in diameter suffer from poor transient response due to the large mass of the cone.
In installations where large woofers are impractical, multiple small drivers can be used. In some instances, multiple small drivers can actually outperform a single, large driver. The advantage of using small drivers is that they require less box volume; the disadvantage is that each driver requires electrical power from the amplifier, and phasing problems can also arise.
The following system relationships can help you to decide whether to use a few large drivers or many small ones.
(A = cone area; E = cone excursion, one way; F = lowest frequency desired; P = acoustical power desired.)
- If the cone area is doubled, cone excursion is halved: 2A = E/2.
- If the cone area is halved, cone excursion is doubled: A/2 = 2E.
- If the frequency is halved, cone excursion increases by a factor of four: F/2 = 4E.
- If the frequency is doubled, the cone excursion is reduced by a factor of four: 2F = E/4.
- If the cone excursion is halved, the acoustical power is halved: E/2 = P/2.
- If the cone excursion is doubled, the acoustical power is doubled: 2E = 2P.
From these equations you can determine the best method for your installation. As a guideline, five 8-inch drivers, three 12-inch drivers, and two 15-inch drivers deliver comparable acoustic output.
Knowing the size and type of the enclosure plus the size, type, and number of drivers required brings you to the fun part: selecting a single driver from the hundreds available. The cost of different drivers varies dramatically, as does their quality. Shop for efficiency in your driver. Efficiency is like mpg: the more efficient your driver, the less power required to drive it. Efficiency is rated two ways. The first is half-space reference efficiency, which is stated as a percentage. The second method is sound-pressure level (SPL) at 1 meter with an input of 1 watt. In both instances, higher numbers are better.
Efficiency is related to several factors. The mass of the cone will drastically affect efficiency. Tripling the cone mass reduces the acoustic output by one half. Magnet size is also a key factor. Theoretically, doubling the magnet size will double the efficiency. The cross-sectional shape of the wire used on the voice coil also plays an important role. Rectangular (edge-wound) wire is more efficient than round wire.
Power handling is also an important criterion when selecting a driver. Be careful when comparing this rating. Some manufacturers give root mean square (rms) ratings; others publish peak-power ratings (or power-handling). Peak-power ratings are usually double the rms rating. The difference in these ratings is easily understood. Since the voice-coil temperature corresponds to the output level of the music, a source with a lot of transient (peak) information will heat the voice coil to a lesser degree than a continuous (rms) sine wave.
The electrical power-handling capability of a speaker is directly related to the voice coil's ability to dissipate heat. Large voice coils have more surface area and are able to dissipate heat better than small voice coils. A vented pole piece – usually appearing as a hole in the center of the magnet structure – is also important. Another form of venting is the use of a vented dust cap. This allows air to circulate over the voice coil for cooling. It also keeps excessive pressures from developing inside the voice-coil assembly, which, if unchecked, could blow the dust cap right off the driver.
Obviously, building a woofer system isn't as simple as throwing any old woofer in a box. Adhering to the selection procedures outlined above should result in maximum performance at the best possible price. You might also want to check out Vance Dickason's The Loudspeaker Design Cookbook (Marshall Jones Co.), for some straightforward, no-nonsense direction.
๑๒/๒๑/๒๕๕๒
๑๒/๐๘/๒๕๕๒
Sendmail + MySQL + Slackware
Mail + MySQL
จุดประสงค์
ไม่ต้องการให้ E-mail Users เป็น users ของระบบ แต่จะเก็บรายชื่อ และ Password ของผู้ใช้งาน email ไว้ใน table ของ MySQLเหตุผล
เพื่อความปลอดภัยของระบบ เพราะ users จะไม่สามารถใช้ users และ password นั้น ๆ เพื่อ login เข้าระบบได้ อาจจะเพื่อเหตุผลอื่น ๆ อีก แต่ยังนึกไม่ออก ว่าทำไมต้องทำแบบนี้ ที่ลองทำเพราะ มีหลายคนพูดถึง และสอบถามมาว่าเคยลองทำหรือไม่๑๑/๒๘/๒๕๕๒
Python server page
psp - Python Server Pages
The psp module provides a way to convert text documents (including, but
not limited to HTML documents) containing Python code embedded in
special brackets into pure Python code suitable for execution within a
mod_python handler, thereby providing a versatile mechanism for
delivering dynamic content in a style similar to ASP, JSP and others.
The parser used by psp is written in C (generated using flex) and is
therefore very fast.
๑๑/๒๐/๒๕๕๒
Proftp 1.3.2 with mysql
/usr/local/mysql/lib/libmysqlclient.a(my_compress.o)(.text+0x116): In function `my_compress_alloc':
: undefined reference to `compress'
/usr/local/mysql/lib/libmysqlclient.a(my_compress.o)(.text+0x18d): In function `my_uncompress':
: undefined reference to `uncompress'
collect2: ld returned 1 exit status
make: *** [proftpd] Error 1
I had the same problem and fixed it doing the following
Open contrib/mod_sql_mysql.c and find the following line:
Code:
#include
Before mysql.h you need to add the directory where this file is in. In my case (used the RPM's from mysql.org):
Code:
#include
Now run configure as follows
Code:
./configure --prefix=/usr/local/proftpd --sysconfdir=/etc/proftpd --with-modules=mod_sql:mod_sql_mysql --with-zlib
Offcourse you can use any prefix, sysconfdir or extra modules. Just keep --with-zlib in the line.
Hope this helps,
Dennis
http://forums.proftpd.org/smf/index.php?topic=1113.0
***************************
Try
./configure --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql --with-includes=/usr/l
ocal/mysql/include/ --with-libraries=/usr/lib:/usr/local/mysql/lib/lib --with-zilb
http://www.proftpd.org/localsite/Userguide/linked/x1462.html
./Make.rules Replaced LIBS=-lsupp -ldl -lcrypt -lm -lmysqlclient -lpam by LIBS=-lsupp -ldl -lcrypt -lm -lm
/usr/local/mysql/lib/mysql/libmysqlclient.a -lpam ./modules/mod_mysql.c and ./modules/mod_sqlpw.c
===================== done an ln -s of these files from ./contrib to ./modules and replaced in _both_ files : #include
mod_mysql.o: mod_mysql.h (there are no mod_mysql.h anymore) Finally, I compiled the whole by : ./configure --with-
modules=mod_sqlpw:mod_mysql --prefix=/usr/local make make install Results : Oct 24 22:23:53 omega proftpd[7415]:
omega.omnis.ch - ProFTPD 1.2.0pre8 standalone mode STARTUP I think it would be nice to correct ./modules/Makefile in the CVS,
and why not to add symlinks from ./contrib to ./modules ?
LIBS=-lsupp -ldl -lcrypt -lm -lm /usr/local/mysql/lib/mysql/libmysqlclient.a
#LIBS= -lcap -lm -lmysqlclient -lz -lsupp -lcrypt
LIBS= -lsupp -ldl -lcrypt -lm -lm /usr/local/mysql/lib/libmysqlclient.a
Sove:
add -lz
LIBS= -lsupp -ldl -lcrypt -lm -lz /usr/local/mysql/lib/libmysqlclient.a
********************************
$make
....
modules/mod_cap.o: In function `lp_add_cap':
mod_cap.c:(.text+0x1a): undefined reference to `cap_set_flag'
modules/mod_cap.o: In function `lp_set_cap':
mod_cap.c:(.text+0x6d): undefined reference to `cap_set_proc'
modules/mod_cap.o: In function `lp_free_cap':
mod_cap.c:(.text+0xda): undefined reference to `cap_free'
modules/mod_cap.o: In function `cap_post_pass':
mod_cap.c:(.text+0x150): undefined reference to `cap_init'
mod_cap.c:(.text+0x226): undefined reference to `cap_get_proc'
mod_cap.c:(.text+0x23d): undefined reference to `cap_to_text'
mod_cap.c:(.text+0x260): undefined reference to `cap_free'
mod_cap.c:(.text+0x268): undefined reference to `cap_free'
mod_cap.c:(.text+0x496): undefined reference to `cap_free'
modules/mod_cap.o: In function `cap_module_init':
mod_cap.c:(.text+0x507): undefined reference to `cap_get_proc'
mod_cap.c:(.text+0x514): undefined reference to `cap_free'
collect2: ld returned 1 exit status
make: *** [proftpd] Error 1
solve:
edit Make.rules
add -lcap on the line
LIBS= -lsupp -ldl -lcrypt -lm -lz -lcap /usr/local/mysql/lib/libmysqlclient.a
http://www.phpbuilder.com/board/archive/index.php/t-7102626.html
888888888888
Full Guide
888888888888
http://www.khoosys.net/single.htm?ipg=848
Mandrake 10.1 - Proftpd + MySQL authentication + Quotas Howto
Author: Stephen Khoo
– Please read the notes on the main Mandrake install guide first! –
Updated: 11 March 2005
Summary
This Howto describes how to build and configure proftpd (v 1.2.9) using a MySQL database for authentication and quota management.
The base machine is setup using Mandrake 10.1, so we assume you have installed the base set of MySQL rpms including the
development libraries and headers which places the headers in /usr/include/mysql and the libraries in /usr/lib. Please see our earlier
Howto guide:
Installation
The easiest is to install proftpd from the Mandrake rpms and overwrite /usr/sbin/proftpd with a symlink to the one you create here in
/usr/local/sbin. You can't use the rpm version of proftpd as it doesn't have MySQL support built in.
Log in as your user account to do the installation. Instructions in bold should be done as root.
You should be able to copy and paste the text in the yellow boxes straight into your Mandrake PC. We have tested this on a clean
server and it all seems to work fine. If you have any problems use the Discussion Forum on this site to let us know. You can always let
us know if this is useful anyway!
Get the sources
# as user
cd
mkdir src
cd src
# Proftpd source - note that this contains mod_sql and mod_quotatab
wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.2.10.tar.gz
Note: make sure that your path to the installation directory does not contain spaces in any of the directory names as this confuses the
./configure script totally!
Unpack sources
# as user
cd
mkdir proftpd
cd proftpd
# Unpack sources
tar -xzf ../src/proftpd-1.2.10.tar.gz
Compile and install
This assumes that the MySQL libraries and headers are placed where Mandrake puts them (i.e. /usr/lib and /usr/include/mysql
respectively). If you have used a different MySQL installation you just need to check that you get the path to these MySQL files correct.
cd proftpd-1.2.10
./configure --with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql \
--with-includes=/usr/include/mysql \
--with-libraries=/usr/lib
make
su
make install
# make a symbolic link to the installed binary in /usr/sbin - overwriting the one from the rpm if installed
# so that the startup script works OK
mv /usr/sbin/proftpd /usr/sbin/proftpd.rpmsave
ln -s /usr/local/sbin/proftpd /usr/sbin/proftpd
Unix Configuration
As far as UNIX is concerned we use one real group account ftpgroup (id 5500) as every user will be jailed to their home directory
using the 'DefaultRoot ~/' directive. We set up one main ftpuser account (id: 5500) with this group and a guest account ftpguest (id
5501).
groupadd -g 5500 ftpgroup
adduser -u 5500 -s /bin/false -d /bin/null -c "proftpd user" -g ftpgroup ftpuser
Note: I also add a guest user so that your client sites can have a place for their guest users to transfer files. Just run:
adduser -u 5501 -s /bin/false -d /bin/null -c "proftpd guest" -g ftpgroup ftpguest
add a password and then remember to add them to your database as members of the ftpgroup by adding a new record there.
To add a guest user, add a record for a user with userid of 5501 and set the permissions on the folders you want to share like this:
chmod 755 From_folder
chmod 731 To_folder
leaving the user and group as ftpuser.ftpgroup
Their clients will now only be able to download from the From_folder and drop files, but not list files in the To_folder.
MySQL Configuration
Create the database tables in MySQL for authentication and logging.
We use a database called ftpdb which we access using a MySQL user proftpd with password 'password'. (Clearly substitute your own
password in here).
You need to log into MySQL using your root account and password.
mysql -u root -p
create database ftpdb;
grant select, insert, update on ftpdb.* to proftpd@localhost identified by 'password';
use ftpdb;
#
# Table structure for table `ftpgroup`
#
CREATE TABLE ftpgroup (
groupname varchar(16) NOT NULL default '',
gid smallint(6) NOT NULL default '5500',
members varchar(16) NOT NULL default '',
KEY groupname (groupname)
) TYPE=MyISAM COMMENT='ProFTP group table';
#
# Dumping data for table `ftpgroup`
#
INSERT INTO `ftpgroup` VALUES ('ftpgroup', 5500, 'ftpuser');
INSERT INTO `ftpgroup` VALUES ('ftpgroup', 5500, 'ftpguest');
# --------------------------------------------------------
#
# Table structure for table `ftpquotalimits`
#
CREATE TABLE ftpquotalimits (
name varchar(30) default NULL,
quota_type enum('user','group','class','all') NOT NULL default 'user',
per_session enum('false','true') NOT NULL default 'false',
limit_type enum('soft','hard') NOT NULL default 'soft',
bytes_in_avail int(10) unsigned NOT NULL default '0',
bytes_out_avail int(10) unsigned NOT NULL default '0',
bytes_xfer_avail int(10) unsigned NOT NULL default '0',
files_in_avail int(10) unsigned NOT NULL default '0',
files_out_avail int(10) unsigned NOT NULL default '0',
files_xfer_avail int(10) unsigned NOT NULL default '0'
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `ftpquotatallies`
#
CREATE TABLE ftpquotatallies (
name varchar(30) NOT NULL default '',
quota_type enum('user','group','class','all') NOT NULL default 'user',
bytes_in_used int(10) unsigned NOT NULL default '0',
bytes_out_used int(10) unsigned NOT NULL default '0',
bytes_xfer_used int(10) unsigned NOT NULL default '0',
files_in_used int(10) unsigned NOT NULL default '0',
files_out_used int(10) unsigned NOT NULL default '0',
files_xfer_used int(10) unsigned NOT NULL default '0'
) TYPE=MyISAM;
#
# Table structure for table `ftpquotatallies`
#
CREATE TABLE `ftpquotatallies` (
`name` varchar(30) NOT NULL default '',
`quota_type` enum('user','group','class','all') NOT NULL default 'user',
`bytes_in_used` float NOT NULL default '0',
`bytes_out_used` float NOT NULL default '0',
`bytes_xfer_used` float NOT NULL default '0',
`files_in_used` int(10) unsigned NOT NULL default '0',
`files_out_used` int(10) unsigned NOT NULL default '0',
`files_xfer_used` int(10) unsigned NOT NULL default '0'
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `ftpuser`
#
CREATE TABLE ftpuser (
id int(10) unsigned NOT NULL auto_increment,
userid varchar(32) NOT NULL default '',
passwd varchar(32) NOT NULL default '',
uid smallint(6) NOT NULL default '5500',
gid smallint(6) NOT NULL default '5500',
homedir varchar(255) NOT NULL default '',
shell varchar(16) NOT NULL default '/sbin/nologin',
count int(11) NOT NULL default '0',
accessed datetime NOT NULL default '0000-00-00 00:00:00',
modified datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id),
UNIQUE KEY userid (userid)
) TYPE=MyISAM COMMENT='ProFTP user table';
INSERT INTO `ftpuser` VALUES (1, 'testaccount', 'ftppasswd', 5500, 5500, '/home/testdomain.com', '/sbin/nologin',0,'','');
exit;
Notes:
* The group table lists the members of each group. This does not need any records for a simple setup.
* The user table lists each of your ftp users and records their stats and is used for authentication and pointing proftpd to the correct
home directory. Using the directive 'asdfasf' we make proftpd create the home directory if one does not already exist.
* The quotalimits table is used to se the current quota for the user matching its entry.
* The quotatallies table is used by proftpd to keep track of the user's quotas and will be filled if there is a matching userfield 'name'
when a user logs in.
* We have added a user test account just called "testaccount" to check things are working ok.
Field Explanations:
quotalimits
name - username
quota_type - user, group, class, all (we use user)
per_session - true or false (we use true)
limit_type - quota limit type - hard or soft (we use hard)
bytes_in_avail - upload limit in bytes - allowed bytes on disk (eg diskquota)
bytes_out_avail - download limit in bytes - allowed bytes a user can download
bytes_xfer_avail - allowed bytes a user can transfer in/out
files_in_avail - upload limit in files - allowed number of uploaded files
files_out_avail - allowed number of downloaded files
files_xfer_avail - allowed number of files a user can transfer in/out
quotatallies
name
quota_type
bytes_in_used - upload tally in bytes
bytes_out_used - download tally in bytes
bytes_xfer_used - transfer tally in bytes
files_in_used - upload tally in files
files_out_used - download tally in files
files_xfer_used - transfer tally in files
If a value of any limit field is set to '0' it is unlimited.
You can read the documentation that comes with mod_quotatab for mysql here.
Author's Note:
You can test a 15MB quota limit on 'testaccount' by inserting this record into 'quotalimits':
INSERT INTO quotalimits VALUES('testaccount','user','true','hard','15728640','0','0','0','0','0');
I think you have to log in with this record in place before it works. It also will allow you to upload, but then deletes the file if you are
over the limit. This is a bit irritating because on normal user disk quotas, you get a message as you try to upload, not after. So you
might get some unhappy users who don't know why they can't upload. Also the message that you have exceeded the limit appears in
the ftp client transcript and your users will miss this if they don't show transcripts.
On a related note, I can seem to get any joy out of the quotatallies stuff. When I get more time, I may investigate this. In the
meantime, if any of you find out what is going on there, it would be cool if you leave a note in the forum here - then everyone can
benefit.
Proftpd Config File
Here is our complete configuration file setup with MySQL and quota support. Keep a copy of the installation one in /usr/local/etc/ and
replace with one like this - change to suit your ServerName and ServerAdmin and MySQL database login details.
ServerName "Khoosys Proftpd Server"
ServerType Standalone
ServerAdmin stephen@khoosys.net
# Hide as much as possible to outside users
ServerIdent on "Welcome to the Khoosys FTP server. Please login..."
DeferWelcome on
DefaultServer on
# Allow FTP resuming.
# Remember to set to off if you have an incoming ftp for upload.
AllowStoreRestart on
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30
# Set the user and group under which the server will run.
User nobody
Group nogroup
# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~
# Normally, we want files to be overwriteable.
AllowOverwrite on
# The passwords in MySQL are encrypted using CRYPT
SQLAuthTypes Plaintext Crypt
SQLAuthenticate users* groups*
# used to connect to the database
# databasename@host database_user user_password
SQLConnectInfo ftpdb@localhost proftpd password
# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
SQLUserInfo ftpuser userid passwd uid gid homedir shell
# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
SQLGroupInfo ftpgroup groupname gid members
# set min UID and GID - otherwise these are 999 each
SQLMinID 500
# create a user's home directory on demand if it doesn't exist
SQLHomedirOnDemand on
# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
# Update modified everytime user uploads or deletes a file
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
# User quotas
# ===========
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail,
bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used,
files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1},
bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4},
files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" ftpquotatallies
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
RootLogin off
RequireValidShell off
Proftpd startup file
As you can see we start proftpd as a standalone process and not as an xinetd service. We use the proftpd startup script provided by
the rpm distribution. You can download it here.
Testing
Start the service using /etc/rc.d/init.d/proftpd and login to the ftp server using 'testaccount' and 'ftppasswd'.
If the home directory '/home/testdomain.com' does not already exist it will be created.
Have fun!!
A few useful tips
If you want to check that queries are coming through to MySQL, turn on logging by adding a line to your MySQL configuration file such
as: log=/var/lib/mysql/mysql.log
Remember to turn off logging when you are done as it will slow things down with it on!
(Note that the MySQL config file is usually '/etc/my.cnf'. If you don't have one MySQL usually provides a set which you can copy
according to the size of server you want to run. For example, a huge server can use : '/usr/share/mysql/my-huge.cnf')
Useful links
* http//www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-SQL.html
* http//www.lastditcheffort.org/aah/proftpd/mod_sql/
๑๑/๑๔/๒๕๕๒
Disable Autorun.inf run on any medium
How to Disable AutoRun.inf?
Nick Brown came up with a solution to prevent AUTORUN.INF files from being used on a PC, from any medium. This method involved using an initialisation file mapping, to create a mapping between the AUTORUN.INF initialisation file and the Registry. IniFileMapping is a key which tells Windows how to handle the .INI files which those applications typically used to store their configuration data (before the registry existed).This procedure relied on the fact that an autorun.inf file is a standard Windows INI file and so the appropriate API calls are used by Windows, when fetching its settings. These API calls can be redirected using the INI file mapping method. In this case, it says “whenever you have to handle a file called AUTORUN.INF, don’t use the values from the file. You’ll find alternative values at HKEY_LOCAL_MACHINE\SOFTWARE\DoesNotExist.” So how is this done?
Create a Registry file with the following contents and save it as DISABLEAUTORUN.REG.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\IniFileMapping\Autorun.inf]
@="@SYS:DoesNotExist"
Double click DISABLEAUTORUN.REG to make the relevant changes to Windows Registry. Now whenever Windows tries to read a file called “autorun.inf” using the INI programming calls, it is forbidden from reading from the actual file. Instead, all settings are read from the HKEY_LOCAL_MACHINE\Software\DoesNotExist Registry key. As this key does not exist, it is as if the autorun.inf file contains no settings information. This applies to any autorun.inf in any location and on any drive.
The only drawback with this approach is you need to manually trigger the setup program in any inserted CD or USB Stick. But isn’t it better to live with this than with AutoRun viruses?
credit: http://techblissonline.com/disable-autorun/