sábado, 2 de fevereiro de 2013

New Buy RaspBerry Pi

A long  time ago that I haven't updated my Blog, I hope that this year the updates come more fast with more news. Since the last update there was so many projects that I have done that when I have time I will post here. For now I will post my recent buy, an Raspberry Pi Model B:


The Hardware Specs:


  • Broadcom BCM2835 700MHz ARM1176JZFS processor with FPU and Videocore 4 GPU
  • GPU provides Open GL ES 2.0, hardware-accelerated OpenVG, and 1080p30 H.264 high-profile decode
  • GPU is capable of 1Gpixel/s, 1.5Gtexel/s or 24GFLOPs with texture filtering and DMA infrastructure
  • 512 MB RAM
  • 10/100 BaseT Ethernet ports
  • HDMI socket
  • 2 USB 2.0 socket
  • RCA video socket
  • SD card socket
  • 3.5 mm audio out jack
  • Header footprint for camera connection


  • Size: 85.6 x 53.98 x 17 mm

  • Some extra Hardware purchased:





    • Dane-Elec Proline 200X SDHC 8GB Class 10
    • DWA-123 Wireless N 150 USB Adapter - D-Link
    • USB Power supply 5v 1.5mA output

    Software Review:

    I installed several SOs and there are a little review for the ones that I have tryed:
    • Raspian: it have a behaviour like an "normal" SO but for some operations like open the browser, open a Web Page with some flash we notice that it's slow;
    • OpenElec: it's a multimedia SO with xbmc, it's very fast because it's a lightweight SO with a few programs. It's very limited but it does what is supposed to do.
    • RaspBMC: that's the SO that I have installed now, it's more slow than OpenElec but it's Debian based and comes with apt-get tool, so it's more customizable  and I want to make some modifications on XBMC so I opt by this distribution. 


    It's all for now. From now on I will post some helpful scripts and modified Add-Ons to watch better TV.





    domingo, 3 de abril de 2011

    Query WikiPedia via console/shell script

    Sometimes we need an quick answer about something...yeahh! We have google :-). But if we are working without graphic environment or if we need an quickly quickly answer?

    We can make an query from command line to wikipedia and we got the response instantly, without advertisements, without open pages in web browser and without search in web page from the answer that we need.

    So I developed an shell script to do this job for us:
    #!/bin/bash
    # Developed by Antonio Mendes 3/04/2011
    #
    # about - this script returns a few documentation about something
    #

    QUERY_STR=$@

    TEST_NET=$(ping -c 1 www.wikipedia.org  2> /dev/null | grep "0% packet loss")

    if [ "$TEST_NET" != "" ]; then
            ANSWER=$(dig +short txt "$QUERY_STR".wp.dg.cx)
    else
            echo "Network down, please try again later!"
            exit 1
    fi

    if [ "$ANSWER" != "" ];then
            echo $ANSWER
    else
            echo "Your query don't return any result, please make sure that it's a valid term!"
    fi
    Next save as about and give execution permissions.

    To execute you must call the script wiht the word to query like this:
     antonio@pc:~$ ./about Benfica
    "Sport Lisboa e Benfica (\; commonly referred to as simply Benfica, S.L. Benfica and in many fan anthems as SLB ) is a multisports club based in Lisbon, Portugal, best known for its football team. Sport Lisboa e Benfica was founded in 1904 by a group of twe" "nty-four men. The club's main stadium is the Est\195\161dio da Luz in the Luz area of Lisbon... http://a.vu/w:S.L._Benfica"
     antonio@pc:~$ ./about Linux
    "Linux (commonly pronounced in English\; variants exist) is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration\; t" "ypically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the... http://a.vu/w:Linux"
    It's all, from now on you have an Wikipedia in your command line.

    sábado, 2 de abril de 2011

    Linux kernel 2.6.39 RC is available

    Just launched the first version 2.6.39 RC of Linux kernel.
    Some features: 
    Nouveau drivers for Nvidia cards will give a boost of outstanding quality, Exceeding even the proprietary driver performance . More or less the same thing happened and the Ati in the Kernel 2.6.38, yielding 3D quite well but as a user of a HD series 400.

    For list of completed new features/changes go to official website.

    Log in Linux with an USB Pen Drive

    Recently I had the idea in increase the security of my Netbook, so I think if it's possible to keep an user session only if an determinated USB pen drive is plugged. I have made an research and I found that there are already some tools to do that.
    One of the most popular is pam_usb tools, this tool provides, among other things to do:
    • Password less authentication, use USB stick for that;
    • Two-factor authentication. USB stick and password to authenticate the user.
    • Support for all kind of removable devices (SD, MMC, etc);
    • It works with any application supporting PAM, such as su, any login manager (GDM, KDM), etc.
     How to install:
     First install needed packages:
    apt-get install libpam-usb pamusb-tools
    Connect the pen drive and add it to any name.
    Note: Check if it's only one pen drive connected;
    Note2: The data in pen drive is not erased.
    pamusb-conf –add-device token

    Now add the user account associated to that pen drive.
    pamusb-conf –add-user youruser
    Note: Answer all questions with 'yes'.

    Check if all process is done correctly: 
    pamusb-check youruser
    If it says: Access Granted it's all ok.

    Finally you must add " auth sufficient pam_usb.so" to file /etc/pam.d/common-auth.

    From now you can login with your USB pen drive, but it's not all you can run an script and perform some action...For more information please visit the official page.



    quarta-feira, 24 de fevereiro de 2010

    Seting up a DHCP server

    To quickly install and set up a DHCP server on Linux you need to download the DHCP software from here.
    After the download do:
    $ tar xzvf dhcp-4.1.1.tar.gz
    After extract do:
    $ cd dhcp-4.1.1/
    $ ./configure
    $ make; make install
     Now we have the dhcp server installed so we need to configure that.

    The /etc/dhcpd.conf File

    When the server starts it reads the dhcpd.conf file. In this file we need to pute the configurations that we wish to our network.

    Normally this file is NOT created in installation, but you can:

    $ touch /etc/dhcpd.conf

    Finally we need to edit the file for our case.
    So let's see an example that explains the most important fields. Adapt for your case:
    ddns-update-style interim
    ignore client-updates
     
    subnet 192.168.1.0 netmask 255.255.255.0 {
     
       # The range of IP addresses the server
       # will issue to DHCP enabled PC clients
       # booting up on the network
     
       range 192.168.1.201 192.168.1.220;
     
       # Set the amount of time in seconds that
       # a client may keep the IP address
    
      default-lease-time 86400;
      max-lease-time 86400;
     
       # Set the default gateway to be used by
       # the PC clients
     
       option routers 192.168.1.1;
       # Don't forward DHCP requests from this
       # NIC interface to any other NIC
       # interfaces
     
       option ip-forwarding off;
     
       # Set the broadcast address and subnet mask
       # to be used by the DHCP clients
     
      option broadcast-address 192.168.1.255;
      option subnet-mask 255.255.255.0;
      
       # Set the NTP server to be used by the
       # DHCP clients
    
      option ntp-servers 192.168.1.100;
    
       # Set the DNS server to be used by the
       # DHCP clients
    
      option domain-name-servers 192.168.1.100;
     
       # If you specify a WINS server for your Windows clients,
       # you need to include the following option in the dhcpd.conf file:
    
      option netbios-name-servers 192.168.1.100;
     
       # You can also assign specific IP addresses based on the clients'
       # ethernet MAC address as follows (Host's name is "laser-printer":
    
      host laser-printer {
          hardware ethernet 08:00:2b:4c:59:23;
         fixed-address 192.168.1.222;
       }
    }
    #
    # List an unused interface here
    #
    subnet 192.168.2.0 netmask 255.255.255.0 {
    }
     To see more options:
    $ man dhcp-options

    So to start our DHCP server:
    $ dhcpd start 



    segunda-feira, 8 de fevereiro de 2010

    Linux Training from Linux Experts - FREE

    "A little less than a year ago, the Linux Foundation launched a program to provide a variety of training opportunities for Linux professionals. Just a few months later, the Foundation moved the program online, offering web-based sessions of select courses to reach a wider audience. On Tuesday, they took it one step further, announcing the free — as in beer — Linux Training Webinar Series.
    The idea behind the Linux Foundation Training Program was to offer job training that would help fill the continuing demand for Linux professionals. The courses would be taught not by professors or lecturers, but by actual Linux developers, including the Foundation's Technical Advisory Board which boasts names like Ted Ts'o, Jonathan Corbet, Alan Cox, and Chris Wright, among others.
    The first courses were held on-site at Linux Foundation events, including the inaugural event at the annual Collaboration Summit, as well as independent sessions in various cities and corporate-sponsored training. With the success of the Collaboration Summit sessions, the Foundation branched out, offering the same classes taught by the same faculty, but in a Virtual Classroom setting. The courses — which the Foundation will continue to offer — last from two to five days, and run anywhere from $1,200 (for two days) to $2,750 (for five days).
    The new classes, designated the Linux Training Webinar Series, will provide an introduction to the basics of Linux, from tuning and file systems to community interaction. Instructors will continue to include prominent Linux developers, including TAB members. Foundation Executive Director Jim Zemlin described the program as "connect[ing] developers and users with the rock-stars of Linux...to expand the talent pool for Linux."
    A number of courses have already been arranged, beginning with Jon Corbet's How to Work with the Linux community on March 1st. Other sessions will include Linux Performance Tuning with Ted Ts’o, Christoph Hellwig's A Linux Filesystem Overview, James Bottomley presenting An Introduction to Git, and “Btrfs: An Intro and Update from Chris Mason. Registration has already opened for Corbet's course, and those interested in other offerings can sign up to be notified as more information becomes available.
    Additionally, the Foundation released its Winter/Spring 2010 course catalog for its Classroom, Virtual Classroom, and On-Site training programs. Developer sessions will include Developing Applications For Linux, Embedded Linux Development, Developing with GIT, Linux Kernel Internals and Debugging, and Developing Linux Device Drivers, with Linux Performance Tuning announced for the administration track.
    More information on all of the Linux Foundation's training opportunities is available from training.linuxfoundation.org."
    in LinuxJournal

    quinta-feira, 4 de fevereiro de 2010

    Symbian Opens Up

    "Nokia bought Symbian in 2008, and nobody believes that their thoughts were anywhere near Open Source particularly given that just weeks prior, it's Open Source chief declared that when it came to FOSS, the company wasn't "ready to play by the rules." Nevertheless, Open Source was exactly what Nokia had in mind for Symbian, as as of today, the process is complete.
    SymbianParts of the Symbian platform have been Open Source for quite some time — portions of the code were Open Sourced shortly after it was donated to the Symbian Foundation, and other portions have slowly been released in the nearly two years since. The complete opening wasn't expected until later this year, but finished ahead of schedule due, said Foundation Executive Director Lee Williams, to "the extraordinary commitment and dedication from our staff and our member companies."
    The Symbian Foundation picked the Eclipse Public License as its Open Source variant of choice. According to the Symbian Developer Community site, the EPL was chosen "because it balances our goals of encouraging development of the Symbian platform, builds a contributor community and encourages vigorous commercial competition through innovation on top of the platform." It goes on to specifically address the choice not to use the GPL, saying they "[want] to be absolutely clear" that those using the Symbian platform in devices "will be able to add new features and support new hardware without having to make all of that code open source," excepting certain alterations of the licensed code itself. Some code, however, is available under other Open Source licenses, though examples were not immediately available.
    The full Symbian^3 codebase — 108 packages in all — is now available for download from the Symbian developer site, including developer and product development kits."

    in Linux Journal

    Creating Bootable USB Install Drives with UNetbootin

    You can make easier your iso files bootable with UNetbootin. See this tutorial and learn:

    Run Windows Programs With WIN



    "Wine lets you run Windows software on other operating systems. With Wine, you can install and run these applications just like you would in Windows.

    Wine is still under active development. Not every program works yet, however there are already several million people using Wine to run their software."

    To install WIN go to this website and get the program. According to your installation run the installation file.

    Util programms:
    • WineCheck -script that check errors on wine configurations.
    • WineTools - a little script that helps in the configuration of programs.

    segunda-feira, 1 de fevereiro de 2010

    Add a script to run on boot

    So if you have a script and you wish to run them each time you boot up. This will tell you how to do that.

    Write a script. put it in the /etc/init.d/ directory.
    Lets say you called it XPTO.
    • Give them execution privileges using:
    $chmod + XPTO
    •  Now run

    $update-rc.d XPTO defaults

    You can check out
    % man update-rc.d for more information. It is a Debian utility to install scripts. The option “defaults” puts a link to start XPTO in run levels 2, 3, 4 and 5. (and puts a link to stop XPTO into 0, 1 and 6.)

    • To know which runlevel you are in use:
      $runlevel


    Add a Grub Splash Image

    The grub selection menu does not have a image. If you want to add your images to that menu you can, doing this:


    $sudo apt-get install grub-splashimages
    This will put the images in:
    /boot/grub/splashimages
    To add your own do this:

    $cd /boot/grub
    $sudo ln -s splashimages/debsplash.xpm.gz splash.xpm.gz
    $sudo update-grub

    What we just did was to link /grub/boot/splash.xpm.gz to the debsplash.xpm.gz splash image, and then updated the grub menu.