Transparent Proxy Week 3 Report

This week I was creating virtual network.  First of all, I need to make server VM to use proxy from university's network. For this I used tunnelling,  basically what I did was following: from server VM I ssh to lab's server  and tunnel ports so server VM could get internet with proxy from university's network. Command looks like this:

ssh server -p 2222 -i Aset -L 8080:10.1.1.10:3128 -N

To automate this somehow I tried to use autossh but couldn't get it, so I just used screen. GNU Screen is a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session. Some useful commands:

  • screen - to open new screen;

  • screen -ls - to show currently open screens;

  • screen -r [screen ID] - to continue that session;

  • Ctrl + A then D - quit from screen leaving it at background;

  • Ctrl + D - close all screens.

The next step was to install DNS server on my server machine (internal ip 192.168.56.2; external ip 10.0.2.15). First install Bind DNS server:

> > sudo zypper install bind > >

Then configure it in  /etc/named.conf:

> > # create newoptions {directory "/var/lib/named"; dump-file "/var/log/named_dump.db"; statistics-file "/var/log/named.stats";# for security setting below # query range (set if you use only in LAN)
allow-query { localhost; 192.168.56.2/24; };# transfer range (set only for secondary DNS)
allow-transfer { localhost; 192.168.56.2/24; };

# recursion range (set if you use only in LAN)
allow-recursion { localhost; 192.168.56.2/24; };
};

# here is the section for internal informations
view "internal" {

match-clients {
localhost;
192.168.56.2/24;
};

zone "." IN {
type hint;
file "root.hint";
};

# define your domain info for internal
zone "sstlab" IN {
type master;
file "sstlab.lan";
allow-update { none; };
};

# define your IP info for internal *note
zone "2.56.168.192.in-addr.arpa" IN {
type master;
file "2.56.168.192.db";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "127.0.0.zone";
};
};

# here is the section for external informations
view "external" {
match-clients {any;};

zone "." IN {
type hint;
file "root.hint";
};

# define your domain info for external
zone "sstlab" IN {
type master;
file "sstlab.wan";
allow-update { none; };
};

# define your IP info for external *note
zone "15.2.0.10.in-addr.arpa" IN {
type master;
file "15.2.0.10.db";
allow-update { none; };
};
};

include "/etc/named.conf.include";


>
> </blockquote>




Then I installed DHCP server.




<blockquote>

>
> sudo zypper install dhcp-server
>
> </blockquote>


And configure it in /etc/dhcpd.conf``


<blockquote>option domain-name-servers 192.168.56.2;
ddns-update-style none;
ddns-updates off;
log-facility local7;
subnet 192.168.56.0 netmask 255.255.255.0 {
option routers 192.168.56.2;
range 192.168.56.3 192.168.56.254;
default-lease-time 43200;
max-lease-time 86400;
}</blockquote>


So know my server machine gives IP address to the client machine automatically and also client has an access to the internet via server's connection.

Weekly meeting 26.06.2013

Kamila: managed to setup up owncloud backup. It backs up only what has been changed. Authentication and security(SSL) issues. Future work: Setting up remote access to owncloud. Setting up owncloud on the server with backup and LDAP.

Alexandra: worked on LDAP. Automatically created home folders are not private to their users. Worked on integrating LDAP with owncloud. Working on setting up LDAP under TLS or SSL

Damir: Decided on the app. It will be a map game. Managed to detect right/left movements. Will be working on the accelerometer.

Raushan: Developed scenarios for the game with Saule. Will be responsible to interface/design of the app. Working on the main page.

_Saule: _Git master :) Worked on creating git repository on dropbox. Tested on Windows. Digging into git. Wants to work on mapping. Flat files of what maps will look like.

Aset: Created VMs on VirtualBox. Setup Virtual Network inside the lab.

Assulan: Working on web interface based on KVM, WebVirtMgr. Don't have connection between VMs. Will try setting up VMs in the lab.

Shyrailym: Contacted Indian Institute of Technology about their system Baadal, waiting for an answer. Sent request to TryStack, which allows to try Openstack without installing it. It should give us ideas of Openstack possibilities.

Erkanat: Installing Ubuntu Server with Openstack. Got MAAS server running.

Alexandr: Managed running a client with m23. Disabled authentications. Looking at administration of the lab network.

PACC: Week 5

The past week I continued working on LDAP and PAM.

I thought that it would probably be useful if I had all users and groups stored in my LDAP. So, I imported existing groups and users. That resulted in 88 groups and 56 users, including not only real users, but mostly such items as avahi, bluetooth, video, audio and etc.

