Pages

Wednesday, 6 March 2013

How to install rapidsms in Ubuntu (12.10)



RapidSMS is a free and open-source framework for dynamic data collection, logistics coordination and communication, leveraging basic short message service (SMS) mobile phone technology (according to rapidsms.org). RapidSMS is a python program built on top of django. This is a quick "how to" to have rapidsms quickly set up on an Ubuntu machine. It is seven step process.

Step 1: install python-django, python-pip.

$sudo apt-get install python-django
$sudo apt-get install python-pip

Step 2: Install rapidsms from the cheeseshop.

$sudo pip install rapidsms

If you have rapidsms installed already, then you can upgrade it:
$sudo pip install -U rapidsms

Step 3: Next install the http router

$sudo pip install rapidsms-httprouter

Step 4: Now that all is set, create a new project like so:

$cd
$rapidsms-admin.py startproject my_project

Please replace the my_project with the appropriate/desired name of your project.
Django will notice that you do not have a super user/admin account for the new project that you are creating so it will suggest that you create one. Enter the user name you desire and password. I suggest you oblige and enter these!

Step 5: Now create the db. If the name of the project in Step 4 was my_project, then;

$cd my_project

Else $cd name_of_your_newly_created_project

Now create/sync the db.
$python manage.py syncdb

Step 6: Try accessing the webUI of your newly created installation. Personally, I prefer running programs that capture my prompt using screen
So part (a) of this process is optional

(a) $screen

(b) $python manage.py runserver 0.0.0.0:8000
       or
       $python manage.py runserver

     $ Ctrl - A + D (to exit screen----you may need to read the screen manual pages)

       The first Option allows you to acess the rapidsms WebUI both locally and remotely and the second    allows you to access the rapidsms WebIU locally only. Personally, I prefer the first option because I develop most apps in VMs (Virtual Machines)

(c)  $python manage.py runrouter


You can access the admin interface that django assisted to create for you by typing this: http://your_ip_address:8000/admin. Enter the user name and password you created in Step 4.

There you are!!! You now have a barebones rapidsms installation.!!!



Thursday, 4 October 2012

How to view bios info

