vrijdag 16 maart 2018

mongo raspi



http://192.168.2.69:1880/hello


administratieve port van mongodb
http://192.168.2.69:28017



http://192.168.2.69:1880/#flow/351b5321.75c8bc
Mongodb

 Mongodb2


zondag 18 februari 2018

times up time line


Speech Meryl Streep

Meryl Streep powerful speech at the Golden Globes (2017):

https://www.youtube.com/watch?v=EV8tsnRFUZw

#Metoo

The movement me too wast started by Tarana Burke. She started the nonprofit organization that helps victims of sexual harassment and assault. 

The actress Alyssa Milano gave the hashtag #metoo a new impulse. Ms. #metoo was seeking to give a voice to sexual abuse victims, after accusations of sexual harassment and assault were leveled against the Hollywood producer Harvey Weinstein.
Afbeeldingsresultaat voor #metoo initial tweet

Teresa Shook 9-11-2016

After the election of Trump Tesesa Shook starten on Facebook a request for action: https://www.facebook.com/TeresaAnneShook/

Pussy hat Project 11-2016
Het Pussyhat Project is an initiative of  Krista Suh and Jayna Zweiman in november 2016, in response of the  the quote: "You can grab them by the pussy".

Women's March 2017 21-1-2017

Time's up  letter in the NYtimes 1-1-2018

Time's up movement is started with a letter in the new york times. https://www.nytimes.com/interactive/2018/01/01/arts/02women-letter.html. The letter is signed by 
“The struggle for women to break in, to rise up the ranks and to simply be heard and acknowledged in male-dominated workplaces must end; time’s up on this impenetrable monopoly,”

Time’s Up members include the actresses Ashley Judd, Eva Longoria, America Ferrera, Natalie Portman, Rashida Jones, Emma Stone, Kerry Washington and Reese Witherspoon; the showrunner Jill Soloway; Donna Langley, chairwoman of Universal Pictures; the lawyers Nina L. Shaw and Tina Tchen, who served as Michelle Obama’s chief of staff; Maria Eitel, an expert in corporate responsibility who is co-chairwoman of the Nike Foundation and Shonda Rhimes, the executive producer of the television series “Grey’s Anatomy,” “Scandal” and “How to Get Away With Murder”

Golden globes 2018

The dress code was black as a  symbol to show solidarity with victims of sexual harassment inorder to to times up movement. It’s a message. It’s a way of expressing your support for this movement and the fact that it’s time to support one another.” 

Ophra  was  accepting the Cecil B. DeMille lifetime achievement award and made a speech  “I want all the girls watching here now to know that a new day is on the horizon!". The speech was 

Barbra Streisand  telling the room that she was dismayed that she was still the only woman to win the directing category, saying, “Folks, time’s up,” before naming the winner of Best Motion Picture – Drama

Natalie Portman announces "And here are the all-male nominees,”  before awarding the prize to the winner.


Women's March 2018 20-1-2018

Viola Davis

https://www.youtube.com/watch?v=mM5ONxQxQu8


The Post 

dinsdag 5 december 2017

raspberry pi short reference

Make SD disk - MAC OS X
Option 1
df -h
unzip ~/Downloads/2012-12-16-wheezy-raspbian.zip

diskutil list    //find the correct /dev/diskx
diskutil unmountDisk /dev/disk2 

sudo dd bs=1m if=~/Downloads/2012-10-28-wheezy-raspbian/2012-12-16-wheezy-raspbian.img of=/dev/disk1


sudo dd bs=1m if=~/Downloads/2017-03-02-raspbian-jessie.img of=/dev/disk2

CTRL T gives information about process

diskutil mountDisk /dev/diskx


Option 2
format disk met SDFormat option full
copy NOOB files on disk

Setup on SD
1 Place an empty file ssh in the root path in order to get ssh access
2 edit wpa_supplicant.conf add (file is removed after booting): 
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI"
psk="Mysecret4"
scan_ssid=1
}


3 edit config.txt and add:
#Enable UART
enable_uart=1


4 boot and login with 
ssh pi@rasberry.local password raspberry

Setup
sudo raspi-config     // config screen
sudo apt-get update   // install new versions of software fetch the package list
sudo apt-get upgrade  // will fetch new versions of packages existing on the machine
sudo apt-get dist-upgrade //same as upgrade but also dependencies
reboot

Network
sudo nano /etc/network/interfaces




iface eth0 inet static //static 
 address 192.168.1.2 
 netmask 255.255.255.0 
 gateway 192.168.1.1



iface eth0 inet dhcp    //DHCP

allow-hotplug wlan0         //wifi
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf



sudo more /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NAMEWIFIROUTER"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="password"


Multiple networks 
/etc/wpa_supplicant/wpa_supplicant.conf  
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="SCHOOLS NETWORK NAME"
    psk="SCHOOLS PASSWORD"
    id_str="school"
}

network={
    ssid="HOME NETWORK NAME"
    psk="HOME PASSWORD"
    id_str="home"
}



/etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface school inet static
address
gateway
netmask

iface home inet static
address
gateway
netmask


  Network problems 
1 Check that the hardware is connected (lights on both ends) or with iwconfig wlan0 (for WiFi)
2. Check that the kernel can see the hardware with:

ifconfig -a
3. Check that you active interface has an IP address 

ifconfig eth0 
ifconfig wlan0

4. Check the kernel routing table 

route -n (or ip route)
sudo route add default gw 192.168.2.1 wlan0

5. Check you can ping your gateway (you get the gateway address from the route command)
ping 192.168.2.1
6. Check you can ping 8.8.8.8 (Google's DNS server)

ping 8.8.8.8
7. Check you can resolve host names (ping google.com)



Simple Unix command
ls            //list files
pwd
which  pwd    //where is my pwd command
lsusb         //show USB devices
cp   file1 file2    // copy
mv   file1 file3    // rename of move
df -h               // show mounted filesystems


AFP
sudo apt-get install netatalk
in Finder hit ⌘K. Enter afp://192.168.2.150


Samba
sudo apt-get update
sudo apt-get install samba
sudo apt-get install samba samba-common-bin
nano /etc/samba/smb.conf        //edit config file 
sudo service samba restart      //iedere keer als je iets veranderd

[global]
workgroup = workgroup
server string = %h
wins support = no
dns proxy = no
security = share
encrypt passwords = yes
panic action = /usr/share/samba/panic-action %d

[sites]

path = /mnt/data
writeable = yes
broweable = yes
read only = no
guest ok = yes
force user = root

sudo smbpasswd -a john             //add samba user 
sudo mkdir /mnt/data
sudo chmod 777 /mnt/data


Change host name
sudo nano /etc/hostname 
sudo nano /etc/hosts 

sudo reboot    //reboot
sudo halt      //stop

sudo adduser john         // make new user
sudo adduser john sudo    // make user sudo
sudo nano /etc/sudoers

sudo fdisk -l             // show attached drives



Add hard disk
sudo apt-get install ntfs-3g   //install Read NTFS 
sudo apt-get install hfsplus
sudo blkid                // show all 
nano /etc/fstab           // mount at start up
/dev/sd       /mnt/data       ntfs    defaults        0       0
sudo mount -a 

Video Web cam
sudo apt-get install motion
sudo nano /etc/motion/motion.conf
daemon  ON
webcam_localhost  OFF
sudo service motion start
sudo nano /etc/default/motion 
http://192.168.2.111:8081

sudo apt-get install python-opencv


VNC  remote desktop 
apt-get install tightvncserver
tightvncserver
vncpasswd
vncserver :1 -geometry 800x600 -depth 24

if server is started on 1 this means port 5901
in finder (connect icon)  vnc://192.168.2.70:5901




Apache webserver
sudo apt-get install apache2
sudo nano /etc/apache2/sites-enabled/000-default
AddHandler cgi-script .py
sudo chmod 777 /usr/lib/cgi-bin/test.py


special raspberry ROM's / images:

MotionPi: use the camera for spying or for video

ssh root@192.168.2.181
use password after the dash name router

use find to find IP adres of the raspberry 
Safari: 192.168.2.1
admin ; no password
use vi for editing files 
set wifi password and SIID of the router in /data/etc/wpa_ ... 

Sound
sudo apt-get install alsa-utils
sudo apt-get install mpg321
sudo apt-get install lame


Node-RED
https://nodered.org/docs/hardware/raspberrypi
(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

node-red-start

In safari 192.168.2.70:1880


npm install node-red-node-mongodb

mongo
sudo apt-get install mongodb-server
sudo nano /etc/mongodb.conf             //edit config paths 
/var/log/mongod                       // look into the logs
mongod                                // start server
mongod --dbpath /data/db --repair     // repair if RPi shutdown un
mongo
show dbs                              // show databases
use Mydb
show collections                      // show collections
db.createCollection(“my collection”)  // Make a collection
db.mycollection.remove()              // remove collection


db.addUser( { user: "joe",
... pwd: "secret",
... roles: [ "readWrite", "dbAdmin" ]
... } )

http://192.168.2.70:28017             //Webinterface

dinsdag 3 oktober 2017

Sound pictures audio analyzes

Sound picture: An audio analysis of the song If i Loved You Barbra Streisand


Formants are strong frequency peaks (transients)

The work on my audio skils i used this song. 

lyrics 
written bij Oskar hammerstein


If I loved you,
Time and again I would try to say
All I'd want you to know.
If I loved you,
Words wouldn't come in an easy way
Round in circles I'd go!
Longin' to tell you,
But afraid and shy,
I'd let my golden chances pass me by!
Soon you'd leave me,
Off you would go in the mist of day,
Never, never to know how I loved you
If I loved you.



The data 
The youtube film 
https://www.youtube.com/watch?v=4whr0ha2sTc

grab the sound
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 
The song is a small story. As barbra describes if  her self the song must have a beginning and an end.

used tools
audacity 
spraak


Now why is this so beautiful phrased?

the phrase afraid 
Pitch is the fundamental frequency (steady)
The pitch goes from 3768 slightly up to 393
and at the end the vibrato





Barbra Streisand Longest C#5 Belt Note 19 Seconds !





In praat 

woensdag 3 mei 2017

micro bit pairing bluetooth problems

microbit

1 problems

I flashed code into my micro:bit via Bluetooth and it no longer works.

2 Can my phone /tablet pair with the micro:bit?

Since the BBC micro:bit employs the low energy version of Bluetooth wireless communication, the iPhone or iPad running the app must have Bluetooth low energy capability. Unfortunately this excludes some older models. Basicly all new android phones/tablet and apple device will work.

3 Normal pairing how does it work?

The method of pairing requires holding down buttons A and B and pressing and releasing the RESET button. Normally, A and B need to be held until the message “PAIRING MODE..” begins to scroll across the LEDs. The requirement of entering a pattern and 6-digit code ensures security in an environment where there may be several micro:bits.

4 re-instate Bluetooth after previously using MicroPython

5

A compiled HEX file contains not only your script code but also ‘runtime’ and ‘bootloader’ code. Bluetooth communication depends upon the runtime and bootloader code in micro:bit. If the runtime or bootloader code in micro:bit is corrupted or overwritten with incompatible code, Bluetooth flashing and pairing will fail, and the only method of restoring it is to flash a suitable HEX file from a computer via a USB cable. Touch Develop and the Block Editor compile suitable HEX files. Currently, HEX files compiled from python scripts are not compatible with Bluetooth. From time to time the runtime and bootloader code from the website is updated, so it is good practice to create fresh HEX files by re-compiling your scripts.

6 What if I do not want to pair?

Bluetooth pairing takes time. n your project folder's root, you should have a file called config.json. All you need to do is ensure there's a property of the bluetooth json object called 'open' which has a value of 1. open=1 means 'no security'. Here's the first part of my config.json file:
{
    "microbit-dal": {
        "bluetooth": {
            "enabled": 1,
            "pairing_mode": 1,
            "open": 0,
            "dfu_service": 0,
            "event_service": 0,
            "device_info_service": 1
        },
        "gatt_table_size": "0x700"
    }
}

7 Is your micro:bit board in Maintenance mode by mistake?

Author: 10A
Created: 2017-05-04 Thu 11:53
Emacs 25.0.50.1 (Org mode 8.2.10)

donderdag 23 maart 2017

Common Criteria



CCRA  Common Criteria World wide organisation responsible for the CC m ethology


Methodology documentation:

https://www.commoncriteriaportal.org/cc/

Overview:
https://www.commoncriteriaportal.org/files/ccfiles/CCPART1V3.1R4.pdf

PP:  

https://www.commoncriteriaportal.org/pps/






labs and schems: 


https://www.commoncriteriaportal.org/labs/

Certified products:



SOGIS:  European community

participants: 

http://www.sogisportal.eu/

Interpretation of the european working group JIL

http://www.sogisportal.eu/uk/supporting_doc_en.html
http://www.sogis.org/documents/cc/domains/sc/JIL-Application-of-Attack-Potential-to-Smartcards-v2-9.pdf
http://www.sogisportal.eu/documents/cc/domains/sc/obsolete/JIL-Minimum-Site-security-Requirements-V1.0(for_trial_use).pdf

NSCIB Nederlandse schema: 

Interpretation of the CC methodology
tuv rheinland
http://www.tuv-nederland.nl/nl/33/interpretations.html

zondag 26 februari 2017

Remove in block

Make template
make a file called noinblock.tplx and add:

% extend the default article template:
((* extends 'article.tplx' *))

% display input without prompts:
((* block input scoped *))

((* endblock input *))

% treat execute_result (output with prompt) as display_data (output without prompt)
((* block execute_result scoped *))
    ((* block display_data scoped *))
        ((( super() )))
    ((* endblock display_data *))
((* endblock execute_result *))



Run 

$ jupyter nbconvert rapport.ipynb --to pdf --template noinblock