Tried authorization by the created LDAP users. They could log in via a terminal but not using a GUI login screen. Creating home folders manually did not work.

Changed several PAM files. Succeeded on integrating PAM and LDAP. Home directories are created automatically.

To set up PAM to authorize LDAP users, you need to make the following changes on client machines:

  • Edit /etc/nsswitch.conf:

passwd: files ldap group: files ldap shadow: files ldap

  • Change /etc/ldap/ldap.conf under your LDAP settings.

  • Then, create /etc/auth-client-config/profile.d/bl-ldap file and copy the following lines to the file:

[bl-ldap]

nss_group=group: files ldap

nss_passwd=passwd: files ldap

nss_shadow=shadow: files ldap

nss_netgroup=netgroup: nis

pam_account=account sufficient pam_ldap.so

account required pam_unix.so

pam_auth=auth sufficient pam_ldap.so

auth required pam_unix.so nullok_secure use_first_pass

pam_password=password sufficient pam_ldap.so

password required pam_unix.so nullok obscure min=4``max=8``md5

pam_session=session required pam_unix.so

session required pam_mkhomedir.so skel=/etc/skel/

session optional pam_ldap.so

session optional pam_foreground.so

  • Run in the terminal: sudo auth-client-config -p bl-ldap -a

  • Now your PAM should allow LDAP users to log in. Also, home folders will be created automatically for them.

Home directories of LDAP users are not private. Need to do them private manually.

LDAP didn't work with ownCloud. All it says is that the configuration is invalid.

Set up WOL, so that it works with hostnames also. For doing that, you just need to create something like ARP table. Change /etc/ethers file and add there the MAC addresses and the corresponding hostnames.

Installed Virtual Machine Manager. Set up two VMs: 1 Ubuntu and 1 Xubuntu. Everything in VMs works fine, including internet and local connections. Was looking for some web-based management tools. Proxmox seemed to be promising.

OpenStack Week 3

This week I deployed OpenStack.

In order to do that get devstack project from the github. We need its stable grizzly branch version:

https://github.com/openstack-dev/devstack/tree/stable/grizzly

By default Network management is not installed, so add this text into "localrc" file:

disable_service n-net enable_service q-svc enable_service q-agt enable_service q-dhcp enable_service q-l3 enable_service q-meta enable_service quantum

Optional, to enable tempest configuration as part of devstack

enable_service tempest

Since we want to have multiple-node OpenStack, we need to assign one PC as a server. To do it add this code into "stackrc" file:

disable_service n-net enable_service q-svc enable_service q-agt enable_service q-dhcp enable_service q-l3 enable_service q-meta enable_service quantum

To balance all VMs across servers deploy simple scheduler, by adding to "localrc" this:

SCHEDULER=nova.scheduler.simple.SimpleScheduler

In the end run stack.sh

To add nodes, add this code to "stackrc"

ENABLED_SERVICES=n-cpu,rabbit,g-api,quantum,q-agt SERVICE_HOST=[IP of controller node] ------<< IP OF CONTROLLER NODE!!!!! MYSQL_HOST=$SERVICE_HOST RABBIT_HOST=$SERVICE_HOST Q_HOST=$SERVICE_HOST

However I came across few problems and I still cannot create VM in the OpenStack.

After you installed OpenStack make sure that all Virtualization capabilities are turned on in the BIOS.

Android-ers

Weekly review

Good news we finally decided with the project! There are 2 of its initial scenarios:

Scenario#1 Title: Complete the map (map#1)

Aim:

To show the best result by completing the map with greatest time and/or with the most amount of treasure.

Description: 1) The student Damir wants to complete the map. He starts in point A and moves according to map. 2) When he reaches point B he has an option to proceed to move straight or turn right to collect more treasure. 3) When he finish his map the window with his statistics will appear. 4) Then he could see how well he complete the map and move to another level(map).

Scenario#2 Title: Complete the map

Aim:

To create the challenge map and give it to your friend to see who will be the fastest.

Description

1) The student Damir will create a map. He is able to put there as much treasure and obstacles as he can. Also, he may put some holes. If a player open the hole which look similar like treasure he/she will return to start.
2) Damir gives the created map to his friends.
3) The friends will complete for the best result. The priority condition is to collect as much treasure as you can.
4) If students show the same amount of treasure the one who shows the best time will win.