There exist a myriad of ways of retrieving hardware details of a host machine in Linux (as is case with Linux).
To extract information such as bios date, bios vendor, your board vendor and the like, you can use the virtual file system sysfs. That information is stored in the /sys directory.
The precise directory is: /sys/devices/virtual/dmi/id
So typing $head /sys/devices/virtual/dmi/id/* should display all the necessary details for you. You may also want to use sudo or su for elevated privileges to view some restricted files.
   1 ~$ ls -l /sys/devices/virtual/dmi/id/
   2 total 0
   3 -r--r--r-- 1 root root 4096 Oct  4 17:24 bios_date
   4 -r--r--r-- 1 root root 4096 Oct  4 08:16 bios_vendor
   5 -r--r--r-- 1 root root 4096 Oct  4 17:24 bios_version
   6 -r--r--r-- 1 root root 4096 Oct  4 19:37 board_asset_tag
   7 -r--r--r-- 1 root root 4096 Oct  4 17:24 board_name
   8 -r-------- 1 root root 4096 Oct  4 19:37 board_serial
   9 -r--r--r-- 1 root root 4096 Oct  4 08:16 board_vendor
  10 -r--r--r-- 1 root root 4096 Oct  4 17:24 board_version
  11 -r--r--r-- 1 root root 4096 Oct  4 19:37 chassis_asset_tag
  12 -r-------- 1 root root 4096 Oct  4 19:37 chassis_serial
  13 -r--r--r-- 1 root root 4096 Oct  4 08:16 chassis_type
  14 -r--r--r-- 1 root root 4096 Oct  4 19:37 chassis_vendor
  15 -r--r--r-- 1 root root 4096 Oct  4 19:37 chassis_version
  16 -r--r--r-- 1 root root 4096 Oct  4 19:37 modalias
  17 drwxr-xr-x 2 root root    0 Oct  4 19:37 power
  18 -r--r--r-- 1 root root 4096 Oct  4 08:16 product_name
  19 -r-------- 1 root root 4096 Oct  4 19:37 product_serial
  20 -r-------- 1 root root 4096 Oct  4 08:16 product_uuid
  21 -r--r--r-- 1 root root 4096 Oct  4 08:16 product_version
  22 lrwxrwxrwx 1 root root    0 Oct  4 11:15 subsystem -> ../../../../class/dmi
  23 -r--r--r-- 1 root root 4096 Oct  4 08:16 sys_vendor
  24 -rw-r--r-- 1 root root 4096 Oct  4 11:15 uevent

dmidecode

An alternative method to retrieving info on your BIOS and even other hardware information from dmi is dmidecode. This usually requires root privileges to execute. dmidecode is actually a dmi decoder what decodes readings from the dmi table. This is an example from my box:
   1 ~$ sudo dmidecode 
   2 # dmidecode 2.11
   3 SMBIOS 2.5 present.
   4 34 structures occupying 1791 bytes.
   5 Table at 0x000FCFE0.
   6 
   7 Handle 0x0000, DMI type 0, 24 bytes
   8 BIOS Information
   9     Vendor: American Megatrends Inc.
  10     Version: 210   
  11     Release Date: 03/02/2010
  12     Address: 0xF0000
  13     Runtime Size: 64 kB
  14     ROM Size: 1024 kB
  15     Characteristics:
  16         ISA is supported
  17         PCI is supported
  18         PNP is supported
  19         BIOS is upgradeable
  20         BIOS shadowing is allowed
  21         ESCD support is available
  22         Boot from CD is supported
  23         Selectable boot is supported
  24         EDD is supported
  25         5.25"/1.2 MB floppy services are supported (int 13h)
  26         3.5"/720 kB floppy services are supported (int 13h)
  27         3.5"/2.88 MB floppy services are supported (int 13h)
  28         Print screen service is supported (int 5h)
  29         8042 keyboard services are supported (int 9h)
  30         Printer services are supported (int 17h)
  31         CGA/mono video services are supported (int 10h)
  32         ACPI is supported
  33         USB legacy is supported
  34         Smart battery is supported
  35         BIOS boot specification is supported
  36         Function key-initiated network boot is supported
  37         Targeted content distribution is supported
  38     BIOS Revision: 2.10
  39     Firmware Revision: 176.1
  40 
  41 Handle 0x0001, DMI type 1, 27 bytes
  42 System Information
  43     Manufacturer: ASUSTeK Computer Inc.       
  44     Product Name: UL30VT             
  45     Version: 1.0      
  46     Serial Number: A3N0AS515480129    
  47     UUID: 8006A65E-0B33-DF81-3D9D-485B3926D33D
  48     Wake-up Type: Power Switch
  49     SKU Number:                    
  50     Family:                    
  51 
  52 Handle 0x0002, DMI type 2, 15 bytes
  53 Base Board Information
  54     Manufacturer: ASUSTeK Computer Inc.       
  55     Product Name: UL30VT   
  56     Version: 1.0      
  57     Serial Number: BSN12345678901234567
  58     Asset Tag: ATN12345678901234567
  59     Features:
  60         Board is a hosting board
  61         Board requires at least one daughter board
  62         Board is replaceable
  63     Location In Chassis: MIDDLE             
  64     Chassis Handle: 0x0003
  65     Type: Motherboard
  66     Contained Object Handles: 0
  67 
  68 Handle 0x0003, DMI type 3, 21 bytes
  69 Chassis Information
  70     Manufacturer: ASUSTeK Computer Inc.       
  71     Type: Notebook
  72     Lock: Not Present
  73     Version: 1.0      
  74     Serial Number: CSN12345678901234567
  75     Asset Tag: ATN12345678901234567
  76     Boot-up State: Safe
  77     Power Supply State: Safe
  78     Thermal State: Other
  79     Security Status: Other
  80     OEM Information: 0x00000000
  81     Height: Unspecified
  82     Number Of Power Cords: 1
  83     Contained Elements: 0
  84     
  85     ..............so on and so forth