Archives 2005 - 2019    Search

Very initial impressions of Typescript

published Jan 31, 2016 02:25   by admin ( last modified Jan 31, 2016 02:23 )

I'm looking at Typescript in Node.js and here are some very initial impressions:

Explicit typing - It gives types such as numbers and strings, but I would like to have hex, integers of a certain length, base58 and such as types. That would give more precision in defining what it is that I want. It may be a better idea for me to look at JSON schema instead.

Since typing is not checked at run time, you cannot catch problems with wrong types in incoming data. It would be very nice to have some marshalling/validation of that data. Again, JSON schema may come to the rescue: JSON validating libraries for promise chains — jorgenmodin.net


JSON validating libraries for promise chains

published Jan 31, 2016 02:25   by admin ( last modified Jan 31, 2016 02:34 )

I'm looking at ways of marshalling/validating what gets transported through a javascript promise chain. I first looked at  Typescript, but after a tip from a friend now looking at JSON schema validators and similar. These are the ones I'm looking at right now:

bugventure/jsen: JSON-Schema validator built for speed

A custom format validator can be specified as:

  • a regular expression string
  • a regular expression object
  • a function (value, schema) that must return a truthy value if validation passes

epoberezkin/ajv: The fastest JSON schema Validator

.addFormat(String name, String|RegExp|Function|Object format)

Add custom format to validate strings. It can also be used to replace pre-defined formats for ajv instance.

Strings are converted to RegExp.

Function should return validation result as true or false.

exjs/exmodel: Extensible data model - high performance data processing, schema builder, validator, and sanitizer.

Lots of built-in types and also has regex. No custom types.

pandastrike/jsck

No regular expressions, no custom types afaict.

The above ones are selected a bit for speed, but I will focus on the ones that are most flexible with custom types, allowing both regular expressiosn and functions as validators, and which ones have a nice syntax. Remains to be evaluated.


A Black Swan fund?

published Jan 29, 2016 04:02   by admin ( last modified Jan 29, 2016 04:02 )

Could this be a Black Swan fund?

 

The investment objective of Horizons US Equity Managed Risk ETF (“the ETF“) is to provide unitholders with exposure to (a) the performance of the S&P 500® through a portfolio of equity securities and/or index funds and (b) an actively managed basket of put and call options (the “US Black Swan Overlay“)

(my boldface)

Read more: Link - Horizons ETFs - HUS.U


Backup your Android phone with Rsync

published Jan 25, 2016 12:05   by admin ( last modified Aug 07, 2017 12:59 )

Update 2017-08-07 Termux is an even better alternative from Android 5.0 (SDK version 21). You need to install rsync, and it's not one-click though, in operation.

--

Just tap one icon on your phone and have the rsync back up data automatically, no root needed!

1. Install a terminal emulator on your Android phone, Terminal Emulator or Material Terminal. This terminal emulator will only be used for rsync backups

2. Install Kbox3 inside of the terminal emulator.

3. Set the terminal emulator to use the Kbox3 shell as per the instructions in Install Kbox3.

4. Install rsync, dropbear and kbox-login  from the kbox3 web site

5. Generate an SSH private/public key pair on the Android phone in the dropbear format, store it somewhere on the phone

6. Put the public key on the SSH/Rsync server (e.g. a Linux server)

7. Test that you can transfer files over from the terminal emulator on the phone:

rsync -rh -t --progress -e 'ssh -i /path/to/private_key' /sdcard/DCIM username@server

8. Then set that command line as the initial command of the Terminal emulator

9. Set the back button on the phone to close the session, in preferences

10. Now, every time you open the Terminal emulator, an rsync will happen. Press the back button to close the session.


Termux - a Linux on your Android with apt-get

published Jan 24, 2016 07:45   by admin ( last modified Jan 24, 2016 08:51 )

Only problem is that it needs at least Android 5.0 (SDK version 21), so can't test it yet. Will try to get Android 5 on my device and try again

 

Termux is a terminal emulator and Linux environment bringing powerful terminal access to Android.


Read more: Link - Termux


Write multiple sessions to a DVD+R without ejects (Linux)

published Jan 23, 2016 12:40   by admin ( last modified Jan 24, 2016 02:36 )

For backup and logging, it's nice to be able to incrementally commit data to a write-once medium such as a DVD+R.

If you want to write multiple sessions of data to the DVD+R on Ubuntu, some software such as growisofs wants to eject the media after writing each session, and before writing a new session.

