Thursday, October 2, 2014

Meet me at Grace Hopper Conference(GHC14)

I first attended the Grace Hopper Celebration in Balitmore in 2012(Thanks to HP for sponsoring me and introducing me to GHC). It was the first women-centric and technology-oriented conference I’d been to and enjoyed the experience but was not able to network as much as i had expected ( I guess introverts need some kind of push)

I submitted talks for 2013 again and was looking forward to attending GHC again ( determined to make the most of it this time) ..but fell sick just before it .... Bummer :(

GHC 2014 is here and i am all set to come and meet you all again! Learned lessons from last time .. setup meetups in advance , connect and network in advance its a big conference!

I am at softlayer,IBM now (sadly they are not yet very GHC-aware yet hence was not able to get sponsors this time) and have  been enjoying exploring new languages(pythong , go), technologies(openstack( , domains( cloud computing) e.t.c at softlayer labs!

message me or connect with me or ping me ..if you want to connect at GHC 2014 in Phoenix!!!


www.linkedin.com/in/neetujain/

Meet me at Grace Hopper Conference(GHC) 2014 !!

I first attended the Grace Hopper Celebration in Balitmore in 2012(Thanks to HP for sponsoring me and introducing me to GHC). It was the first women-centric and technology-oriented conference I’d been to and enjoyed the experience but was not able to network as much as i had expected ( I guess introverts need some kind of push)

I submitted talks for 2013 again and was looking forward to attending GHC again ( determined to make the most of it this time) ..

GHC 2014 is here and i am all set to come and meet you all again! Learned lessons from last time .. setup meetups in advance , connect and network in advance its a big conference!

I am at softlayer,IBM now (sadly they are not yet very GHC-aware yet hence was not able to get sponsors this time) and have  been enjoying exploring new languages(pythong , go), technologies(openstack( , domains( cloud computing) e.t.c at softlayer labs!

message me or connect with me or ping me ..if you want to connect at GHC 2014 in Phoenix!!!


www.linkedin.com/in/neetujain/


Friday, September 19, 2014

Installing docker (not so obvoius)

I was trying to explore docker (mainly to see and understand if docker would be a better choice for my project ..currently i am using vagrant ) and the first step was to install docker.

and something unexpected happened


so my steps were:-
1. install docker  (this turned out to be wrong docker)

sudo apt-get install docker
2. run the first command from the tutorial ( i doubled checked multiple tutorials to make sure the command was right )
sudo docker run -t -i ubuntu:14.04 /bin/bash

3. but things were not working ..It could not recognise the flags (-t, -i)  hence started the troubleshooting ( you generally don't expect to run into issues on the first command..)

after some debugging i found that IT IS THE WRONG DOCKER!!! ( imagine that :))


more details here :-
http://stackoverflow.com/questions/20018736/docker-opens-up-a-tiny-new-window-that-does-nothing


anyways what i did was ultimately

4. remove unwanted docker (you can verify that its the unwanted on by coker --help)
 docker --help  
 sudo apt-get remove docker


5. now if you have ubuntu 14:0 then this should work :-
$ sudo apt-get update
$ sudo apt-get install docker.io
$ sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
$ sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io 
6. But if you have an older ubuntu these instructions will help :-

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D8576A8BA88D21E9  
 $ sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"  
 $ sudo apt-get update  
 $ sudo apt-get install lxc-docker  
 $ sudo docker version  
 Client version: 0.9.0  
 Go version (client): go1.2.1  
 Git commit (client): 2b3fdf2  
 Server version: 0.9.0  
 Git commit (server): 2b3fdf2  
 Go version (server): go1.2.1  
 Last stable version: 0.9.0  
 $ sudo docker search ubuntu | grep '^ubuntu'  
 ubuntu   General use Ubuntu base image. Tags availa...  108  
 ubuntu-upstart                       0  
 ubuntu/ping 
 
 
 
7. to know things are working ... you should see something like this:- 
 0  
root@njain2:~/office/projects# sudo docker run -t -i ubuntu:14.04 /bin/bash
Unable to find image 'ubuntu:14.04' locally
Pulling repository ubuntu
96864a7d2df3: Error pulling image (14.04) from ubuntu, endpoint: https://registry-196864a7d2df3: Error pulling image (14.04) from ubuntu, Error mounting '/dev/mapper/docker-202:2-1501557-511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158' on '/var/lib/docker/devicemapper/mnt/511136ea3c5a64f264b78b5433614aec563103b4d42014/09/19 12:55:20 Error pulling image (14.04) from ubuntu, Error mounting '/dev/mapper/docker-202:2-1501557-511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158' on '/var/lib/docker/devicemapper/mnt/511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158': device or resource busy
root@njain2:~/office/projects# pwd
/root/office/projects
root@njain2:~/office/projects# cd event-notification/ 



8. In case things are not working (due to device mapper errors) 
use AUFS instead of device mapper ( you can detect this by "sudo docker info"
$ sudo apt-get update
$ sudo apt-get install linux-image-extra-`uname -r`
$ sudo apt-get purge --auto-remove lxc-docker 
$ sudo apt-get install lxc-docker
$ buzzenv)njain@njain3:~/office/buzz$ sudo docker info
Containers: 1
Images: 7
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 9
Execution Driver: native-0.2
Kernel Version: 3.2.0-60-virtual
Operating System: Ubuntu precise (12.04.4 LTS)
you should not see device mapper in docker info :) and you are good to go 
 
 
 

Wednesday, September 10, 2014

dependency on pyopenssl and "gcc failed with exit status 1" issue


I have a script that listens to APNS feedback service to get invalid tokens (https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9)


when i ran into a ubuntu box (spun by vagrant ) i ran into this issue:-


  
 raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1




So I read online that probably i need to fix pyopenssl   hence i tried 
Pip install pyopenssl 

 raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

After that i tried easyinstall to understand more on whats going on and i got 


    No package 'libffi' found c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory #include "
 
 
You'll need to install the libffi-devel package  

                   "sudo apt-get install libffi-dev"

vagrant ssh on windows : `ssh` executable not found in any directories in the %PATH% variabl

if your vagrant ssh compliants about this :-

H:\office projects\event-notification>vagrant ssh
`ssh` executable not found in any directories in the %PATH% variable. Is an
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
contain an SSH client. Or use your favorite SSH client with the following
authentication information shown below:

Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: sdfdsf


simple solution is :-


set PATH=%PATH%;C:\Program Files (x86)\Git\bin

Monday, August 4, 2014

installing pyapns on windows ..not that easy!

  File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
    vc_env = query_vcvarsall(VERSION, plat_spec)
  File "C:\Python27\lib\distutils\msvc9compiler.py", line 271, in query_vcvarsal
l
    raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
when you get this problem you can to install visual studio 9 
 
I was able to move ahead  by:
  1. Finding vcvarsx86_amd64.bat in C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvarsx86_amd64.bat (depends on your setup)
  2. Open a cmd prompt
  3. Run SET VS90COMNTOOLS=%VS90COMNTOOLS% (depends on setup, seehttp://stackoverflow.com/a/10558328/2362877)
  4. Run vcvarsx86_amd64.bat
  5.  
  6.  "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvarsx86_amd64.bat"

    H:\office projects\event-notification>"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
    Setting environment for using Microsoft Visual Studio 2008 x86 tools.
but then i ran into this issue 


https://github.com/pyca/cryptography/issues/762 


   Creating library c:\users\faizan\appdata\local\temp\easy_install-myikuq\crypt
ography-0.1\cryptography\hazmat\primitives\__pycache__\Release\cryptography\hazm
at\primitives\__pycache__\_cffi__x5fea2bacx4a8b9ec1.lib and object c:\users\faiz
an\appdata\local\temp\easy_install-myikuq\cryptography-0.1\cryptography\hazmat\p
rimitives\__pycache__\Release\cryptography\hazmat\primitives\__pycache__\_cffi__
x5fea2bacx4a8b9ec1.exp
_cffi__xd9dc3d0ax8cb54b0a.c
cryptography\hazmat\bindings\__pycache__\_cffi__xd9dc3d0ax8cb54b0a.c(165) : fata
l error C1083: Cannot open include file: 'openssl/asn1.h': No such file or direc
tory
error: c:\users\faizan\appdata\local\temp\easy_install-myikuq\cryptography-0.1\c
ffi-0.8.1-py2.7-win32.egg\_cffi_backend.pyd: Access is denied





  File "C:\Python27\lib\site-packages\cffi\ffiplatform.py", line 50, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError: CompileError: command '"C:\Program Files (x8
6)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2


SET LIB C:\OpenSSL-win32\lib;etc;etc;etc
SET INCLUDE C:\OpenSSL-win32\include;etc;etc
You can add to the system variables like this:
SET LIB=C:\OPenSSL-win32\lib;%LIB%


 File "C:\Python27\lib\site-packages\cffi\verifier.py", line 139, in _compile_module
    outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
  File "C:\Python27\lib\site-packages\cffi\ffiplatform.py", line 25, in compile
    outputfilename = _build(tmpdir, ext)
  File "C:\Python27\lib\site-packages\cffi\ffiplatform.py", line 50, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError:
 LinkError: command '"c:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\BIN\link.exe"' failed with exit status 1120

  if you are still getting this try these :-

1) reinstall pip http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows