Wednesday, January 27, 2016

Configuring Linux Mint for Comcast

Step 1. Associate a static IP with localhost:

  ifconfig eth0 10.0.0.2 netmask 255.255.255.0 broadcast 10.0.0.255

Step 2. Add the following DNS Servers to the Wired connection:

  • 75.75.75.75
  • 75.75.76.76
Also add hsd1.state.comcast.net to the Search Domains.

Saturday, November 7, 2015

Android-So You Want to Write an App?


In this blog, I will try and filter out my learning experience with Android 23. Only what did work for me will be reflected below. And my computer info is:
alec@alec-MS-7623 ~/product $ uname -aLinux alec-MS-7623 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
The first thing to do is to DOWNLOAD ANDROID STUDIO FOR LINUX - hit this button when you see it. Then:
alec@alec-MS-7623 ~ $ cd ~/product/
alec@alec-MS-7623 ~/product $ mv ~/Downloads/android-studio-ide-141.2343393-linux.zip .
alec@alec-MS-7623 ~/product $ unzip android-studio-ide-141.2343393-linux.zip 
...alec@alec-MS-7623 ~/product $ mkdir ~/binalec@alec-MS-7623 ~/product $ cd ~/binalec@alec-MS-7623 ~/bin $ ln -s ~/product/android-studio/bin/studio.sh android-studio
and
alec@alec-MS-7623 ~/bin $ cd ~/project/alec@alec-MS-7623 ~/project $ mkdir androidalec@alec-MS-7623 ~/project $ cd android/alec@alec-MS-7623 ~/project/android $ android-studio &
Now follow the instructions on the Installing Android Studio page. Having launched Standalone SDK Manager, hit the Install... button. Sleep!

Saturday, March 21, 2015

Exporting an existing local Git repository to Github

To do so, I followed the Github documentation:

    https://help.github.com/articles/importing-a-git-repository-using-the-command-line/

. It worked. In this blog, I am trying to understand what exactly I have done.

On a remote computer (IP 192.168.1.5), I did some work that I wanted eventually to go to Github, so that I would be able to access my work from anywhere. I renamed the root directory of the project containing this work to minetats-webapp.git, so that the name would correspond to the empty Github repository I created following the doc mentioned above. On that computer, I created a Git repository with cd minetats-webapp.git && git init.

On the local computer, I cloned that repository with

git clone --bare ssh://192.168.1.5:/home/alec/project/minetats-webapp.git

. Then I did


cd minetats-webapp.git/
git push --mirror https://github.com/amissine/minetats-webapp.git

, and it worked. Before I ran cd .. && rm -rf minetats-webapp.git to clean up,
I took a look at what was inside the directory I was about to remove. The directory contained what a typical .git directory inside a Git repository would contain. So much for understanding. When I cloned my work from Github to test it locally,

git clone https://github.com/amissine/minetats-webapp.git

, it was successfully cloned into minetats-webapp.

Saturday, March 14, 2015

A Node.js Rookie Diary

To run your code in a browser, you write it in javascript these days. With node.js, the server-side code can be written in jabascript too. Both sides need to be configurable, need to support dependency injection. Finally, the server side needs to be an HTTP server. The package.json file below reflects my picks on these dependencies:

{
  "name": "webapp.js",
  "version": "1.0.0",
  "description": "A web application with common dependencies",
  "main": "./lib",
  "scripts": {
    "test": "grunt nodeunit"
  },
  "dependencies": {
    "konfy": "0.1.3",
    "dijon": "0.6.1",
    "flatiron": "0.4.3",
    "director": "1.2.8",
    "http-server": "0.7.5"
  },
  "author": "Alec Missine",
  "license": "MIT"
}

 I created it with npm init, then manually edited the dependencies part. Having installed these dependencies in your $WEBAPP_HOME with npm install, you now can

cd $WEB_HOME
node $WEBAPP_HOME/node_modules/http-server/bin/http-server

The static content of your $WEB_HOME will be served on port 8080. If you do not want to cd $WEB_HOME, you can node $HTTP_SERVER_HOME/bin/http-server $WEB_HOME.

To familiarize myself with http-server, I ran

node-inspector &
node --debug node_modules/http-server/node_modules/union/examples/simple/simple.js

in one terminal window, and

curl -d "data to post" http://localhost:9090/foo

in another, while directing my Chrome browser to http://127.0.0.1:8080/debug?port=5858 .  In the browser, I was able to debug the simple.js code.

Monday, March 9, 2015

Installing HandBrake on Linux Mint

sudo apt-get update
sudo apt-get install subversion yasm build-essential \
  autoconf libtool zlib1g-dev libbz2-dev libogg-dev \
  libtheora-dev libvorbis-dev libsamplerate-dev \
  libxml2-dev libfribidi-dev libfreetype6-dev \
  libfontconfig1-dev libass-dev intltool libglib2.0-dev \
  libdbus-glib-1-dev libgtk2.0-dev libgudev-1.0-dev \
  libwebkit-dev libnotify-dev libgstreamer0.10-dev \
  libgstreamer-plugins-base0.10-dev libappindicator-dev \
  libx264-dev libmp3lame-dev libjansson-dev
