Tuesday, March 17, 2015

Configure Wireless Networking in Ubuntu via the Command Line

First, you need to install the relevant software. You need to have a wired connection at this point, otherwise this wont work.
sudo apt-get install wireless-tools wpasupplicant
If you are connecting to an open network, you wont need wpasupplicant. Next, you need to “bring up” (essentially this means activate) your WiFi interface. So, issue:
sudo ifconfig wlan0 up
Next, to make sure your wireless device is working as it should issue:
iwconfig
and then
sudo iwlist scanwpa_passphrase YOURSSID YOURWIFIPASSWORD
This will result in something that looks like this:
network={
ssid="YOURSSID"
#psk="YOURWIFIPASSWORD"
psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab1 5bbc6c52e7522f709a
}
sudo nano /etc/network/interfaces
sudo vi /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant                        ctrl_interface_group=0

eapol_version=2
ap_scan=1
fast_reauth=1
country=NL

### Associate with any open access point
###  Scans/ESSID changes can be done with wpa_cli
network={
  ssid=""
  key_mgmt=NONE
  priority=1
}

# WEP
network={
  ssid="ubuntuwifi"
  scan_ssid=1
  key_mgmt=NONE
  wep_key0="OpenSesame"
  wep_key1="OpenOtherSesame"
  # Use the correct key..
  wep_tx_keyidx=0
  priority=5
}

# WPA/WPA2
network={
  ssid="ubuntuwifi"
  scan_ssid=1
  psk=24f87a7583001eb7cea2394bbdb04eb2d3641f0b907dd31bd286be628c1841f8
  priority=5
  ## The configuration items listed below do not need to be set, the defaults are
  ## pretty 'let us do it for you'.
  ## See /usr/share/doc/wpasupplicant/wpa_supplicant.conf.gz for more information.
  # key_mgmt=WPA-PSK
  # proto=WPA RSN
  # pairwise=CCMP TKIP
  # group=CCMP TKIP
}
start    WPA/WPA2
/sbin/wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan0 -D  -B -f /var/log/wpa_supplicant.log

Saturday, March 14, 2015

Deploying Cloud Foundry on Helion OS

  1. Install the BOSH Command Line Interface

Prerequisites on Ubuntu Trusty

sudo apt-get install build-essential ruby ruby-dev libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev


  • Install the BOSH

  1. Prerequisites on Ubuntu Trusty
$sudo apt-get install build-essential ruby ruby-dev libxml2-dev libsqlite3-dev libxslt1-dev libpq-dev libmysqlclient-dev

   2.   gem install bosh_cli bosh_cli_plugin_micro --no-ri --no-rdoc




  • Validate your OpenStack Instance
Create a ~/.fog file and copy the below content:
:openstack:
  :openstack_auth_url:  http://HOST_IP:5000/v2.0/tokens
  :openstack_api_key:   PASSWORD
  :openstack_username:  USERNAME
  :openstack_tenant:    PROJECT_NAME
  :openstack_region:    RegionOne# Optional
Install the fog application in your terminal, then run it in interactive mode:
$ gem install fog
$ fog openstack
>> Compute[:openstack].servers
[]
  • Create Security Groups for Cloud Foundry
  • Deploying MicroBOSH on Helion
  • Deploying Cloud Foundry  using BOSH


Friday, March 13, 2015

Disabling NetworkManager

According to this bug here's how to disable Network Manager without uninstalling it:
Stop network manager
sudo stop network-manager
Create an override file for the upstart job:

echo "manual" | sudo tee /etc/init/network-manager.override

sudo vi /etc/resolvconf/resolv.conf.d/base
nameserver 16.110.135.51
nameserver 16.110.135.52

sudo resolvconf -u



sudo without passwd
soauser ALL=(ALL) NOPASSWD: ALL



vi /etc/hostname
sudo service hostname restart



By default, the SSH server denies password-based login for root. In /etc/ssh/sshd_config, change:


PermitRootLogin without-password
to
PermitRootLogin yes
And restart SSH:
sudo service ssh restart



route add   SIOCADDRT: Invalid argument





Using Virtual Ethernet Adapters in Promiscuous Mode

Guest vm can't ping through the host , but can't ping through gateway

go to network ->adapter setting -> Local connection ->Properties ->uncheck mcafee ndis intermediate filter miniport(or select it then uninstall it)


