Tuesday, March 8, 2016

A little Pi.


Had a Raspberry Pi A+ for a while but never really did anything with it. Decided to get it out and do something with it. First was to go to the download page and get an image. For sake of time I downloaded the lite raspian image.

Noticed that with some Raspberry pi A+'s that polarity matters when using some voltage adapters when connected to a ups..


Then it had to be unzipped.

$ unzip 2016-02-26-raspbian-jessie-lite.zip

To see which device is the memory card. 

$ sudo fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00027adf

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   485255167   242626560   83  Linux
/dev/sda2       485257214   488396799     1569793    5  Extended
/dev/sda5       485257216   488396799     1569792   82  Linux swap / Solaris

Disk /dev/sdb: 15.5 GB, 15548284928 bytes
255 heads, 63 sectors/track, 1890 cylinders, total 30367744 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            8192    30367743    15179776    c  W95 FAT32 (LBA)

In this case, /dev/sdb1  is the drive want to use. You can tell by the smaller size and the file type is not linux. You do not want to overwrite your hard drive!



Then you want to send the image to the memory card. The bs=4M is important for sector size.

$ sudo dd bs=4M if=2016-02-26-raspbian-jessie-lite.img of=/dev/sdb

You also may want to make sure the device is bootable by using the a option.

$ sudo fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 15.5 GB, 15548284928 bytes
255 heads, 63 sectors/track, 1890 cylinders, total 30367744 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            8192    30367743    15179776    c  W95 FAT32 (LBA)

Command (m for help): h
h: unknown command
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help):

Your file system may look different.

You will need to have an ethernet connection. For setup, I like to use a hardwired connection to make things simpler using a usb to ethernet adapter as shown above.

Insert the memory card into the RPi and boot.

Then from another system you can find the ipaddress using the pingall.sh mentioned in an earlier article.

Then from another machine using the command line, you can log into the RPi. The password is raspberry. recommend changing it though.



$ ssh pi@192.168.1.122
pi@192.168.1.122's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Mar  8 06:28:49 2016 from oedt01
pi@raspberrypi:~ $

If you are connected to the internet you can update your system with

$ sudo apt-get update

and then

$ sudo apt-get upgrade

Have already done mine once.

$ sudo apt-get update
Hit http://archive.raspberrypi.org jessie InRelease
Get:1 http://mirrordirector.raspbian.org jessie InRelease [15.0 kB]
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Get:2 http://mirrordirector.raspbian.org jessie/main armhf Packages [8,963 kB]
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB       
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Get:3 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [37.5 kB]
Get:4 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [70.3 kB]
Get:5 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]  
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB       
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en          
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB          
Ign http://mirrordirector.raspbian.org jessie/main Translation-en             
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB      
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en         
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB           
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en              
Fetched 9,087 kB in 55s (164 kB/s)                                            
Reading package lists... Done
pi@raspberrypi:~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $

Then you can add or remove software as needed.

You are up and running!

Do not forget to

$ sudo poweroff

Before unplugging the power.

Note: if you add xrdp you can access the Pi via RDP. but you will have to use the full image to get the gui.

$ sudo apt-get install xrdp.



You can use the same basic idea to install linux on other Raspberry Pi's.



Sunday, March 6, 2016

Tie clasp

Change of pace.


Just a simple tie clasp you can make very easily. All you need is  old coathanger and some kind of medallion for decoration.

Step 1: What's needed:

Old coathanger
Mediallion

Glue
Wire cutter/pliers.

Step 2: Coat hanger surgery.

Take a section for the bottom of the coat hanger
The the section and bend it into a paperclip form of about an inch and a half..

Step 3: Making the catch bar.

Cut off the extra length that you did not use as part of the paperclip.
Take the two ends and bend then into eyelets.
Total length should fit around two buttons.
Attach to the shirt.

Step 4:

Glue medalion to paperclip form.
Let dry completely.

Step 5: Tada!