This poses a problem if the DVD writer you are using doesn't have a motorized tray: It can well "burp" and eject the media by itself, but cannot reinsert the media again on its own. Somebody needs to be there and push the disk in again.

However if one uses xorriso for burning, xorriso can burn several sessions to a disk, without the eject/reinsert cycle.

I have only tested with one data DVD so far, but it seems to work. Tested on a Samsung SE-208GB external portable USB drive.

Here is the commands I used:

xorriso -dev /dev/dvdrw -add file.txt

and then as next session:

xorriso -dev /dev/dvdrw -add file2.txt

...and so on. As you can see the command lines are identical with the exception of what file to write.

You've got to check where your burner is mapped under /dev of course first. Mine was at /dev/dvdrw.


xorriso has a truly massive set of command line options and combinations. Reminds me of the pavuk downloader in that respect.
 

Got the technique from here:

xorriso -outdev /dev/sr0 -blank as_needed -follow link \ -add file1file1file1_REDHAT.txt file2file2file2_REDHAT.txt \ file3file3file3_REDHAT.txt --
Further session (like growisofs -M):
xorriso -dev /dev/sr0 -follow link \ -add file4file4file4_REDHAT.txt file5file5file5_REDHAT.txt \ file6file6file6_REDHAT.txt --

Read more: Link - Re: Problem with growisofs -- cannot write multisession DVDs without ejecting and reloading tray

And good to know from that page:

The number of sessions on DVD-R is restricted to 99,
on DVD+R the limit is 153.
On DVD+RW, the number is only limited by the data
storage capacity of the medium.

Color states of riemann-dash

published Jan 23, 2016 07:16   by admin ( last modified Jan 23, 2016 07:16 )
  • "ok" (green)
  • "warning" (yellow)
  • "critical" (red)

Luftfuktigheten ovanför en mättad koksaltlösning

published Jan 18, 2016 02:24   by admin ( last modified Jan 18, 2016 02:24 )

0 grader celsius  75.51%, ±0.34%
5 grader celsius  75.65%, ±0.27%
10 grader celsius  75.67%, ±0.22%
15 grader celsius  75.61%, ±0.18%
20 grader celsius  75.47%, ±0.14%
25 grader celsius  75.29%, ±0.12%
30 grader celsius  75.09%, ±0.11%
35 grader celsius  74.87%, ±0.12%

 

At any temperature, the concentration of a saturated solution is fixed and does not have to be determined. By providing excess solute, the solution will remain saturated even in the presence of modest moisture sources and sinks.


Read more: Link - Equilibrium ReIative Humidity - z103.pdf


Cables are now more expensive than hardware

published Jan 17, 2016 11:00   by admin ( last modified Jan 18, 2016 12:47 )

...in many cases. With the advent of the Raspberry Pi Zero which costs around $/€/£6, the cables will be more expensive than the computer.

Here in Sweden you can pick up a twin USB charger wall-wart in a local store for $/€/£5, but the actual USB cables for using it will each set you back more than that. Mail-orde you can get down to $/€/£2 for a cable, but not locally.

So, I hereby declare that cables are the new gold.


Real-time Raspbian for Raspberry Pi & Pi2

published Jan 15, 2016 12:25   by admin ( last modified Jan 15, 2016 12:27 )

Untested by me. Claims to respond on the order of tens of milliseconds instead of hundreds.

This is a release of Raspbian with real-time kernel. It is compatible with Raspberry Pi models: 2B, B+, A+, B, A.

It is based on 2015-02-16-raspbian-wheezy with default kernel replaced to 3.18.9-rt5-v7+ kernel and a few additional tunings.

Real-time Linux for RPi2 - Emlid

Github repo here with instructions on how to build:

emlid/linux-rt-rpi


NodeMCU may not be battery efficient enough as local sensor

published Jan 14, 2016 10:39   by admin ( last modified Jan 14, 2016 10:39 )

Even when only waking up every 20 mins, it would still only last about 2 months with that battery capacity:

 

Each hour, the device would be awake 12 times for 6 seconds at a time, (72 seconds or 0.02 hours) and asleep for the remainder of the time (0.998 hours). So average current consumption in any given hour is (100*0.02) + (0.05*0.998) = 2.05mA So the 890mAh battery would last about 434 hours, or 18 days. That's not great, but better than my original estimates.


Read more: Link - Details • ESP8266 Native • Hackaday.io


