Thursday, December 15, 2016

Windows XP 30 days left for activation

Windows XP 30 days left for activation

After installing Windows XP you notice a message in the bottom right, "30 days left for activation" in the icon tray. This indicates that you must activate your windows XP because the Windows key you used is not a match with the CD installer product.

Remove Windows Activation

  1. Disable Internet access
  2. START -> RUN -> Type: regedit.exe and click RUN
  3. Navigate the registry to the following hive and key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WPAEvents
  4. On the right panel, find "OOBETimer" and double click it.
  5. Delete and replace the values with the following: FF D5 71 D6 8B 6A 8D 6F D5 33 93 FD
  6. Click "OK"
  7. Next, on the left panel, right-click "WPAEvents"
  8. Click on "permissions"
  9. Click "SYSTEM"
  10. Click the box "Deny Full Control"
  11. Click "OK"
  12. Click "YES" and exit Registry Editor.
  13. Reboot

Friday, June 17, 2016

Delete Duplicate data in database (MYSQL)

DELETE a
FROM tpcap_dailycheck as a, tpcap_dailycheck as b
WHERE
          (a.partno   = b.partno OR a.partno IS NULL AND b.partno IS NULL)
      AND (a.del_date = b.del_date OR a.del_date IS NULL AND b.del_date IS NULL)
      AND (a.qty = b.qty OR a.qty IS NULL AND b.qty IS NULL)
      AND a.no > b.no;

Wednesday, June 1, 2016

Openwrt with 3g usb modem DWM-156


opkg update
opkg install comgt kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan
usb-modeswitch luci-proto-3g 

APN internet
phone *99***1#

cat /sys/kernel/debug/usb/devices
to check vender xxxx pid xxxx

echo "2001 7d00" > /sys/bus/usb-serial/drivers/option1/new_id

vi /etc/chatscripts/3g.chat


ABORT   BUSY
ABORT   'NO CARRIER'
ABORT   ERROR
REPORT  CONNECT
TIMEOUT 20
""      "AT+CSQ"
""      "AT&F"
OK      "ATE1"
OK      'AT+CGDCONT=1,"IP","$USE_APN"'
SAY     "Calling UMTS/GPRS"
TIMEOUT 60
OK      "ATD$DIALNUMBER"
CONNECT ' '


vi /etc/config/network

config interface '3G_wan'
        option ifname 'ppp0'
        option proto '3g'
        option service 'umts'


vi /etc/hotplug.d/usb/20-usbmode
#!/bin/sh


BINARY="gcom -d /dev/ttyUSB1"
RTL8188SU_PRODID="2001/7d00/200"

if [ "${PRODUCT}" = "${RTL8188SU_PRODID}" ]; then
    if [ "${ACTION}" = "add" ]; then
        ${BINARY}
        logger -t Hotplug DWM-156 Regiter network
    fi
fi


vi /etc/hotplug.d/usb/10-usb_debug

#!/bin/sh

logger -t DEBUG "hotplug usb: action='$ACTION' devicename='$DEVICENAME' devname='$DEVNAME' devpath='$DEVPATH' product='$PRODUCT' type='$TYPE' interface='$INTERFACE'"



Start up openwrt

echo "2001 7d00" > /sys/bus/usb-serial/drivers/option1/new_id

echo "$(date "+%m%d%Y %T") : boot" >> log 2>&1

exit 0

vi /bin/test.sh

wget -s http://www.google.com
if [[ $? -eq 0 ]]; then
 echo "$(date "+%m%d%Y %T") : 3g online" >> /log 2>&1
else
 echo "$(date "+%m%d%Y %T") : 3g down" >> /log 2>&1
 # turn off USB power
 echo 0 > /sys/devices/virtual/gpio/gpio8/value
 # let things settle
 sleep 2
 # turn on USB power
 echo 1 > /sys/devices/virtual/gpio/gpio8/value
 # restart the interface
fi

chmod 777 /bin/test.sh

schedule task

*/2 * * * * test.sh