./configure --launch --disable-gtk

First use:

cd build/
./HandBrakeCLI -i /home/alec/process/cox/laa/San_Diego_Clip.ts \
  -o /home/alec/process/cox/laa/San_Diego_Clip.mp4

Thursday, July 4, 2013

EDA Framework: Clustering with CEP Patterns

Please find the introductory article at

https://docs.google.com/document/d/1Ba24Eo9cs10xbOhV93JUt1gRzIQ-SX4E4nmO8T6UNSA/edit#

Monday, June 4, 2012

Git fetch/rebase/push example

git fetch
git rebase origin/resEmailSMS
git push origin resEmailSMS

Using Pax Construct

history:
git clone https://github.com/ops4j/org.ops4j.pax.construct.git
cd org.ops4j.pax.construct
mvn clean install
mvn site


file:///Users/alec/product/pax-construct/org.ops4j.pax.construct/target/site/index.html

http://repo1.maven.org/maven2/org/ops4j/pax/construct/scripts/1.5/scripts-1.5.zip

Spring DM Example:
#!/bin/sh

#--------------------------------
# let's start with a new project
#--------------------------------

pax-create-project -g examples -a spring

cd spring

#-----------------------------------------------------------------------------------
# first import the Spring Dynamic-Modules Extender bundle - we use importTransitive
# to also import any bundles it depends on and widenScope to do an exhaustive check
# of all dependencies (normally only "provided" scope dependencies are checked)
#-----------------------------------------------------------------------------------

pax-add-repository -i com.springsource.repository.bundles.external -u http://repository.springsource.com/maven/bundles/external

pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.1.2 -- -DimportTransitive -DwidenScope

#------------------------------------------------------------
# create new OSGi service bundle with example code and tests
#------------------------------------------------------------

pax-create-bundle -p org.example.service -- -Djunit

#--------------------------------------------------------------------
# create new Spring Dynamic Modules bean with example code and tests
#--------------------------------------------------------------------

pax-create-bundle -p org.example.bean -- -Dspring -Djunit

#----------------------------
# finally, build and deploy!
#----------------------------

exec mvn clean install pax:provision "-Dframework=equinox"

Saturday, September 10, 2011

Another scp peculiarity


If you want to scp the content of the current directory (its files and subdirs) to the target, you type:

     scp -r . $HOST:$TARGET

If you want to scp the current directory, along with its name, under the target, you type:

     scp -r ../$CURRENT $HOST:$TARGET

One might argue this is not an scp peculiarity, just my lack of knowledge. Accepted. But now I know!

Wednesday, March 23, 2011

Inheriting GWT modules from other Eclipse projects

What if you already have some Eclipse GWT project in the workspace and you want to use it in your current GWT project? Here are the steps (assuming obt2j is the name of the project you want to use and obt is the name of the package where the module you want to inherit from (Obt2) resides).

1. Select your current GWT project in Package Explorer. Go to Properties -> Java Build Path -> Projects, Add..., select obt2j, OK. Select Libraries, Add Class Folder..., select obt2j/src/obt. OK.

2. In a source file from your current project, make a reference to the code owned by module obt. You will see errors, and 1 quick fix will be available:

    Import GWT module obt.Obt2

Apply the fix ONLY ONCE. The following line,

<inherits name="obt.Obt2"/>

, is being added to the corresponding module definition in your current project. Now your current project is hooked to project obt2j.

Starting a new GWT project from scratch (Eclipse)

The GWT Starter Project gets generated for you by default. When you get tired removing the generated code each time you create a new GWT project, and if you use Eclipse IDE, you can use the following nice menu items:

  • File -> New -> Module,
  • File -> New -> HTML Page, and
  • File -> New -> Entry Point Class
in this exact order. (The shortcut for File -> New on a Mac is option-command-N.) Some details are due, though.

1. Select the New Web Application Project menu item. Project name: site1, Package: s1, unselect Use Google App Engine, unselect Generate GWT sample code. Finish.

2. In the Package Explorer view, select your site1 project. Select the New GWT Module menu item. Module name: m1, Package: s1, Finish. In the generated m1.gwt.xml, add an attribute to the root element; the result should look like this:

    <module rename-to="m1">

If you do not do this, the next step will produce incorrect results.

3. Select the New HTML Page menu item. File name: welcome.html, Finish.

4. Select the New Entry Point Class menu item, Name: EntryPoint, Finish. Make a note - the m1.gwt.xml file has been updated accordingly in the editor, and you now MUST save this file. 


If you now debug your site1, you will see EntryPoint.onModuleLoad() started.

Summing up, the trick is to rename the generated module.