The pinouts of the GPIO socket on a Raspberry Pi

published Jan 07, 2016 12:29   by admin ( last modified Jan 07, 2016 12:29 )

There is a socket on a Raspberry Pi A+, B+ and  Pi 2 with 40 pins where you connect devices. A couple of things I've realized:

  • The top row has even numbers and the bottom row odd numbers, so you position the pi with the GPIO socket along the top, and then pin number 1 is to the left, bottom row. Then the pin just above it in the top row, is pin number 2.
  • However the GPIO numbering does not follow the order the pins are in the socket
  •  E.g. pin number 11 in the socket is actually GPIO number 17. So you need a chart, like in the below link:

GPIO: Models A+, B+ and Raspberry Pi 2 - Raspberry Pi Documentation


A humidity sensor/switch for your air humidifier with a Raspberry Pi

published Jan 07, 2016 03:55   by admin ( last modified Jan 15, 2016 01:36 )

Summary: Get a TX433N transmitter and a DHT11 humidity sensor, stick them into your Arduino's GPIO (GPIO17 and GPIO4 respectively), and connect your humidifier to a Brennenstuhl or Elro remote power switch.

Set the remote power switch to "A 1". Then check out this repository jeorgen/pi-control-mains-switches to your Raspberry Pi and run the humi.py script with "sudo python humi.py". Read on for more details.

Problem

The winter is getting mighty cold and with that comes dry indoor air. I have a Bionaire air humidifier that is manually switched on or off.

The previous one I had, had a built in continuous dial for when it should switch on and off depending on the humidity, but this one hasn't. So I want to connect a hygrostat (like a thermostat but for humidity) to it, giving a nice even humidity indoors, whether the winter temperature outside is +4 degrees centigrade or -15 degrees.

Solution

Power control

I do not want to mess with constructing things myself with relays and such things when running high voltage (240V mains). In fact I do not want to have anything to do with 240V that I have soldered or installed in any other way. Luckily  there is a plethora of ready-made remote power switches that you can get at any DIY store. They come with a remote control and can go for €10 for three switches and one remote in a package.

The TX433N transmitter works at the same frequency as many of these switches, and the control.py script in jeorgen/pi-control-mains-switches should work with Brennenstuhl (tested with model RCS 1000) and Elro switches and probably many other brands of switches.

The TX433N transmitter needs to get connected to to 5V, ground and a GPIO pin in the GPIO socket on the Raspberry Pi (GPIO17 in my setup, see GPIO: Models A+, B+ and Raspberry Pi 2 - Raspberry Pi Documentation). The TX433N also runs with 3.3V but the Pi does not supply much current for those 3.3V pins (<50mA). So use a 5V pin instead.

I set my Brennenstuhl RCS 1000 to be switch number 1, listening to the A channel in its DIP switch configuration. So all DIPs at 0, except DIP 1 and 6. Of course you can change the python script for other settings.

Humidity sensing

The DHT 11 is a cheap humidity sensor whose most endearing quality is that I can buy it over the counter in the local Kjell.com stores here. I would have preferred its more expensive sibling the DHT22. As with the TX433N, plug it in to the 5V connection in the GPIO slot. Then use GPIO 4 for the signal (GPIO: Models A+, B+ and Raspberry Pi 2 - Raspberry Pi Documentation).

Here is some more documentation on pinouts, levels and example scripts that I nicked code from: DHT11 Humidity & Temperature Sensor Module | UUGear

The first DHT 11 I bough refused to leave the 20-21% range which was clearly wrong, so I exchanged it and the new one believes it to be about 35% relative humidity which is still wrong but I can work with that. You may want to adjust the humidity settings in the humi.py script to your liking.

If you want to know more about humidity sensors and their quality, a guy has put in a lot of time in order to check if some inexpensive humidity sensors actually are accurate (spoiler: They are surprisingly good).

Instead of varying concentrations of a particular salt I use saturated solutions of several different salts. Depending on the solubility of a particular salt, a different relative humidity will be generated in equilibrium with the solution.

Read more: Link - Test and Calibrate DHT22 / AM2302 / RHT03 hygrometers

Compare DHT22, DHT11 and Sensirion SHT71

The scripts

