Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Sunday, September 21, 2008

making a 3G Huawei 220 USB modem work in Linux 2.6

Context: just received a Huawei 220 3G USB modem [1] (HSDPA/UMTS/EDGE/GPRS/GSM, HSDPA <= 3.6Mbps ), have to make it work in my Linux thinkpad X60 w/ Linux 2.6.20+ , for accessing the Swisscom HSDPA service.

It didn't work out of the box, mainly because of the device's CD emulation storage (windoze drivers :P) interfering with its comm device.

First searches return pointers to a "vodafone-mobile-connect-card-driver-for-linux" [2] package, which is absolute crap: a heavy weight GUI interface that doesn't even work (at least for me).

Hey ... I just want to have my /dev/ttyUSB0 to be able to configure a pppd on it, I found a true, low level solution [3] that manages to make the device behave like the very thing it was born for :)

Here is an excerpt of the mininum required configs to make it work

  • /etc/udev/rules.d/99-huawei.rules

    ## /etc/udev/rules.d/99-huawei.rules
    ##
    ## to enable it, run: udevcontrol reload_rules
    ##
    #
    # udev rule for HUAWEI E220 3G HSDPA Modem
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # (c)opyleft OOZIE < oozie@poczta.fm >
    #
    # This file prevents the pseudo scsi cdrom device from enabling,
    # thus providing a workaround for kernel versions < 2.6.20
    #
    # Minor edition by JuanJo Ciarlante
    ##

    SUBSYSTEM=="block", \
    ACTION=="add", \
    SYSFS{idVendor}=="12d1", \
    SYSFS{idProduct}=="1003", \
    RUN="/sbin/modprobe usbserial vendor=0x12d1 product=0x1003", \
    OPTIONS="ignore_device"


  • /etc/ppp/peers/3g

    # /etc/ppp/peers/3g
    # pppd call 3g nodetach
    # (using Huawei e220 USB modem)
    /dev/ttyUSB0
    #3600000 #irrelevant
    noipdefault
    defaultroute
    user gprs
    password gprs
    #persist
    lock
    noauth
    nodetach
    usepeerdns
    nodeflate
    nobsdcomp
    nopcomp
    noaccomp
    novj
    novjccomp
    nomagic
    #asyncmap 0
    #lcp-echo-failure 10000
    #lcp-echo-interval 1000
    lcp-echo-failure 10
    lcp-echo-interval 30
    connect '/usr/sbin/chat -v -f /etc/ppp/peers/3g.chat'
    debug
    idle 180
    holdoff 10

  • /etc/ppp/peers/3g.chat

    # /etc/ppp/peers/3g.chat
    TIMEOUT 3
    ABORT BUSY
    ABORT 'NO CARRIER'
    ABORT VOICE
    ABORT 'NO DIALTONE'
    ABORT 'NO DIAL TONE'
    ABORT 'NO ANSWER'
    ABORT DELAYED
    "" ATZ
    OK ATQ0V1E1S0=0&C1&D2
    OK AT+CGDCONT=1,"IP","gprs.swisscom.ch","0.0.0.0",0,0
    OK ATDT*99#
    CONNECT ""


Tuesday, June 03, 2008

cmdline, online google shell :)

Nowadays, few times you find yourself staring at a site with a big "woooOOOWWW!!"

