Tuesday, June 21, 2016

Software for Linux Screencast

I bought a new Dell XPS 13 running Ubuntu 14.04 out of box with the Sputnik project. Nothing fancy, just the low end non-touch model. For those who cried foul that I am suppose to buy a cheap Laptop and install Linux from scratch, I know how you feel, sorry I sort of cheated. But I just want to have a Linux laptop without having to be my own tech support when it comes to things like fixing WiFi drivers and hooking up external monitors (although they were not as smooth as I would've expected, but that is for another post). Overall I am happy that I have a small, nicely engineered Linux laptop.

However, when it comes time to showing my work and do screencast, I remember seeing an article last year about free Linux software that includes some screen recording and video editing software. Here is the original article 20 Free Open Source Softwares I Found in Year 2015 if you are interested.

From the article I found the two tools I was looking for, Simple Screen Recorder and OpenShot Video Editor.

Here are the two most helpful articles on setting them up and getting them running. At least for Ubuntu, they are straight forward as to adding the repository and do apt-get install.

Screencasting with Simple Screen Recorder

http://www.openshot.org/ (Go to Download, and for me I chose the PPA method)

I used the default settings to record in 30 fps with the entire monitor at 1920x1080. Then use OpenShot to export it to HD 1080p 30 fps MP4 video.

Here are two screenshots of the software:

Here is a sample of the final MP4 that I did.


Happy coding! Let me know in the comments if there are some settings you are interested in that I did not cover.

Sunday, June 19, 2016

Be More Serious about Blogging and Building a Community

To The Readers:

I am sorry I have been away for so long! I suck at blogging. When I look at my last post, it was dated December 2015, which means I have not written a blog for almost 6 months. Why? I think the following reasons applies:

1. Life Events. The past 6 months has been more eventful than usual for life outside of my 9-5. I quit my job at Microsoft and started working for A10 Networks again. Let's face it, anybody who have switched jobs know that you agonize about the move weeks / months before it actually happens, not to mention all the phone screens and interview loops. I also bought a house that required some renovation before moving in, then of course, have to move out of the old home and into the new. Moving is no fun and sucks the energy out of ya, I tell you.

2. Professional Direction. I have been making my living as network engineering before switching my focus to software development, particularly Python. However, I never wanted to just code all day. So I was trying to find a balance between writing code, building stuff, and relate them back to network engineering. I wrote my first online class for Internetwork Expert (https://streaming.ine.com/c/practical-python-for-network-engineers) and spent 10 weeks being a teaching assistant at University of Washington Extension Python 200 night course. They were each rewarding in their own rights, but they demanded my time and attention.

All in all, I am happy with the progress I have made this year, especially the teaching experiences, but there is one thing I regret the most: Not keeping up with my blog! This is highly unfortunate because although I started this blog as a place to do a brain dump of my code and projects, over time it proves to be one of the most valuable piece of work I have done. I can often point to this blog as a repository of projects and spur new conversations. Sometimes I look back at the post and find new inspirations. Reading thru comments that people leave allows me to build a closer relationship with people who spent their precious time reading things I have written. The list goes on and on.

So here I am, 6 months after my last post, writing a post to pledge my renewed enthusiasm for blogging. My goal is to share my knowledge that people find useful and build a community around the topic of network automation.

My renewed goals for my blog are:

1. Provide valuable information to people who wants to read about network automation, Python, and network engineering.

2. In time, earn their trust so they are open about what they want to learn and which topic they will find value in and pay for.

3. I will be able to focus on the topics that bring the most value to the audience with free and paid material.

I want to be completely honest that one of my goals is to construct paid course material that will help me sustain my effort, but not before I make sure the contents are worth every penny that someone paid for them. Also I will make sure I bring value to the world by putting free and valuable knowledge that can serve others.

So enough chatting, let's go for some Python for Network Engineer contents!



Sunday, December 27, 2015

Anaconda Environment and VirtualEnv Management

Anaconda Python from Continuum is a great tool. It is easy to install and get rid of a lot of the headache of package installation and management.  It is one of the reasons Python has a big footprint in the Scientific Computing and Data Science circle, in my opinion. I enjoy their one-installer-for-all-platform especially and happily traded in my 'pip' commands for 'conda' commands (for more information click here). Anaconda is my default Python interpreter on multiple machines.

There is only one complain, working with Python VirtualEnv is different when you have Anaconda Python as your default Python interpreter. Doing a quick search for 'Anaconda Python VirtualEnv' shows a lot of frustration amongst others. Conda places emphasis on reproducibility as all scientific research should, so their recommended way of managing environment is to use the 'conda env' commands.

I don't claim the following is correct, but they work for me.

***** Using the Good Old VirtualEnv for Learning *****

Currently I am going thru RealPython's courses (which are excellent, by the way), and want to create quick VirtualEnv to separate the different packages used in different lessons.

- Find out your Python interpreter path and specify it when creating virtualenv

MacBook-Air:my_code echou$ virtualenv -p /usr/bin/python2.7 test
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in test/bin/python
Installing setuptools, pip, wheel...done.
MacBook-Air:my_code echou$ source test/bin/activate
(test)MacBook-Air:my_code echou$
(test)MacBook-Air:my_code echou$ deactivate

MacBook-Air:my_code echou$ 

***** Use Conad Env for more Permanent Projects *****

I also intend to keep a few Flask environment active for some other projects, which I have elected to use the Conda environments. 

Here are some helpful links: 

http://conda.pydata.org/docs/using/envs.html #Managing Anaconda environments

MacBook-Air:my_code echou$ conda env --help
usage: conda-env [-h] {attach,create,export,list,remove,upload,update} ...

positional arguments:
    attach              Embeds information describing your conda environment
                        into the notebook metadata
    create              Create an environment based on an environment file
    export              Export a given environment
    list                List the Conda environments
    remove              Remove an environment
    upload              Upload an environment to anaconda.org
    update              Update the current environment based on environment

optional arguments:
  -h, --help            Show this help message and exit.

my_code echou$ conda create --name TEST2 ipython (click on the link above for Anaconda package list)
Fetching package metadata: ....
Solving package specifications: ...............
Package plan for installation in environment <locaion>/anaconda/envs/TEST2:

The following NEW packages will be INSTALLED:

    appnope:          0.1.0-py27_0
    decorator:        4.0.6-py27_0
    ipython:          4.0.1-py27_0
    ipython_genutils: 0.1.0-py27_0
    openssl:          1.0.2d-0
    path.py:          8.1.2-py27_1
    pexpect:          3.3-py27_0
    pickleshare:      0.5-py27_0
    pip:              7.1.2-py27_0
    python:           2.7.11-0
    python.app:       1.2-py27_4
    readline:         6.2-2
    setuptools:       19.1.1-py27_0
    simplegeneric:    0.8.1-py27_0
    tk:               8.5.18-0
    traitlets:        4.0.0-py27_0
    wheel:            0.26.0-py27_1
    zlib:             1.2.8-0

Proceed ([y]/n)? y

Linking packages ...
[      COMPLETE      ]|##################################################################################################################| 100%
# To activate this environment, use:
# $ source activate TEST2
# To deactivate this environment, use:
# $ source deactivate

my_code echou$ source activate TEST2
discarding <path>/anaconda/bin from PATH
prepending <path>/anaconda/envs/TEST2/bin to PATH
(TEST2)my_code echou$ source deactivate
discarding <path>/anaconda/envs/TEST2/bin from PATH
my_code echou$

So far it works for me, if I find any problems or issues down the line I will update this post. 

Happy Coding! 

Thursday, November 26, 2015

Wednesday, September 16, 2015

3D Scan with Kinect

[Warning: Non-Python, Non-Network Engineering related. But I think it is fun. :)]

[9/21 Update: I received a scan with Kinect connected to a PC with dual GPU last week, printed out that model  and attached the result pictures at the end]

I received my Windows Kinect Adapter and here is the workflow I followed to go from 3D scan to a 3D printout on the 3D printer:

1. Download and install the Kinect SDK.

2. Originally I was going to use 3D Builder from Microsoft, but apperantly the scanning function is missing on the Windows 10 version. Luckily, KScan3D is free and available, so I used it.

3. Then I use 3D Builder to correct the image, slice it, and put a base to print better, save it as stl file. Note that because I was by myself and rotated myself instead of the scanner, the top of my head was empty, so I put a hat on top of my head.

4. Finally, I used MakerWare to open the file and save it as x3g on the SD card to print on the Replicator 2. To save time, I shrink the size so it can print in 30 minutes. 

5. I should have used support on the hands, or use support, but here is the final print:

I will be the first to admit it is a bit creepy to see yourself printed out, but hay, it is also very cool!

Happy Making!

[9/21 Update: Kinect + Windows 8.1 3D Builder Scan connected to PC with dual GPU]

Saturday, September 5, 2015

Replace MakerBot Replicator 2 Heater Block

Sorry, this is yet another non-Python, non-Network Engineering related post. I guess at some point if I put enough of these 3D printing posts they need to be on a blog by themselves.

My MakerBot Replicator 2 nozzle got clogged up a few weeks ago. This was how it got jammed up: since the filament gets tangled up all the time, I was cutting out a certain length of filament ahead of time. One time I wasnt paying attention and the filament ran to the very end, pass the motor, and got stuck.

Knowing what I know now, I could have probably just take the motor on the back off and use a plier to pull out that string of filament. But at the time I decided to replace the whole heater block by Fargo. I am really glad I did, it was a fraction of the cost and was a great learning experience. Here is the instruction video:

Here are some pictures from my own printer that I took:

Here is the jam itself:

I label the parts I took off and during which step because I was paranoid: 

The insulation tape was in pretty bad shape: 

New and old heater block:

Happy Prints after replacement.....

Happy Making!

Friday, August 21, 2015

3D Object Mesh with Windows 3D Builder

So lately I am obsessed with 3D printing again. I was watching the 3D Builder User Manual on Channel 9 yesterday and listening to 'Talk Python To Me' this morning, a podcast that I enjoy listening to. So I decided to do a 3D object mesh using the Python logo and 3D Builder.

3D Builder is a pretty awesome tool, it is free for Windows users and can be used via touch or traditional mouse. It also has a object correction tool tied in to Azure backend to make sure your model is printable. All the steps below are illustrated in the 4th segment of the 3D Builder User Manual so I won't repeat it here.

Final Product (steps below):

Here is an time lapsed video for the initial stage of the prints (2 more closer look videos at the end of page):


The awesome Python logo file was downloaded from Thingiverse here, by Brian J. Geiger.

Here are the simple steps:

1. Import the base and stretch it:

2. Add Python logo and rotate it 90 degrees:

3. Merge the two objects (notice on the top left corner it is now just 1 object):

4. Add embroilment:

5. Here is a pretty cool part for Windows, if your 3D printer is one of the supported ones (like my PrintrBot Simple), you can just File -> Print like a regular 2D printer.

3D Builder is a very cool entry level 3D building program that is easier to learn and use than some of the other CAD programs. Best of all, it is free with Windows 8.1 and 10!

6. Because the time lapsed videos are so cool, I took two more while making another model:



Happy Making!