1

LINUX OPERATING SYSTEM

 

 

      

       RASPBERRY PI

      

      

       The following notes explain some of the options open to new-comers to the Raspberry Pi minature computer.

       The Raspberry Pi uses the Linux OperatingSytem (OS) and its microprocessor is a member of the ARM family. This processor has

       a machine code based on the principle of 'Reduced Instruction Set'

       (RISC), when compared with with other processors , e.g Intel's various family members.

      

      

      More Information

      Raspberry Pi Foundation please see link


      

      

      

      GENERAL PURCHASING

      The Raspberry Pi may be purchased on-line from:-

       Modmypi Please see link

      Element14 please see link

       RS Components please see link

      

      

       Notes for Saturday 4th January 2014

      

       Once Raspberry Pi has been connected to the internet

      the correct time is automatically set

      Substitutions ie short cuts are best made using

      the definition (see alias, below)

      

      COPYING

      

      Normally cp will copy files from SOURCE TO DEST

      However, if we wish to include all directories

      in the copy, we must use cp -R SOURCE DEST

      

      

      # alias

      

      name () (command)

      

      eg rbt () (sudo reboot) will reboot the system

      

      NOTE:

      To make an app work at every session, enter

      the required bash command at the end of the

      bashrc file.

      This file is found in the dir 'etc'.

      cd /etc;ls You must have root permission to

      alter the contents this file.

      

      

      The leafpad editor is in the folder - Applications

      There is path to it directly from Raspberrypi folder

       Note

      

      To make a file executable where appropriate use

      

      chmod +x

      

      To make a file readable and writeable use

      

      chmod =rw

      

      To close a Window can use Alt+F4

      

      Whilst in LX-Terminal system you can

      return to the Desktop by using 'exit'

      note: this command is case sensitive

      

      Partition table can be viewed by typing

      sudo fdisk -l (Note option is lower case 'L'

      and Not -1!!)

      

      To make a permanently executable write:-

      'sudo cp /usr/local/bin

      Make sure has the correct mode +x set

      

      Useful batch type file can be built as follows:-

      Open a new named and write:-

      #!bin/bash

      

      no terminator statement is required

      

      

      Note: where the syntax $() is used,

      there is no space between the '$' an the '('

      

      When assembling code which enables the vfp

      coprocessor, the assembler 'as' doesn't work

      Use the gcc compiler instead. The format is:-

      

       gcc -g -o

      

      In order to read a pdf file - ,pdf

      use xpdf .pdf

      

      File listing.

      To get block size use:-

      ls -s --size or simply ls -s

      

      In order to remove a directory, use the command

       rm -r

      note that in the 'c' statement'printf', if a variable is to be printed

      with a description string, the variable will be printed at the exact position

      of the printing tag %. e.g.

      

      printf("The name of the input file is :- %s", argv[i]

      

      full details of file systems in use, including media files

      the later will show from any usb 'plug-ins'

      must use super-visor permission:-

      sudo gparted

      

      IMPORTING TKINTER

      Note: The default version of python is python2.7.

      However the latest ver is python3.2

      In order see the modules available, it is necessary to

      open /usr/lib

      A list of modules is then available by doing an ls

      here. Tkinter (dir) then shows

      

      RUNNING TKINTER

      In order to keep the current tkinter running

      the last instruction in the module listing

      must be:

      

      root.mainloop()

      

      otherwise the graphics window will collapse before

      it is seen!

      

      RUNNING PYTHON PROJECTS

      Care must be taken when coding python projects

      e.g. tkinter is not available on python2 and

      pygame.py is not available on python3 !

      

      IMPORTING NEW MODULES

      Importing new modules into python is not

      as straight-forward as it may seem. This is

      because there are several version of python

      all with different libraries.

      e.g. importing 'livewires' from py3e_software

      it is necessary to make a new directory

      'livewires' in the python2.7 library

      use sudo mkdir here.

      Then go back and sudo cp the contents of the

      livewires folder into the new lib folder

      'livewires'. This necessay as we also need

      'pygame'. Then it all works!

      

      GNUPLOT

      

      The output is of the form:

      .png

      

      'png' is an image format. In order to see

      the image, needs must find the 'png'

      file in file manager mode and click on it

      e.g. plot2x.png

      GIMP can also be used to show these images

      

      Scope of 'find' may be increased by using a

      depth parameter e.g. find -O2 qqqqq

      

      Apps which have been installed (during use)

      are stored in usr/bin directory.

      Apps which were installed on Debian originally

      are stored in bin directory

      Apps which were compiled by the user

      are stored usr/local/bin directory

      

      

      INTERNET NOTES

      

      ifconfig

      

      This command gives details of local area network

      

      If you know the four digit IP address of a particular web-site

      use:

      traceroute or

      eg Google.com or 173.194.34.136

      

      Local Gateway

      

      The IP address of the internet provider is the Gateway

      AUXILLARY FILE DESIGNATION

      

      When a 'batch' type file is executed,

      the file names appearing on the command line are

      designated as follows:-

       First $0

      3rd $2

      etc.

      

      REMOVAL AND REINSTALLING FILES IN DIR /local/bin

      

      If an exxecutable file in above dir has been mistakenly

      installed in a dir, rm the file in that dir.

      Then change to the desired dir and

      use:

      cp /usr/local/bin/ .

      

      PRESERVING THE ORIGINAL TXT OF 'EXE' FILES

      

      Once exe files are enabled, they cannot be re-edited

      copied or changed. This problem can be over-ridden

      by making a copy of the original txt before processing

      eg :- cp $0 $0.arch

      The *.arch file can then be developed further

      if required, without having to re type the code

      

      PING PARAMETERS

      

      The number of ping shots may be spcified:

      

      ping -c12

      

      


LATEST DEVELOPMENTS

New Raspberry Pi model 2 is now released. Full details on:- please see link