Linux
Using gnokii to send sms in Linux
Filed under Linux
bash $su #apt-get install gnokii #gnokii $cp /etc/gnokiirc .gnokiirc $vi ~/.gnokiirc #port=? #connection=? #model=? $gnokii --sendsms [phone-number] $echo 'Hello World' | gnokii --config configfile --sendsms [ph-no] $dmesg usb 4-1: new full speed USB device using uhci_hcd and address 35 usb 4-1: configuration #1 chosen from 1 choice cdc_acm 4-1:1.8: ttyACM0: USB ACM device # lsusb Bus 006 Device 001: ID 0000:0000 Bus 004 Device 035: ID 0421:043a Nokia Mobile Phones Bus 004 Device 001: ID 0000:0000 Bus 005 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 008 Device 001: ID 0000:0000 Bus 007 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 001: ID 0000:0000 $ gnokii --identify GNOKII Version 0.6.26 IMEI : 351863017676426 Manufacturer : Nokia Model : Nokia N70 Product name : Nokia N70 Revision : V 05wk07v45 $ gnokii --sendsms GNOKII Version 0.6.26 Please enter SMS text. End your input with : test sms Send succeeded! $ wvdialconf Editing `/etc/wvdial.conf'. Scanning your serial ports for a modem. ttyS0: Device or resource busy Modem Port Scan<*1>: S0 S1 S2 S3 WvModem<*1>: Cannot get information for serial port. ttyACM0<*1>: ATQ0 V1 E1 -- OK ttyACM0<*1>: ATQ0 V1 E1 Z -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK ttyACM0<*1>: Modem Identifier: ATI -- Nokia ttyACM0<*1>: Speed 4800: AT -- OK ttyACM0<*1>: Speed 9600: AT -- OK ttyACM0<*1>: Speed 19200: AT -- OK ttyACM0<*1>: Speed 38400: AT -- OK ttyACM0<*1>: Speed 57600: AT -- OK ttyACM0<*1>: Speed 115200: AT -- OK ttyACM0<*1>: Speed 230400: AT -- OK ttyACM0<*1>: Speed 460800: AT -- OK ttyACM0<*1>: Max speed is 460800; that should be safe. ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK Found an USB modem on /dev/ttyACM0. Modem configuration written to /etc/wvdial.conf. /etc/wvdial.conf: Can't write '/etc/wvdial.conf.tmp19478': Permission denied /etc/wvdial.conf: Can't write '/etc/wvdial.conf' ('/etc/wvdial.conf'): Bad file descriptor ttyACM0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0" # wvdialconf Editing `/etc/wvdial.conf'. Scanning your serial ports for a modem. ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up. Modem Port Scan<*1>: S1 S2 S3 WvModem<*1>: Cannot get information for serial port. ttyACM0<*1>: ATQ0 V1 E1 -- OK ttyACM0<*1>: ATQ0 V1 E1 Z -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK ttyACM0<*1>: Modem Identifier: ATI -- Nokia ttyACM0<*1>: Speed 4800: AT -- OK ttyACM0<*1>: Speed 9600: AT -- OK ttyACM0<*1>: Speed 19200: AT -- OK ttyACM0<*1>: Speed 38400: AT -- OK ttyACM0<*1>: Speed 57600: AT -- OK ttyACM0<*1>: Speed 115200: AT -- OK ttyACM0<*1>: Speed 230400: AT -- OK ttyACM0<*1>: Speed 460800: AT -- OK ttyACM0<*1>: Max speed is 460800; that should be safe. ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK Found an USB modem on /dev/ttyACM0. Modem configuration written to /etc/wvdial.conf. ttyACM0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0" # wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Modem initialized. --> Configuration does not specify a valid phone number. --> Configuration does not specify a valid login name. --> Configuration does not specify a valid password. less /etc/wvdial.conf [Dialer Defaults] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = USB Modem ISDN = 0 Username ='' New PPPD = yes Phone = *99# Modem = /dev/ttyACM0 Password ='' Baud = 460800 # wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Modem initialized. --> Configuration does not specify a valid login name. # vi /etc/wvdial.conf # wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Modem initialized. --> Configuration does not specify a valid login name. --> Configuration does not specify a valid password. # vi /etc/wvdial.conf # wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Modem initialized. --> Sending: ATDT*99# --> Waiting for carrier. ATDT*99# CONNECT ~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~ --> Carrier detected. Waiting for prompt. ~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~ --> PPP negotiation detected. --> Starting pppd at Mon Jul 13 15:24:18 2009 --> Pid of pppd: 19776 --> Using interface ppp0 --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> local IP address 10.80.69.89 --> pppd: ��[06][08]0�[06][08] --> remote IP address 10.6.6.6 --> pppd: ��[06][08]0�[06][08] --> primary DNS address 202.134.13.4 --> pppd: ��[06][08]0�[06][08] --> secondary DNS address 202.134.12.13 --> pppd: ��[06][08]0�[06][08] Caught signal 2: Attempting to exit gracefully... --> Terminating on signal 15 --> pppd: ��[06][08]0�[06][08] --> Connect time 0.6 minutes. --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> Disconnecting at Mon Jul 13 15:24:57 2009
ssh without password
Filed under Linux
ssh without password:
my-pc:
my-pc->home/user/> ssh -keygen -t dsa .ssh/id_dsa=private .ssh/id_dsa.pub=public
scp id_dsa.pub other-pc:
other-pc->/home/user: first time: mv id_dsa.pub authorized_keys2 or append: cat id_dsa.pub >> authorized_keys2
Connecting to the internet through a gprs/edge modem /Nokia mobile in Linux
Filed under Linux
The following steps were used to get connected to the internet(GP-internet, Grameen phone, Bangladesh) using a Nokia mobile in Linux.
bash # apt-get install wvdial #less /etc/wvdial.conf [Dialer Defaults] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = USB Modem ISDN = 0 Username ='' New PPPD = yes Phone = *99# Modem = /dev/ttyACM0 Password ='' Baud = 460800 # wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Modem initialized. --> Sending: ATDT*99# --> Waiting for carrier. ATDT*99# CONNECT ~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~ --> Carrier detected. Waiting for prompt. ~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~ --> PPP negotiation detected. --> Starting pppd at Mon Jul 13 15:24:18 2009 --> Pid of pppd: 19776 --> Using interface ppp0 --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> local IP address 10.80.69.89 --> pppd: ��[06][08]0�[06][08] --> remote IP address 10.6.6.6 --> pppd: ��[06][08]0�[06][08] --> primary DNS address 202.134.13.4 --> pppd: ��[06][08]0�[06][08] --> secondary DNS address 202.134.12.13 --> pppd: ��[06][08]0�[06][08] Caught signal 2: Attempting to exit gracefully... --> Terminating on signal 15 --> pppd: ��[06][08]0�[06][08] --> Connect time 0.6 minutes. --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> pppd: ��[06][08]0�[06][08] --> Disconnecting at Mon Jul 13 15:24:57 2009