The vm net network internet is back again


Using Virtual Ethernet Adapters in Promiscuous Mode on a Linux Host





Thursday, March 12, 2015

NeutronApiService

During the building of the NeutronApiService, the _run_wsgi function creates a WSGI application using the load_paste_app function inside config.py - which parsesapi-paste.ini - in order to create a WSGI app using Paste‘s deploy.
The api-paste.ini file defines the WSGI applications and routes - using the Paste INI file format.
The INI file directs paste to instantiate the APIRouter class of Neutron, which contains several methods that map Neutron resources (such as Ports, Networks, Subnets) to URLs, and the controller for each resource.

Wednesday, March 11, 2015

Quickly Running A Single OpenStack Nova Test

Here’s how we usually run a single test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
dims@dims-mac:~/openstack/nova$ time tox -e py27 nova.tests.unit.test_versions
py27 develop-inst-noop: /Users/dims/openstack/nova
py27 runtests: PYTHONHASHSEED='0'
py27 runtests: commands[0] | find . -type f -name *.pyc -delete
py27 runtests: commands[1] | bash tools/pretty_tox.sh nova.tests.unit.test_versions
{1} nova.tests.unit.test_versions.VersionTestCase.test_version_string_with_package_is_good [0.180036s] ... ok
{0} nova.tests.unit.test_versions.VersionTestCase.test_release_file [0.184115s] ... ok
 
======
Totals
======
Ran: 2 tests in 13.0000 sec.
 - Passed: 2
 - Skipped: 0
 - Failed: 0
Sum of execute time for each test: 0.3642 sec.
 
==============
Worker Balance
==============
 - Worker 0 (1 tests) => 0:00:00.184115s
 - Worker 1 (1 tests) => 0:00:00.180036s
________________________________________________________________________________________________________________________ summary _________________________________________________________________________________________________________________________
  py27: commands succeeded
  congratulations <span class="wp-smiley wp-emoji wp-emoji-smile" title=":)">:)</span>
 
real    0m14.452s
user    0m16.392s
sys 0m2.354s
Sometimes the usual way is not very helpful, especially when you are working on some new code and say running into issues importing code. Then, here’s what you do.
First, activate the py27 virtualenv
1
dims@dims-mac:~/openstack/nova$ . .tox/py27/bin/activate
Then use testtools
1
2
3
4
5
(py27)dims@dims-mac:~/openstack/nova$ python -m testtools.run nova.tests.unit.test_versions
Tests running...
 
Ran 2 tests in 0.090s
OK
Or you can install pytest
1
2
3
4
5
6
7
8
9
10
11
12
13
(py27)dims@dims-mac:~/openstack/nova$ pip install pytest
Collecting pytest
  Downloading pytest-2.6.4.tar.gz (512kB)
    100% |################################| 516kB 877kB/s
Collecting py>=1.4.25 (from pytest)
  Downloading py-1.4.26.tar.gz (190kB)
    100% |################################| 192kB 4.3MB/s
Installing collected packages: py, pytest
  Running setup.py install for py
  Running setup.py install for pytest
    Installing py.test-2.7 script to /Users/dims/openstack/nova/.tox/py27/bin
    Installing py.test script to /Users/dims/openstack/nova/.tox/py27/bin
Successfully installed py-1.4.26 pytest-2.6.4
And then run the same test using py.test
1
2
3
4
5
6
7
8
9
10
11
12
(py27)dims@dims-mac:~/openstack/nova$ find . -name py.test
./.tox/py27/bin/py.test
 
(py27)dims@dims-mac:~/openstack/nova$ .tox/py27/bin/py.test -svx nova/tests/unit/test_versions.py
================================================================================================================== test session starts ===================================================================================================================
platform darwin -- Python 2.7.8 -- py-1.4.26 -- pytest-2.6.4 -- /Users/dims/openstack/nova/.tox/py27/bin/python2.7
collected 2 items
 
nova/tests/unit/test_versions.py::VersionTestCase::test_release_file PASSED
nova/tests/unit/test_versions.py::VersionTestCase::test_version_string_with_package_is_good PASSED
 
================================================================================================================ 2 passed in 1.69 seconds ================================================================================================================
These tips are based on the openstack-dev mailing list discussion:
http://openstack.markmail.org/thread/wetxcnhuq6b7auhn