Author Archives: te-bachi

Sensors

Gyroscope, Acceleration and Compass

MPU-6050 3x Axis accelerometer sensor and 3x Axis gyroscope sensor
MPU-9150 Nine-Axis (Gyro + Accelerometer + Compass) MEMS MotionTracking (MPU-6050 + AK8975)
AK8975 3-axis electronic compass
HMC5883L Triple Axis Magnetometer
BMP180 Barometric Pressure Sensor
L3GD20 3-axis digital gyroscope
LSM303D 3D accelerometer and 3D magnetometer

Humidity and Temperature

TMP006 Infrared Thermopile Sensor
AM2302 humidity capacitor module
AM2321 capacitive humidity sensing digital temperature and humidity sensor
SHT21 3-axis electronic compass
SHT11 Triple Axis Magnetometer
SHT15 Barometric Pressure Sensor

AM2302 (wired DHT22) temperature-humidity sensor
Sensirion Temperature/Humidity Sensor – SHT11
Arduino – Temperatur und Luftfeuchtigkeit mit dem DHT22 prüfen.

Erfahrungen mit 1-Wire Temp/Feuchte-Sensor AM2305 (anderer Sensor)

Light

ISL29023 Integrated Digital Light Sensor with Interrupt

AVR: Binary to BCD and vice versa

unsigned int bcd2i(unsigned int bcd) {
    unsigned int decimalMultiplier = 1;
    unsigned int digit;
    unsigned int i = 0;
    while (bcd > 0) {
        digit = bcd & 0xF;
        i += digit * decimalMultiplier;
        decimalMultiplier *= 10;
        bcd >>= 4;
    }
    return i;
}
unsigned int i2bcd(unsigned int i) {
    unsigned int binaryShift = 0;
    unsigned int digit;
    unsigned int bcd = 0;
    while (i > 0) {
        digit = i % 10;
        bcd += (digit << binaryShift);
        binaryShift += 4;
        i /= 10;
    }
    return bcd;
}

How to convert binary to BCD ?

Git: Staging Area aka “index”

  • Working Tree
  • Index / Stage / Staging Area / Cache
  • Repository

The Staging Area (also called the “index”) is where Git remembers which changes are marked to be committed. If a change is not “staged” it will not be committed. A change can be as granular as a single changed line in a file, leading to very precise commits. If, after staging a change, you decide you don’t want that change to go into the next commit, you can also “unstage” it.

Stage file: $ git add
Unstage file: $ git reset HEAD

Git Basics – Undoing Things

Removing untracked files from your git working copy
$ git clean -f

git-clean
Removing untracked files from your git working copy

Ubuntu: Add new PPA (Personal Package Archive) repository

PPA = Personal Package Archives
Repository = A collection of software you can download quickly and easily.

Personal Package Archives for everyone!

Add Repository

$ sudo add-apt-repository ppa:vala-team
$ sudo add-apt-repository ppa:irie/blender   ==>   https://launchpad.net/~irie/+archive/blender
$ sudo apt-get update
$ sudo apt-get install [...]

Remove Repository

$ sudo add-apt-repository --remove ppa:vala-team

How can PPAs be removed?

Show current version of package

$ apt-cache policy blender
blender:
  Installed: 2.66a-3ubuntu2
  Candidate: 2.70+git201403201745.dfa5ced-0irie1~saucy1
  Version table:
     2.70+git201403201745.dfa5ced-0irie1~saucy1 0
        500 http://ppa.launchpad.net/irie/blender/ubuntu/ saucy/main i386 Packages
 *** 2.66a-3ubuntu2 0
        500 http://mirror.switch.ch/ftp/mirror/ubuntu/ saucy/universe i386 Packages
        100 /var/lib/dpkg/status

How to check the version before install packages using apt-get
Check package version using apt-get/aptitude?

GNOME tools: gnome-common, intltool

$ sudo apt-get install gnome-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  autopoint intltool
The following NEW packages will be installed:
  autopoint gnome-common intltool
