There are simply just 2 things to do, you need to execute:

apt-get update
apt-get upgrade

Make sure you disbale xbmc and all process the take up processing power and memory,
as you want the update to happen as fast as possible. ;)


Okay, following problem when workin on debian is, it lacks coloring per default.
I wanted my raspbian pc to have colored shell, as it’s more comfortable to see directories and files and so on.

Here we go, first we need to do a backup of our /etc/bash.bashrc file by copying it.

root@raspberry-pi:/etc# cp bash.bashrc bash.bashrc.old
root@raspberry-pi:/etc# vi bash.bashrc

then we just replace the contents with this one:

 

# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don’t do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

use_color=false

# Set colorful PS1 only on colorful terminals.
# dircolors –print-database uses its own built-in database
# instead of using /etc/DIR_COLORS. Try to use the external file
# first to take advantage of user additions. Use internal bash
# globbing instead of external grep binary.
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
match_lhs=”"
[[ -f ~/.dir_colors ]] && match_lhs=”${match_lhs}$(<~/.dir_colors)”
[[ -f /etc/DIR_COLORS ]] && match_lhs=”${match_lhs}$(/dev/null \
&& match_lhs=$(dircolors –print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true

if ${use_color} ; then
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
if type -P dircolors >/dev/null ; then
if [[ -f ~/.dir_colors ]] ; then
eval $(dircolors -b ~/.dir_colors)
elif [[ -f /etc/DIR_COLORS ]] ; then
eval $(dircolors -b /etc/DIR_COLORS)
fi
fi

if [[ ${EUID} == 0 ]] ; then
PS1=’${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ‘
else
PS1=’${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ‘
fi

alias ls=’ls –color=auto’
alias grep=’grep –colour=auto’
else
if [[ ${EUID} == 0 ]] ; then
# show root@ when we don’t have colors
PS1=’\u@\h \W \$ ‘
else
PS1=’\u@\h \w \$ ‘
fi
fi

# Try to keep environment pollution down, EPA loves us.
unset use_color safe_term match_lhs

# Commented out, don’t overwrite xterm -T “title” -n “icontitle” by default.
# If this is an xterm set the title to user@host:dir
#case “$TERM” in
#xterm*|rxvt*)
# PROMPT_COMMAND=’echo -ne “\033]0;${USER}@${HOSTNAME}: ${PWD}\007″‘
# ;;
#*)
# ;;
#esac

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi

# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found ]; then
function command_not_found_handle {
# check because c-n-f could’ve been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found — $1
return $?
elif [ -x /usr/share/command-not-found ]; then
/usr/bin/python /usr/share/command-not-found — $1
return $?
else
return 127
fi
}
fi

 

Note the onfiguration file is consequently licensed under GPL.


So latley I’m thinking about getting a cat.

And as I already like cats i prefer them small, and here you go I found a race the does this – Singapura.

According to wikipedia it’s – “Singapura is one of the smallest breeds of cats, noted for its large eyes and ears, brown ticked coat and blunt tail. Reportedly established from three “drain cats” imported from Singapore in the 1970s, it was later revealed that the cats were originally sent to Singapore from the US before they were exported back to the US. Investigations by the Cat Fanciers’ Association (CFA) concluded no wrongdoing and the Singapura kept its status as a natural breed”

Singapura
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And there is also a guy in Amstetten that is breeding and raising them. I’m still not sure if I should write him a message.

 

Raffles Singapura cat

 

  


Ok, so I’ve just read the amazing post from raspberrypi.org about automization and it’s quite interesting.
So if your’re looking for such a project maybe you should take a look at this.

Home automation from 50 miles away – with a Raspberry Pi

Simon Maple and Andy Stanford-Clark, Friends of Pi from IBM, have been having a lot of fun with Andy’s house, which is networked and monitored up to the rafters. They’ve added a Raspberry Pi, IBM’s Liberty Profile, and Really Small Message Broker for sending telemetry-type data using MQTT. The result is a great little tech demo where Simon turns Andy’s pond fountain and heated towel rail on and off remotely from his own house 50 miles and a stretch of sea away, watching energy usage fluctuate in real time; he can even check the levels in Andy’s oil tank. This is brilliant: lightweight software running on lightweight hardware, doing some really useful stuff.

I do not think I’ve ever found a towel rail so interesting; I love seeing demos like this with so many real-world applications.

Massive thanks to Simon and Andy for all their work on this (there’s more on Simon’s blog), and especially to Simon for being such a fantastic pi-vangelist. Everybody else: if you’re reading this and have come up with a Raspberry Pi demo you think we’d be interested in, please email me (my details are available on the Contacts page). We’re always looking for new projects to feature here on the blog.” – article from http://www.raspberrypi.org/archives/tag/home-automation


First you have to login to the raspberry thorugh ssh as root.

The next step is to execute fdisk with the parameter to the sd-card.

root@raspberry-pi:/# fdisk /dev/mmcblk0

So what you will want to do first is print the partion table.

Command (m for help): p

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders, total 15523840 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: 0x00027aa3

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 104447 51200 b W95 FAT32
/dev/mmcblk0p2 104448 1742847 819200 83 Linux
/dev/mmcblk0p4 15319040 15521791 101376 82 Linux swap / Solaris

 

So from what we see, the swap partion was already deleted before and moved to the end, therefore there is no need for us to delete it.
But what we want is to delete the root partion – don’t worry we will recreate it with the same starting block and extend it to the max size possible.

Command (m for help): d
Partition number (1-4): 2

Command (m for help): p

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders, total 15523840 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: 0x00027aa3

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 104447 51200 b W95 FAT32
/dev/mmcblk0p4 15319040 15521791 101376 82 Linux swap / Solaris

The next step is to recreate the partion:

Command (m for help): n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (104448-15523839, default 104448): 104448
Last sector, +sectors or +size{K,M,G} (104448-15319039, default 15319039): 15319 039

Command (m for help): p

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders, total 15523840 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: 0x00027aa3

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 104447 51200 b W95 FAT32
/dev/mmcblk0p2 104448 15319039 7607296 83 Linux
/dev/mmcblk0p4 15319040 15521791 101376 82 Linux swap / Solari s

So okay, now we’ve recreated the partion. Now we just need to write this to the partion table.

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Das Gerät oder die Ressource ist belegt.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

So the only thing we need to do is reboot the whole raspberry pi.

root@raspberry-pi:/# reboot

The system is going down for reboot NOW! (pts/0) (Sun Feb  9 12:27:08 2014)

 

 

So after booting the wholle thing up again, i check the partion tables with fdisk -l

root@raspberry-pi:~#

root@raspberry-pi:~# e2fsck -f /dev/mmcblk0p2
e2fsck 1.42.5 (29-Jul-2012)
/dev/mmcblk0p2 is mounted.
e2fsck: Fortsetzung nicht möglich, breche ab.
root@raspberry-pi:~# resize2fs /dev/mmcblk0p2
resize2fs 1.42.5 (29-Jul-2012)
Das Dateisystem ist schon 204800 Blöcke groß. Nichts zu tun!

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders, total 15523840 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: 0x00027aa3

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 104447 51200 b W95 FAT32
/dev/mmcblk0p2 104448 1742847 819200 83 Linux
/dev/mmcblk0p4 15319040 15521791 101376 82 Linux swap / Solaris

So as e2fsck won’t work, while the partion is online we need to use resize2fs.

root@raspberry-pi:~# e2fsck -f /dev/mmcblk0p2
e2fsck 1.42.5 (29-Jul-2012)
/dev/mmcblk0p2 is mounted.
e2fsck: Fortsetzung nicht möglich, breche ab.
root@raspberry-pi:~# resize2fs /dev/mmcblk0p2
resize2fs 1.42.5 (29-Jul-2012)
Das Dateisystem ist schon 204800 Blöcke groß. Nichts zu tun!

The next step i just wanted to make sure the swap is used correctly, as after recreating the swap partion it is now here as /dev/mmcblk0p4

root@raspberry-pi:~# df -k

Dateisystem 1K-Blöcke Benutzt Verfügbar Verw% Eingehängt auf
rootfs 7498664 843636 6654212 12% /
/dev/root 7498664 843636 6654212 12% /
devtmpfs 216108 0 216108 0% /dev
tmpfs 44876 196 44680 1% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 110020 0 110020 0% /run/shm
/dev/mmcblk0p1 50396 18484 31912 37% /boot
root@raspberry-pi:~# free -lm
total used free shared buffers cached
Mem: 438 122 315 0 22 63
Low: 438 122 315
High: 0 0 0
-/+ buffers/cache: 36 401
Swap: 0 0 0

so we will need to edit the /etc/fstab

root@raspberry-pi:~# vim /etc/fstab
root@raspberry-pi:~# free -lm
total used free shared buffers cached
Mem: 438 123 314 0 22 63
Low: 438 123 314
High: 0 0 0
-/+ buffers/cache: 36 401
Swap: 0 0 0
root@raspberry-pi:~# mkswap /dev/mmcblk0p4
Setting up swapspace version 1, size = 101372 KiB
no label, UUID=b0a02950-9ee8-41fc-a1fe-4d55e6fe34d5
root@raspberry-pi:~# free -lm
total used free shared buffers cached
Mem: 438 123 314 0 22 64
Low: 438 123 314
High: 0 0 0
-/+ buffers/cache: 37 401
Swap: 0 0 0

Last step is to reboot, Cheers you earned your beer.
root@raspberry-pi:~# reboot


Okay so i bought my raspberry pi today.
The plan is to run it with a raspdebian, that is an image of debian ported to the raspberry pi hardware.

You can find all types of images on raspdebian.org

I decided to use the darkbasic image, as it uses Hard Float binaries (floating point operations are done in hardware instead of software emulation, that means higher performance)

So I downloaded the whole image and the flashed it to the sd card using Win32Diskimager (to see details scroll to the bottom of this post)

 

Finally flashing was done, i connected the Pi to the network, inserted the sd scard and booted it for the first time. Everything worked like a charm.

So i check the clients on my router and found the ip that the pi got from my router (dhcp) – 192.168.0.12

I connected through ssh, the username is root for darkbasic and the password raspberry. You can change this with standard linux tools.
After that, you need to configure it using the following commands:

dpkg-reconfigure tzdata
to configure your timezone

dpkg-reconfigure console-data
keyboard layout (note: it’s good idea to connect the keyboard before doing this)

dpkg-reconfigure locales
so for austria you’ll need to get de_AT.UTF8

 

So the next step is to connect the pi to a display and install xbmc.

If you don’t want to compile it on the pi, which can take some time ~12h according to a post i read,
you can use the  XBMC package of Michael Gorvan.

Flashing the SD Card using Windows

Using the Win32DiskImager program

  1. Download the distribution from the raspberrypi.org downloads page or from a mirror or torrent. Make sure the distribution is for the Raspberry Pi, as others will not work. Usually these are zipped (compressed) files ending in .zip or .gz (something like “distribution-name.zip”).
  2. Extract the image file from the downloaded .zip file, so you now have “distribution-name.img”.
  3. Insert the SD card into your SD card reader and check what drive letter it was assigned. You can easily see the drive letter (for example G:) by looking in the left column of Windows Explorer. You can use the SD Card slot (if you have one) or a cheap Adapter in a USB slot.
  4. Download the Win32DiskImager utility (it is also a zip file). You can run this from a USB drive.
    Win32DiskImager screen
  5. Extract the executable from the zip file and run the Win32DiskImager utility; you may need to run the utility as Administrator! Right-click on the file, and select ‘Run as Administrator’
  6. Select the image file you extracted above.
  7. Select the drive letter of the SD card in the device box. Be careful to select the correct drive; if you get the wrong one you can destroy your data on the computer’s hard disk! If you are using an SD Card slot in your computer (if you have one) and can’t see the drive in the Win32DiskImager window, try using a cheap Adapter in a USB slot.
  8. Click Write and wait for the write to complete.
  9. Exit the imager and eject the SD card.
  10. You are now ready to plug the card into your Raspberry Pi. See RPi_Hardware_Basic_Setup for the other things you need.

In Windows, the SD card will appear only to have a fairly small size once written – about 55 to 75 MB. This is because most of the card has a partition that is formatted for the Linux operating system that the Raspberry Pi uses which is not visible in Windows. If you don’t see this small directory with files such as kernel.img then the copy may not have worked correctly.


Willkommen auf meinem Blog, dies hier ist mein erste Eintrag.
Ich habe gerade die Blogsoftware installiert und bin noch dabei alles anzupassen.
Die Arbeiten sind im Gange und ich werde in diesem Blog noch so einige Zeit investieren.
Ich bin schon gespannt wie es so wird.

Ich wünsch euch allen natürlich jetzt schon viel Spaß beim lesen,
sei dies beim Kaffee in der Früh oder einfach beim schmunzeln über den ein oder
anderen Artikel von mir.