Sunday, October 5, 2008

bajarse pdf de web con links

Cuando nos encntramos el caso que una web ofrecen pdf's o otro tipo de archivos con enlaces es facil hacer un script o escribir directamente el comando para descargar los mismos mediante wget:
Suponemos que tenemos un archivo de codigo html que se llama archivo.html donde aparecen los enlaces asi:

../li>
  • Documentos de Secretaría...

    limpiamos el contenido del archivo asi:

    $ sed '1,$ s/pdf/pdf\n/g' archivo.html |sed '1,$ s/http/\nhttp/g'|grep pdf | cat >>lista

    EXPLICACION DEL COMANDO: sed se utiliza para hacer cambios relativamente pequenos en archivos de texto. '1,$ s/pdf/pdf\n/g' es la orden, quiere decir, de la linea (1) hasta la ultima ($), substituir (s), la palabra pdf, por pdf\n donde \n es fin de linea, vamos como si pulsaramos intro. g indica que se hagan tantas substituciones como apariciones haya en cada linea. La salida de esta accion se continua. grep hace que se eliminen todas las lineas donde no aparezca la palabra pdf

    ahora tenemos un nuevo archivo llamado lista que contiene solamente las URL de cada archivo que queremos bajar
    y ahora bajamos todos los archivos de la lista con

    $ wget -i lista
  • Thursday, September 11, 2008

    create a custom keymap for maqii in nokia n800

    I've made a custom keymap used to play maqii (quake 2) in my N800. The file has to be placed in the baseq2 dir. When you touch the menu key in the device (F4) it changes the mode, there are the following modes:

    StrafeMode. normal mode, crouch, jump and change weapon
    ItemMode. I haven't play q2 so much so i don't know if this mode is useful after all
    zoomMode. zoom in, zoom out
    settingsMode. adjust the gamma and sound volume
    saveLoadMode. quick save and quick load

    esc key and home button are unchanged.


    //config.cfg file, put it in your base dir, just where the *.pak files are
    //quakeII
    bind TAB "inven"
    bind ENTER "+attack"
    bind ESCAPE "togglemenu"
    bind SPACE "+moveup"
    bind ' "invdrop"
    bind * "god"
    bind + "noclip"
    bind , "+moveleft"
    bind - "give rail gun"
    bind . "+moveright"
    bind / "weapnext"
    bind 0 "use BFG10K"
    bind 1 "use Blaster"
    bind 2 "use Shotgun"
    bind 3 "use Super Shotgun"
    bind 4 "use Machinegun"
    bind 5 "use Chaingun"
    bind 6 "use Grenade Launcher"
    bind 7 "use Rocket Launcher"
    bind 8 "use HyperBlaster"
    bind 9 "use Railgun"
    bind = "sizeup"
    bind [ "invprev"
    bind \ "+mlook"
    bind ] "invnext"
    bind ` "toggleconsole"
    bind a "+moveleft"
    bind b "use rebreather"
    bind c "+movedown"
    bind d "+moveright"
    bind e "use environment suit"
    bind g "use grenades"
    bind h "wave 0"
    bind i "use invulnerability"
    bind j "wave 1"
    bind k "wave 2"
    bind l "wave 3"
    bind n "noclip"
    bind p "use power shield"
    bind q "use quad damage"
    bind s "+back"
    bind t "messagemode"
    bind u "wave 4"
    bind v "noclip"
    bind w "+forward"
    bind x "score"
    bind z "+lookdown"
    bind ~ "toggleconsole"
    bind BACKSPACE "invdrop"
    bind UPARROW "+forward"
    bind DOWNARROW "+back"
    bind LEFTARROW "+moveleft"
    bind RIGHTARROW "+moveright"
    bind ALT "+strafe"
    bind CTRL "+movedown"
    bind SHIFT "+speed"
    bind F1 "cmd help"
    bind F2 "I r teh roxxorz"
    bind F3 "I pledge allegiance to the frag"
    bind F4 "ItemsMode"
    bind F5 ""
    bind F6 "+movedown"
    bind F7 "weapnext"
    bind F8 "+moveup"
    bind F10 "menu_quit"
    bind F12 "screenshot"
    bind INS "+klook"
    bind DEL "+lookdown"
    bind PGDN "+lookup"
    bind END "centerview"
    bind MOUSE1 ""
    bind MOUSE2 "+strafe"
    bind MOUSE3 "+forward"
    bind MWHEELDOWN "weapprev"
    bind MWHEELUP "weapnext"
    bind PAUSE "pause"

    alias quicksave "echo Quick Saving...; wait; save quick"
    alias quickload "echo Quick Loading...; wait; load quick"

    alias zoom90 "bind F7 zoom86; bind F8 echo nomorezoom ;fov 90.00;sensitivity 6.00; echo Zoom 90"
    alias zoom86 "bind F7 zoom82; bind F8 zoom90;fov 86.00;sensitivity 2.38; echo Zoom 86"
    alias zoom82 "bind F7 zoom78; bind F8 zoom86;fov 82.00;sensitivity 2.25; echo Zoom 82"
    alias zoom78 "bind F7 zoom60; bind F8 zoom82;fov 78.00;sensitivity 2.15; echo Zoom 78"
    alias zoom60 "bind F7 zoom45; bind F8 zoom78;fov 60.00;sensitivity 1.90; echo Zoom 60"
    alias zoom45 "bind F7 zoom30; bind F8 zoom60;fov 45.00;sensitivity 1.80; echo Zoom 45"
    alias zoom30 "bind F7 zoom15; bind F8 zoom45;fov 30.00;sensitivity 1.30; echo Zoom 30"
    alias zoom15 "bind F7 zoom10; bind F8 zoom30;fov 15.00;sensitivity 0.50; echo Zoom 15"
    alias zoom10 "bind F7 nomorezoom; bind F8 zoom15;fov 10.00;sensitivity 0.10; echo Zoom 10"

    alias vol10 "bind F8 vol20;s_volume 0.100000;echo Vol10"
    alias vol20 "bind F8 vol30;s_volume 0.200000;echo Vol20"
    alias vol30 "bind F8 vol40;s_volume 0.300000;echo Vol30"
    alias vol40 "bind F8 vol50;s_volume 0.400000;echo Vol40"
    alias vol50 "bind F8 vol60;s_volume 0.500000;echo Vol50"
    alias vol60 "bind F8 vol70;s_volume 0.600000;echo Vol60"
    alias vol70 "bind F8 vol80;s_volume 0.700000;echo Vol70"
    alias vol80 "bind F8 vol90;s_volume 0.800000;echo Vol80"
    alias vol90 "bind F8 vol100;s_volume 0.900000;echo Vol90"
    alias vol100 "bind F8 vol10;s_volume 1.000000;echo Vol100"

    alias gamma10 "bind F6 gamma20;vid_gamma 0.100000;echo gamma10"
    alias gamma20 "bind F6 gamma30;vid_gamma 0.200000;echo gamma20"
    alias gamma30 "bind F6 gamma40;vid_gamma 0.300000;echo gamma30"
    alias gamma40 "bind F6 gamma50;vid_gamma 0.400000;echo gamma40"
    alias gamma50 "bind F6 gamma60;vid_gamma 0.500000;echo gamma50"
    alias gamma60 "bind F6 gamma70;vid_gamma 0.600000;echo gamma60"
    alias gamma70 "bind F6 gamma80;vid_gamma 0.700000;echo gamma70"
    alias gamma80 "bind F6 gamma90;vid_gamma 0.800000;echo gamma80"
    alias gamma90 "bind F6 gamma10;vid_gamma 0.900000;echo gamma90"


    alias "StrafeMode" "bind F8 +moveup; bind F6 +movedown; bind F7 weapnext; bind F4 ItemsMode; echo StrafeMode"
    alias "ItemsMode" "bind F8 invNext; bind F6 inven; bind F7 invuse; bind F4 zoomMode; echo ItemMode"
    alias "zoomMode" "bind F8 zoom82; bind F6 +klook; bind F7 zoom90; bind F4 settingsMode; echo zoomMode"
    alias "settingsMode" "bind F8 vol10; bind F6 gamma50; bind F7 invuse; bind F4 saveLoadMode; echo settingsMode"
    alias "saveLoadMode" "bind F8 quicksave;bind F6 quickload;bind F4 StrafeMode;echo saveLoadMode"


    set cl_vwep "1"
    set gender_auto "1"
    set gender "none"
    set fov "90"
    set adr8 ""
    set sv_reconnect_limit "3"
    set allow_download_maps "1"
    set allow_download_sounds "1"
    set allow_download_models "1"
    set allow_download_players "1"
    set allow_download "1"
    set in_joystick "0"
    set in_mouse "1"
    set rate "5000"
    set freelook "1"
    set cl_stereo_separation "0.4"
    set adr7 ""
    set adr6 ""
    set adr5 ""
    set adr4 ""
    set adr3 ""
    set adr2 ""
    set adr1 ""
    set adr0 ""
    set cd_nocd "1"
    set s_primary "1"
    set s_mixahead "0.2"
    set s_loadas8bit "0"
    set s_khz "22"
    set s_volume "0.600000"
    set sw_stipplealpha "0"
    set vid_gamma "0.400000"
    set vid_ypos "81"
    set vid_xpos "128"
    set vid_ref "soft"
    set hostname "idkfa"
    set sw_allow_modex "1"
    set sw_mode "6"
    set msg "1"
    set g_select_empty "0"
    set skin "iddqd/iddqd"
    set name "Ivan"
    set lookstrafe "0"
    set lookspring "0"
    set m_pitch "0.022"
    set hand "0"
    set cl_run "1"
    set crosshair "1"
    set sensitivity "0.500000"
    set win_noalttab "0"
    set vid_fullscreen "1"
    set viewsize "100"