The humi.py script fails to get a humidity reading most of the time due to not having correct timings in the script and being interrupted by the OS I believe, with the current way the script works. ADAFruit has a python repository that has better performance (https://github.com/adafruit/Adafruit_Python_DHT.git it uses C or C++ as well, see dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging.pdf ), but for a hygrostat one does not need fast measurements, probably once every 20 minutes is enough. With the somewhat faulty DHT 11 sensor I had first 90% of all readings failed and with the one I have now I'd say 95% of readings fail. But it does not matter really, if you poll it say every 5 seconds.

It is very satisfying to hear the Pi switch on and off the humidifier.

Links to python software not used in project but that fulfil the same tasks, with C extensions

 

 


The mystery of Firefox freezing on Ubuntu 15.10 solved

published Jan 04, 2016 10:55   by admin ( last modified Feb 01, 2016 12:16 )

Summary: Some kind of conflict with the AppArmor profile I was using for Firefox.

Today I upgraded my laptop from Ubuntu 15.04 to 15.10, and Firefox stopped working properly. When hitting certain web sites such as twitter.com and youtube.com it would grey screen and lock Firefox completely. I tried installing a newer version of Firefox - same problem. I then installed an even newer version of Firefox, the developer version with Electrolysis enabled which is supposed to sandbox tabs - same problem.

I got rid of all extensions and bookmarks and tried deleting the .mozilla directory and hence getting a pristine Firefox - still same problem.

So I did what any sane man would do, I downloaded and installed a virtual machine and installed a separate instance of Ubuntu 15.10 on that, and now the problem was gone.

So what on earth was the difference between my laptop and the virtual machine? And then it struck me - AppArmor. AppArmor can make sure that an application doesn't read or write files outside of certain constraints. And pretty much everything is a file on Linux. Somehow the AppArmor profile I had for my Firefox, constrained the versions of Firefox on Ubuntu 15.10 in such a was as to make Firefox grey screen and hang, with a minimum of CPU usage.

Or, there is a new exploit that Apparmor blocked which I am now vulnerable to after having removed the Firefox AppArmor profile (probably not likely). Here is the AppArmor profile BTW:

(update: I now enabled the very same AppArmor profile on the virtual machine, and Firefox still works. The mystery is hence not solved just, ehrrum, resolved)

# vim:syntax=apparmor
# Author: Jamie Strandboge <jamie@canonical.com>

# Declare an apparmor variable to help with overrides
@{MOZ_LIBDIR}=/usr/lib/firefox

#include <tunables/global>

# We want to confine the binaries that match:
#  /usr/lib/firefox/firefox
#  /usr/lib/firefox/firefox
# but not:
#  /usr/lib/firefox/firefox.sh
/usr/lib/firefox/firefox{,*[^s][^h]} {
  #include <abstractions/audio>
  #include <abstractions/cups-client>
  #include <abstractions/dbus-strict>
  #include <abstractions/dbus-session-strict>
  #include <abstractions/dconf>
  #include <abstractions/gnome>
  #include <abstractions/ibus>
  #include <abstractions/nameservice>
  #include <abstractions/openssl>
  #include <abstractions/p11-kit>
  #include <abstractions/ubuntu-unity7-base>
  #include <abstractions/ubuntu-unity7-launcher>

  #include <abstractions/dbus-accessibility-strict>
  dbus (send)
       bus=session
       peer=(name=org.a11y.Bus),
  dbus (receive)
       bus=session
       interface=org.a11y.atspi**,
  dbus (receive, send)
       bus=accessibility,

  # for networking
  network inet stream,
  network inet6 stream,
  @{PROC}/[0-9]*/net/if_inet6 r,
  @{PROC}/[0-9]*/net/ipv6_route r,
  @{PROC}/[0-9]*/net/dev r,
  @{PROC}/[0-9]*/net/wireless r,
  dbus (send)
       bus=system
       path=/org/freedesktop/NetworkManager
       member=state,
  dbus (receive)
       bus=system
       path=/org/freedesktop/NetworkManager,

  # should maybe be in abstractions
  /etc/ r,
  /etc/mime.types r,
  /etc/mailcap r,
  /etc/xdg/*buntu/applications/defaults.list    r, # for all derivatives
  /etc/xfce4/defaults.list r,
  /usr/share/xubuntu/applications/defaults.list r,
  owner @{HOME}/.local/share/applications/defaults.list r,
  owner @{HOME}/.local/share/applications/mimeapps.list r,
  owner @{HOME}/.local/share/applications/mimeinfo.cache r,
  owner /tmp/** m,
  owner /var/tmp/** m,
  owner /{,var/}run/shm/shmfd-* rw,
  /tmp/.X[0-9]*-lock r,
  /etc/udev/udev.conf r,
  # Doesn't seem to be required, but noisy. Maybe allow 'r' for 'b*' if needed.
  # Possibly move to an abstraction if anything else needs it.
  deny /run/udev/data/** r,
  # let the shell know we launched something
  dbus (send)
     bus=session
     interface=org.gtk.gio.DesktopAppInfo
     member=Launched,

  /etc/timezone r,
  /etc/wildmidi/wildmidi.cfg r,

  # firefox specific
  /etc/firefox*/ r,
  /etc/firefox*/** r,
  /etc/xul-ext/** r,
  /etc/xulrunner-2.0*/ r,
  /etc/xulrunner-2.0*/** r,
  /etc/gre.d/ r,
  /etc/gre.d/* r,

  # noisy
  deny @{MOZ_LIBDIR}/** w,
  deny /usr/lib/firefox-addons/** w,
  deny /usr/lib/xulrunner-addons/** w,
  deny /usr/lib/xulrunner-*/components/*.tmp w,
  deny /.suspended r,
  deny /boot/initrd.img* r,
  deny /boot/vmlinuz* r,
  deny /var/cache/fontconfig/ w,
  deny @{HOME}/.local/share/recently-used.xbel r,

  # TODO: investigate
  deny /usr/bin/gconftool-2 x,

  # These are needed when a new user starts firefox and firefox.sh is used
  @{MOZ_LIBDIR}/** ixr,
  /usr/bin/basename ixr,
  /usr/bin/dirname ixr,
  /usr/bin/pwd ixr,
  /sbin/killall5 ixr,
  /bin/which ixr,
  /usr/bin/tr ixr,
  @{PROC}/ r,
  @{PROC}/[0-9]*/cmdline r,
  @{PROC}/[0-9]*/mountinfo r,
  @{PROC}/[0-9]*/stat r,
  owner @{PROC}/[0-9]*/task/[0-9]*/stat r,
  @{PROC}/[0-9]*/status r,
  @{PROC}/filesystems r,
  @{PROC}/sys/vm/overcommit_memory r,
  /sys/devices/pci[0-9]*/**/uevent r,
  /sys/devices/platform/**/uevent r,
  /sys/devices/pci*/**/{busnum,idVendor,idProduct} r,
  owner @{HOME}/.cache/thumbnails/** rw,

  /etc/mtab r,
  /etc/fstab r,

  # Needed for the crash reporter
  owner @{PROC}/[0-9]*/environ r,
  owner @{PROC}/[0-9]*/auxv r,
  /etc/lsb-release r,
  /usr/bin/expr ix,
  /sys/devices/system/cpu/ r,
  /sys/devices/system/cpu/** r,

  # about:memory
  owner @{PROC}/[0-9]*/statm r,
  owner @{PROC}/[0-9]*/smaps r,

  # Needed for container to work in xul builds
  /usr/lib/xulrunner-*/plugin-container ixr,

  # allow access to documentation and other files the user may want to look
  # at in /usr and /opt
  /usr/ r,
  /usr/** r,
  /opt/ r,
  /opt/** r,

  # so browsing directories works
  / r,
  /**/ r,

  # Default profile allows downloads to ~/Downloads and uploads from ~/Public
  owner @{HOME}/ r,
  owner @{HOME}/Public/ r,
  owner @{HOME}/Public/* r,
  owner @{HOME}/Downloads/ r,
  owner @{HOME}/Downloads/* rw,

  # per-user firefox configuration
  owner @{HOME}/.{firefox,mozilla}/ rw,
  owner @{HOME}/.{firefox,mozilla}/** rw,
  owner @{HOME}/.{firefox,mozilla}/**/*.{db,parentlock,sqlite}* k,
  owner @{HOME}/.{firefox,mozilla}/plugins/** rm,
  owner @{HOME}/.{firefox,mozilla}/**/plugins/** rm,
  owner @{HOME}/.gnome2/firefox* rwk,
  owner @{HOME}/.cache/mozilla/{,firefox/} rw,
  owner @{HOME}/.cache/mozilla/firefox/** rw,
  owner @{HOME}/.cache/mozilla/firefox/**/*.sqlite k,
  owner @{HOME}/.config/gtk-3.0/bookmarks r,
  owner @{HOME}/.config/dconf/user w,
  owner /{,var/}run/user/*/dconf/user w,
  dbus (send)
       bus=session
       path=/org/gnome/GConf/Server
       member=GetDefaultDatabase,
  dbus (send)
       bus=session
       path=/org/gnome/GConf/Database/*
       member={AddMatch,AddNotify,AllEntries,LookupExtended,RemoveNotify},

  #
  # Extensions
  # /usr/share/.../extensions/... is already covered by '/usr/** r', above.
  # Allow 'x' for downloaded extensions, but inherit policy for safety
  owner @{HOME}/.mozilla/**/extensions/** mixr,

  deny @{MOZ_LIBDIR}/update.test w,
  deny /usr/lib/mozilla/extensions/**/ w,
  deny /usr/lib/xulrunner-addons/extensions/**/ w,
  deny /usr/share/mozilla/extensions/**/ w,
  deny /usr/share/mozilla/ w,

  # Miscellaneous (to be abstracted)
  # Ideally these would use a child profile. They are all ELF executables
  # so running with 'Ux', while not ideal, is ok because we will at least
  # benefit from glibc's secure execute.
  /usr/bin/mkfifo Uxr,  # investigate
  /bin/ps Uxr,
  /bin/uname Uxr,

  /usr/bin/lsb_release Cxr -> lsb_release,
  profile lsb_release {
    #include <abstractions/base>
    #include <abstractions/python>
    /usr/bin/lsb_release r,
    /bin/dash ixr,
    /usr/bin/dpkg-query ixr,
    /usr/include/python2.[4567]/pyconfig.h r,
    /etc/lsb-release r,
    /etc/debian_version r,
    /var/lib/dpkg/** r,

    /usr/local/lib/python3.[0-4]/dist-packages/ r,
    /usr/bin/ r,
    /usr/bin/python3.[0-4] r,

    # file_inherit
    deny /tmp/gtalkplugin.log w,
  }

  # Addons
  #include <abstractions/ubuntu-browsers.d/firefox>

  # Site-specific additions and overrides. See local/README for details.
  #include <local/usr.bin.firefox>
}


nmcli can help with Ubuntu acting weird after wakeup (e.g. no network)

published Jan 03, 2016 05:30   by admin ( last modified Dec 31, 2016 09:56 )

If you find this piece of information useful: Print out or store it locally on your computer, because if you have this problem, you won't be able to reach this page.

 

After suspend

RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN      
running         asleep          enabled         enabled    enabled         disabled
as can you see the state is asleep meaning our dear network manager is still napping, so to solve use the following command line:
sudo nmcli nm sleep false


Read more: Link - Wireless networking not working after resume in Ubuntu 14.04 - Ask Ubuntu


Turn WD My Cloud into a Synology-like disk station

published Dec 30, 2015 04:35   by admin ( last modified Jan 05, 2016 01:54 )

It turns out that the hardware used by WD My Cloud (at least the one I have, a 3TB single drive unit) is close enough to Synology disk stations that you can boot a WD My Cloud with software derived from the Synology Linux. You can also put in a clean Debian and an OpenMedia vault server.

The Synology disk station Linux seems to have many interesting plugins, although I believe the WD My Cloud is a bit underpowered compared to Synology's own hardware.

Here is a guide and files for how to do it, from the user Fox_exe ("Fox Allester") at the  https://community.wd.com boards:

https://drive.google.com/folderview?id=0B_6OlQ_H0PxVa040STRHQUU3VU0&usp=drive_web#list

I have just tested it and it does work! I have only tested SSH connection and that the web based control panel works so far. You should be able to login with

ssh root@<IP NUMBER>

with the password "mycloud". Or login to the admin account. They use the same password.

Changing the password

To change the password for both root and admin, type while being logged in as root:

  synouser --setpw admin <NEWPASSWORD>

Put a space first so that your new password doesn't end up in the command history (In fact scratch that space-thingy trick, I just went back and noticed that the command line history also keeps commands with preceding space. I guess that is because it is busybox and not the normal bash. Weird).

Then make sure you can log in as both root and admin with your new password through other terminal windows, before logging out from your root session.

A few notes on the files linked to above & installation

You may want to verify the contents of the above files. I do not assume they are suspicious in any way, but since they do not come from a well known repository it may still be prudent.

The user names and passwords listed in the beginning are also valid for the new disk station setup.

Preparing a new hard drive from a Linux computer

I did not re-use the drive in my WD My Cloud cabinet. Instead I used a hard drive I had lying around and put it into a Linux machine, and issued all commands in the guide from that Linux machine.

Hence i did not do the tftp stuff and such, that is I did not do the work through the WD My Cloud device. I just had the files mentioned in the guide on the host computer's file system, and copied them in place to the hard disk, instead of using tftp.

The guide is written for using a hard disk that uses the newer GPT-partitioned format and not the older MBR (Master Boot Record) format at the beginning of the hard disk. I used gparted to make sure the disk was in GPT format.

If you follow the guide and parted starts complaining of too many primary partitions, then your drive is in MBR format and needs to be changed into CPT format.

Other offerings from Fox_exe

Update: It seems Fox_exe has been busy preparing other options for the WD My Cloud:

Clean debian and OpenMediaVault on WDMyCloud! - Cloud Storage / My Cloud - WD Community

However the clean Debian download link deems to be dead right now, although the Open Media Vault link works.

Update 2: This link seems to go to all his stuff, including a downloadable Debian:

WDMyCloud


ESP8266, WiFi, TCP/IP, even DNS...

published Dec 26, 2015 12:53   by admin ( last modified Dec 26, 2015 12:53 )

This chip looks interesting indeed. Question is how economical you can get it to be with energy consumption.

 

Add Internet to your next project with an adorable, bite-sized WiFi microcontroller, at a price you like! The ESP8266 processor from Espressif is an 80 MHz microcontroller with a full WiFi front-end (both as client and access point) and TCP/IP stack with DNS support as well.


Read more: Link - Adafruit HUZZAH ESP8266 Breakout ID: 2471 - $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits



Comprehensive measurement of accuracy of cheap humidity sensors

published Dec 26, 2015 12:15   by admin ( last modified Dec 26, 2015 12:16 )

A guy has put in a lot of time in order to check if some inexpensive humidity sensors actually are accurate (spoiler: They are surprisingly good).

 

Instead of varying concentrations of a particular salt I use saturated solutions of several different salts. Depending on the solubility of a particular salt, a different relative humidity will be generated in equilibrium with the solution.


Read more: Link - Test and Calibrate DHT22 / AM2302 / RHT03 hygrometers

Compare DHT22, DHT11 and Sensirion SHT71

One can buy the DHT22 here and there are some libraries too:

DHT22 temperature-humidity sensor + extras ID: 385 - $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits


A simple system for sensor & controls at home

published Dec 26, 2015 08:45   by admin ( last modified Dec 27, 2015 05:37 )

A lot of home tinkering would be easier if there were ready made units that you could link together either wirelessly or via USB. Maybe this already exists in some way, shape or form but it is not obvious to me where and at what price in that case.

It seems to be that for home tinkerers working wth with Arduionos ESP8266s and Raspberry Pis, there should be room for a whole lot of compartmentalization.

Gui and communications unit

Should be Android phones and tablets. There is no way it is cheaper and more convenient to cobble together a touch screen, batteries, USB/Wifi/Bluetooth/3G/4G/LE connectivity and charging circuits than simply using an Android device. Many nowadays even have wireless charging.

Power control unit.

Controlled over e.g. USB. Switches on and off mains power, and guaranteed to do so in sequence between different connectors, in case you want to mimic a rotary switch. There is a USB controlled multi channel relay on Amazon, but it seems to close all circuits on boot, which can be anything from annoying to catastrophic depending on your project Amazon.com: SainSmart USB Eight Channel Relay Board for Automation - 12 V: Industrial & Scientific.

From one of the reviews:

I think the biggest issue is that way the thing reacts to rebooting the machine it is connected to. I haven't figured out the exact sequence, but I think it turns on all relays when the computer/usb reboots, and then again when the driver loads

So at the moment it may be a better idea to put together a device from either a Raspberry Pi or an Arduino, and then connect that to a relay board and mount it all in a case.

Network interface unit.

Connects to the power control unit. Could be bluetooth, bluetooth LE, WiFi, 3G/4G/LE or something.

Sensors

Sensor, powered locally by AA, AAA or button cell. Reports its readings wirelessly. Texas Instruments seem to have a candidate  SimpleLink™ Bluetooth Smart®/Multi-Standard SensorTag - CC2650STK - TI Tool Folder.

10 sensors including support for light, digital microphone, magnetic sensor, humidity, pressure, accelerometer, gyroscope, magnetometer, object temperature, and ambient temperature