Posts

Showing posts from November, 2009

a script that will check the md5sum of all the files and directory in the source directory

If you need a script that will check the md5sum of all the files and directory in the source directory, this is the command: find . -type f -exec md5sum {} \; ---

Huawei 3G modem E1762 and Linux

If you are having difficulty using Linux with Huawei 3G modem , this might give you an idea on how to resolve your problem. The problem is Linux always recognize Huawei 3G modem as storage instead of modem, so need to use usb_modeswitch to switch it become a modem. Here is the command: 1. yum install usb_modeswitch 2. modify /etc/usb_modeswitch.conf Here is my example : #Huawei E1762 DefaultVendor= 0x12d1 DefaultProduct= 0x1446 ;DefaultProduct= 0x1003 TargetVendor= 0x12d1 ;TargetProduct=0x1003 TargetProduct= 0x1446 # choose one of these: ;DetachStorageOnly=1 ;HuaweiMode=1 MessageEndpoint=0x01 MessageContent="5553424300000000000000000000001106 0000000000000000000000000000" 3. Modify /etc/udev/rules.d/15-huawei-e1762.rules SUBSYSTEM=="usb", SYSFS{idProduct}=="1446", SYSFS{idVendor}=="12d1", RUN+="/lib /udev/usb_modeswitch" 4. Restart the system and use Network Manager to configure the connection. Hope this will help you. ---

bash Script to remove string from filename

This bash script is to remove or replace a string from the filename. #!/bin/bash for THISFILE in * do filename=${THISFILE%\.*} extension=${THISFILE##*\.} newname=${filename//./_} echo "mv $THISFILE ${newname}.${extension}" #mv $THISFILE ${newname}.${extension} done ---