0 upgraded, 3 newly installed, 0 to remove and 1163 not upgraded.
Need to get 673 kB of archives.
After this operation, 1,127 kB of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install gtk-doc-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  docbook docbook-dsssl docbook-to-man jade libsp1c2 sp
Suggested packages:
  docbook-defguide psgml jadetex docbook-dsssl-doc
The following NEW packages will be installed:
  docbook docbook-dsssl docbook-to-man gtk-doc-tools jade libsp1c2 sp
0 upgraded, 7 newly installed, 0 to remove and 1163 not upgraded.
Need to get 2,895 kB of archives.
After this operation, 13.9 MB of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install yelp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libyelp0
The following packages will be upgraded:
  libyelp0 yelp
2 upgraded, 0 newly installed, 0 to remove and 1161 not upgraded.
Need to get 179 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install yelp-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  itstool
The following NEW packages will be installed:
  itstool yelp-tools
0 upgraded, 2 newly installed, 0 to remove and 1161 not upgraded.
Need to get 35.4 kB of archives.
After this operation, 408 kB of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install gobject-introspection
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libgirepository-1.0-1
The following NEW packages will be installed:
  gobject-introspection
The following packages will be upgraded:
  libgirepository-1.0-1
1 upgraded, 1 newly installed, 0 to remove and 1160 not upgraded.
Need to get 384 kB of archives.
After this operation, 1,162 kB of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  gstreamer0.10-plugins-base gstreamer0.10-plugins-base:i386 libcroco3 libcroco3:i386 librsvg2-2 librsvg2-2:i386 librsvg2-common librsvg2-common:i386 libsoup2.4-1 libsoup2.4-1:i386 libxml2 libxml2:i386
  libxslt1.1 libxslt1.1:i386
Suggested packages:
  librsvg2-bin librsvg2-bin:i386
Recommended packages:
  xml-core:i386
The following NEW packages will be installed:
  libxml2-dev
The following packages will be upgraded:
  gstreamer0.10-plugins-base gstreamer0.10-plugins-base:i386 libcroco3 libcroco3:i386 librsvg2-2 librsvg2-2:i386 librsvg2-common librsvg2-common:i386 libsoup2.4-1 libsoup2.4-1:i386 libxml2 libxml2:i386
  libxslt1.1 libxslt1.1:i386
14 upgraded, 1 newly installed, 0 to remove and 1146 not upgraded.
Need to get 5,027 kB of archives.
After this operation, 2,888 kB of additional disk space will be used.
Do you want to continue [Y/n]? y

WD MyBook Live: mediacrawler aus Autostart nehmen

[root@MyBookLive ~]# vi /etc/nas/service_startup/orion
Vorher: enabled
Nachher: disabled

mediacrawler:
[root@MyBookLive ~]# update-rc.d -f orion remove
 Removing any system startup links for /etc/init.d/orion ...
   /etc/rc0.d/K05orion
   /etc/rc2.d/S86orion
   /etc/rc3.d/K05orion
   /etc/rc4.d/K05orion
   /etc/rc6.d/K05orion

twonky:
[root@MyBookLive ~]# update-rc.d -f twonky remove
 Removing any system startup links for /etc/init.d/twonky ...
   /etc/rc0.d/K10twonky
   /etc/rc2.d/S85twonky
   /etc/rc3.d/K10twonky
   /etc/rc4.d/K10twonky
   /etc/rc6.d/K10twonky

itunes:
[root@MyBookLive ~]# update-rc.d -f forked-daapd remove
 Removing any system startup links for /etc/init.d/forked-daapd ...
   /etc/rc0.d/K10forked-daapd
   /etc/rc2.d/S84forked-daapd
   /etc/rc3.d/K10forked-daapd
   /etc/rc4.d/K10forked-daapd
   /etc/rc6.d/K10forked-daapd
# update-rc.d -f orion remove
Removing any system startup links for /etc/init.d/orion ...
   /etc/rc0.d/K05orion
   /etc/rc2.d/S86orion
   /etc/rc3.d/K05orion
   /etc/rc4.d/K05orion
   /etc/rc6.d/K05orion

# /etc/init.d/orion stop

# update-rc.d orion defaults; /etc/init.d/orion start