Just extremely cool (-:
http://www.goosh.org/

Thursday, April 24, 2008

Sunday, November 18, 2007

Using mutt for gmail via IMAP

You use mutt, you love it. You hate the user interface "latency" of every other MUA, and the fact that no other MUA has "got" how to handle mail threading as mutt does.
BUT also you, a true road warrior, want mail(box) availabilty and plenty of storage.
Well, recently gmail added IMAP support, with a very good support of the standard AND a well thought mapping between gmail labels and IMAP folders ( "virtual" folders).

The good news is that you can link your beloved mutt to gmail, use IMAP folders and also use SMTP TLS authentication via smtp.gmail.com

Here is a copy of my .mutt/muttrc (obviously must change "username" and other stuff):

## ~/.mutt/muttrc
set from=username@gmail.com
set realname="JuanJo seC"
set reverse_name=yes
set reverse_realname=no
set imap_user = 'username@gmail.com'
set spoolfile = imaps://imap.gmail.com:993/INBOX
#set sendmail="/usr/sbin/ssmtp -C$HOME/.mutt/ssmtp.conf"
set smtp_url="smtp://username@smtp.gmail.com:587/"
set folder = "imaps://imap.gmail.com:993"
#set record=+sent-mail-`date +%Y`
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
# previously do: mkdir -p ~/.mutt/cache/{headers,bodies}
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file=~/.mutt/certificates
set move=no
set delete=yes
set edit_hdrs
set include
set reply_to
set abort_nosubject=no
alternates '(username|altusername)([-+].*)?@.*'
set hdr_format="%4C %Z %{%m/%d} %-15.15F (%4c) %s" # format of the index

hdr_order From: Date: User-Agent: X-Mailer To: Cc: Reply-To: Subject:
ignore *
unignore From: Date: User-Agent: X-Mailer To: Cc: Reply-To: Subject:
my_hdr Reply-To:

# setup gmail filters to apply the corresp. labels:
mailboxes ! =ml-lug-list =ml-lug-org =[Gmail]/Drafts "=[Gmail]/All Mail"

set editor="jed %s -l ~/.mutt/jed.mutt.sl"
set alias_file=~/.mutt/mail_aliases
source ~/.mutt/mail_aliases

send-hook . 'set realname="JuanJo seC"'
## hack to make $reverse_name and 'my_hdr From:' work ok (eg mlists)
send-hook . 'set from=username@gmail.com'
send-hook . 'unmy_hdr From:'
###
send-hook . 'set signature=~/.signature'

#send-hook lug-list 'set record=+sent-lug-list'
send-hook lug-.+@lugmen.org.ar 'my_hdr From: JuanJo seC <username+mlist@gmail.com>
subscribe lug-.+@lugmen.org.ar



Very cool to experiment folder switching in mutt using:
'c' ("Open Mailbox")
TAB (will show all IMAP folders)
TAB (again: will show only the 'mailboxes' mutt var)

And here is my jed rc:

% ~/.mutt/jed.mutt.sl
% emacs keybinding for jed:
() = evalfile("emacs");
% Find signature begin, position cursor there:
if (re_fsearch("^--")) {
call("previous_line_cmd");
} else {
% else search headers end
re_fsearch("^$");
call("next_line_cmd");
}
push_mark();


Yeahh... finally I can read mailing lists with an interface that doesn't suck! 8)
Enjoy!

Friday, November 17, 2006

algunos costos de "la diaria" en Europa (desde ojos argentinos)

Anduvimos por EU con mi 1/2naranja :-D
Sana recomendación MUY importante: NO vayas haciendo la conversión a pesos (que en nuestro caso actualmente es 4x!) cada vez que gastás y/o masticás un bocado :), ahorrá y disponé de un monto diario... y listo.

Según pude comprobar (sin contar alojamiento) podés comer+andar con
~eu$ 15 (minimorum, de supermercado) hasta eu$35 (almuerzo y cena en bar/rest. "normales").

A modo de referencia, aquí van algunos costos & tips:
(costos tomados en Madrid , agregar ~20% para Paris, Venecia).

@Supermercado
En la mayoría venden unos sandwiches ya armaditos de lo más variados, alcanzan perfectamente para un almuerzo liviano, con lo cual para dos personas un almuerzo/cena alike no baja de aprox eu$7.-:
  • sandwich: eu$ 2.50
  • gaseosa 1.5lt/ jugo natural 1lt: eu$2.0
  • pan en rodajas: eu$2.0
  • queso en fetas (~10): eu$2.0
  • bandeja de ensalada fresca: eu$2.5
  • yogurt bebible 1lt.: eu$2.0
@Restaurant
Restaurant simple (obvio):
  • Una pizza compartida para dos + dos jugos/gaseosa: eu$20
  • Un par de platos de spaguetti + jugo/gaseosa: eu$22
@FastFood
Ref: fastfood del Louvre (onda patio de comidas):
  • comida ppal (varias opciones)+postre(tarta)+gaseosa 1/2lt: eu$11,90
  • un helado mediano: eu$ 3
@Alojamiento
Hoteles ~3 estrellas:
  • single: eu$ 65-80, sumar eu$10-15 por cada persona adicional
@Transporte
El transporte público es muy bueno y --según dicen-- seguro (Madrid, Barcelona, Paris).
TIP: en Barcelona comprá un boleto "T10" que trae 10 pasaje pero cuesta ~6 nomás *Y* te sirve para
usarlo en metro+bus+tranvía el MISMO pasaje (dentro de 1:15hr del primer uso);
además no es personal (varios pueden usar el mismo T10).

  • metro(subte): eu$ 1.0
  • tren cercanía (depende de distancia): eu$ 1.2 para arriba
  • bus (1hr. de viaje , 40km): eu$ 3.0
@Museos
TIP: Algo que tienen muy piola es que podés salir/entrar durante el día con la sola entrada,
así que te conviene ir a la mañana temprano así te queda +tiempo.
  • del Prado: eu$6, GRATIS LOS DOMINGOS
  • Louvre: eu$8.5
  • Versalles: eu$6. GRATIS EL 1er DOMINGO de c/mes
@Auto
A pesar que no anduvimos en auto, anoté algunos precios:
  • nafta: eu$1.2 aprox
  • peajes: CARISIMOS, según me dijeron en gral costo peaje iguala al del combustible.