In meeting I was given the responsibility on design. However, as Professor Ulrich wants us to be able to work in every field of this project we will switch our roles in 3-4 days. So, every of us can work all project (programming, design).
We think to set this project with help of accelerometer. There are lots of tutorials about using accelerometer and it is supported by many versions of android platform.

Last week I read lots of materials about android sensors which you can also read in Damir's blog.

Developing Android Application 4

Weekly Review:

I suggested to concentrate on developing a puzzle game as our main project.  I came to such conclusion due to several reasons:

1) Being able work with databases(basic knowledge enough)

2) Easy to peak up an idea(We can find the type of puzzle game for instance from old books)

3) Working with graphical interface

My proposal was declined and we come to decision to create unique application which uses android sensors. From official website I read about position and monitor sensor:

Motion sensor  - accelerometer, gravity, gyroscope, linear acceleration and rotation vector sensors are used for monitoring device movement such tilt, shake and rotation. For instance by using accelerometer, I constructed an app which by shaking it you can change the background color. I wrote simple xml interface for changing background and MainActivity.java class I initialized SensorManager variable which is responsible for initializing the type of the sensor. We should consider more about activity life-cycle here rather than on standard application. So, we should include on onPause, onResume and OnStop function. Only using data from accelerometer is not enough, we should write physical formulas to gain our goal. In my case, I used three type of accelerations(accel. in x, y and z axis) which is provided by my accelerometer sensor. Then, I used such formula - "(x^2+y^2+z^2)/(earth gravity)^2" to detect how much force was spent to shake it. If it is more than 200, it changes the background color to green or red.

By Dr. Ulrich proposal we decided to develop a game where you need to draw a sign or figure with your phone(on air not on screen). Later with our team, we decided to develop a labyrinth game where you need follow your map(given on screen of phone) by moving with your two legs.

Owncloud Week 2 Report

Mobile application: - Owncloud official app requires installation of aCal, CardDav and other programms to provide functionality to the app, such as calendar, contacts and tasks synchronization. However, this is not direct sync with default mobile calendar, but rather with aCal's calendar, which is a bit useless. - Other 3rd party clients are under development and also require additional app installation. - Solution: It would be better to connect to owncloud via browser, or process it so as to produce the mobile version (as Damir said, it is one of the three methods of creating mobile apps).

Backup: I have started searching for possible backup options: - rsnapshot(better alternative) problems: configuration of the folders to backup to-do: find a solution - cron jobs

TO-DO: - Solve the problem with the rsnapshot - Search for other backup options - Solve the issue with secure connection - Establish the connection to owncloud from outside

Meeting report on 19.06.13

Prof.Norbisrath: started project with mathematicians

Looked for prices of clouds: very cheap Amazon give computing resources for first year for free,

The 1 hour of computing only 2 cents the cheapest one.

Reasons to build our own Cloud will be:

  1. Bandwidth problem

  2. Privacy issues

  3. Research aspect

_Aset: _trying to install VirtMachines. Prof.Norbisrath suggested to install 2 KVMs

_Kamila: _Working on OwnCloud - problems with establishing secure connection

File synch is working, calendar synch is not fully working

Need to look for backup facility

Need to test from home without any proxy if it is running inside the lab

Alexandra: LDAP user login with OwnCloud

Need to investigate in usability of LDAP

Automatic creation of home dir is done. One line code only. J

_Dana: _Started reading LibVirt, will be working with Assulan

Shyrylym: investigate LibVirt, installed OpenStack, had some problems

LibVirt – more for personal use

OpenStack – advantage: easily Scalable;

_Erkanat: _OpenStack can create any type of networks, Network of Networks, create several machines

Exist possibilities to administrate

Will do life tutorial next week about OpenStack ability

_Damir: _Showed his working small apps from his Mobile, ready to start own application

Suggest game “Pic words”

_Raushan: _learning basics, soon join Damir for creating real app

Saule: learning basics, ready to start creating real app.

Had problem with installing OEM driver for Windows for testing reasons on Samsung S4.

_Prof.Ulrich: _suggest to create an app which cannot be done on desktop machine, something with motion sensor.

_Shyrylym: _Exist a OpenSources library that helps to visualize 3D objects

PACC: Week IV [VM network connection]

For this week, I continued to work with M23 program. Particularly on problem how to get to VM IP adress from physical network and VM be able to see all the machines in it. There are some different ways to do that:

User network

  • You need a simple way to give virtual machine access to the Internet and in your local network

  • You do not need access to the virtual machine from the network or from other virtual machines

  • Note: user network does not support some features of networks, such as ICMP, so some applications (such as ping) may not work properly

Requirements

  • Tuned and running virtual machines

  • If you do not want to run it from a root-and, then, for your user needs to have read / write access to / dev / kvm

  • If the virtual machine you want to access the Internet or a local network, then the host system must have access to these networks

Implementation:

Just run the virtual machine with the parameters "-net nic-net user", for example: qemu-system-x86_64-hda / path / to / hda.img-net nic-net user

Remarks:

  • IP-address can be assigned automatically DHCP-server integrated into QEMU;

  • If you want to run multiple virtual machines, you do not need to assign them to different MAC-addresses; With the option "hostfwd" you can get access to a port on the virtual machine. For example, if you want to transfer a file from the host system to a virtual machine, start the car with the parameters "-net nic-net user, hostfwd = tcp :: 5555 -: 22". In this case, you redirect port 5555 from the host system on the virtual machine port 22. The command "scp-P 5555 file.txt root @ localhost :/ tmp", performed on the host system, copy the file to the virtual machine. You can also use a different address for the host system connection.

Public Bridge

You want to assign the IP-addresses of virtual machines and make them accessible from the local network;

** Requirements**:

  • Tuned and running virtual machines;

  • If you do not want to run it from a root-and, then, for your user needs to have read / write access to / dev / kvm;

  • If you do not want to run them from a root, for you will need to configure sudo to run them:

/ Sbin / ip / Usr / sbin / brctl / Usr / sbin / tunctl
  • The host system must have access to the Internet and the local network.

1st way:

Create a file / etc/net/ifaces/breth0/options with following:

TYPE = bri BOOTPROTO = dhcp HOST = eth0 DISABLED = no NM_CONTROLLED = no

Apply the new network configuration command:

/ Etc / init.d / network restart

Bridges interface breth0 should get IP-address, and interface eth0 should be without an address. Features VLANs If you are using VLANs but the virtual machine traffic is not reaching, run the following commands:

# Cd / proc / sys / net / bridge # Ls bridge-nf-call-arptables bridge-nf-call-iptables bridge-nf-call-ip6tables bridge-nf-filter-vlan-tagged # For f in bridge-nf-*; do echo 0> $ f; done

_2nd way: _

Create a bridge command:

sudo / usr / sbin / brctl addbr br0

Add a physical interface to the bridge, such as eth0:

sudo / usr / sbin / brctl addif br0 eth0

Create a qemu-ifup script as follows:

#! / Bin / sh set-x switch = br0 if [ -n "$1" ]; then /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1 /usr/bin/sudo /sbin/ip link set $1 up sleep 0.5s /usr/bin/sudo /usr/sbin/brctl addif $switch $1 exit 0 else echo "Error: no interface specified" exit 1 fi

Generate MAC-address manually or automatically using a script:

#! / Bin / bash # Generate a random mac address for the qemu nic printf 'DE: AD: BE: EF:% 02X:% 02X \ n' $ ((RANDOM% 256)) $ ((RANDOM% 256))

Run each virtual machine by replacing $ macaddress value obtained in the previous step:

qemu-system-x86_64-hda / path / to / hda.img-net nic, macaddr = $ macaddress-net tap

Remarks: If you do not want to run the machine from root-and the script qemu-ifup should work correctly on your person; You can create a system-wide script, calling it in / etc / qemu-ifup  or use any other name, indicating it when you start the machine:

qemu-system-x86_64-hda / path / to / hda.img-net nic, macaddr = $ macaddress-net tap, script = / path / to / qemu-ifup

Each virtual machine is connected to the internal virtual bridge must have its own MAC-address that is different from that of the other machines.

'Android Developers '

Report:

During week 1 the majority of work was dedicated to cover as much material as I could. There were

1) creating pop-up messages 2) creating menu function - context menu 3) writing LayoutParameters in MainActivity.java file 4) simple animation with text

Our project:

We still in the process of deciding the project for our application. I offered to run the “Word Shake” game. The program gives a word with disorder letters. The task is to write the right word. There are 3 levels. And the user will receive scores for every right word.

Installing Android Developer in Windows 7

I also run Android Developer in windows 7. All I needed to do was to download bundle version of eclipse from http://developer.android.com. But the problem was when I run the program I could not create new project because compile with section was empty. So, I downloaded android 4.2 from sdk manager and that is all. And if you want to run your project in your mobile phone click right on your file go to run ->run configuration-> target and choose your preferable settings.

To do:

1) proceed to learn more material 2) begin our project