Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • tuxdna 2:30 pm on July 4, 2013 Permalink | Reply
    Tags: , juniper, , vpn   

    Juniper Networks VPN from Fedora 17 x86_64 

    I had to use Juniper VPN but apparently it doesn’t work well from Linux machines. To complicate the matter even more the underlying VPN software is 32 bit, but I am running a 64bit OS.

    I have outlined the setup steps here:

    Although all these steps are specifically for Fedora 17/18 x86_64 bit OS, it should be easy to connect from Ubuntu machines too.

    I hope it helps you.

    EDIT:

    I also came across these links for RPM based OSes:

    EDIT2:

    Latest official documentation is here – [SSL VPN/MAG] How to install the 32 bit Network Connect client on 64 bit Linux platforms

     
    • AB 7:55 pm on July 4, 2013 Permalink | Reply

      You can try this. Seems a little easier and works great in Fedora 18 and I just tried it on 19 and rocks!!

    • DJJ 8:04 pm on November 21, 2013 Permalink | Reply

      Hello,
      First thanks for your post. I’m new to linux and I’m having a hard time learning how to install juniper network connect.

      I managed to get this far concerning the installation of network connect. But I’m stuck here as somehow I don’t have the NCSVC file.

      find .juniper_networks/

      .juniper_networks/
      .juniper_networks/narport.txt
      .juniper_networks/dsHostChecker_linux1.log
      .juniper_networks/tncc.jar
      .juniper_networks/whitelist.txt
      .juniper_networks/tmp
      .juniper_networks/tmp/META-INF
      .juniper_networks/network_connect
      .juniper_networks/network_connect/installnc.log
      .juniper_networks/network_connect/installNC.sh
      .juniper_networks/network_connect/missing.info

      Could you please help. I tried the mad scientist link but it seems that i need NCSVC file as well.

    • tuxdna 8:15 pm on November 21, 2013 Permalink | Reply

      The files on my installation are listed in the gist here: https://gist.github.com/tuxdna/5926030

      I guess that for you, ncsvc should be part of .juniper_networks/tncc.jar. Check that once.

      Also have a look at the official documentation if that helps: http://www.juniper.net/techpubs/software/ive/guides/howtos/How_To_Host_Checker.pdf

      • DJJ 8:52 pm on November 21, 2013 Permalink | Reply

        thanks for the pormpt reply. I don’t really how to check th tncc.jar file.
        a java -jar .juniper_networks/tncc.jar gives.
        Could not find or load main class tncc.jar.

        Also have a look at the official documentation didn’t help much. If any idea ;ore comes to your mind i’ll be try it. thanks

        • tuxdna 8:54 pm on November 21, 2013 Permalink

          tncc.jar is a regular zip file. You should be able to unzip it and see its contents. I hope you will find the desired file in there.

    • DJJ 9:58 pm on November 21, 2013 Permalink | Reply

      Got it! many thanks to you.

  • tuxdna 6:00 pm on May 14, 2013 Permalink | Reply
    Tags: , iptables, , networking   

    Setting up NAT and MASQUERADE for sharing USB Tether connection over LAN 

    I the only source of Internet connection I have currently is my phone. I wanted to share this network with other systems, via a lan/wireless router. So here is a basic setup:

    • Android Phone with USB Tethering
    • Laptop ( Fedora 18 )
    • Wireless Router with Lan
    • A desktop machine ( Fedora 17 )

    Setting up Internet gateway: Laptop + Android Phone

    I connected Android Phone via USB cable to the laptop and enabled USB thether, so I have a usb device /dev/usb0. This was automatically detected by Network Manager. Also I connected Laptop to the router via a LAN.

    I setup the NAT on my Laptop using this script as follows:

    # cat nat.sh
    IFOUT=usb0
    IFLAN=em1
    echo 1 > /proc/sys/net/ipv4/ip_forward &&
    sudo iptables -t nat -A POSTROUTING -o $IFOUT -j MASQUERADE &&
    sudo iptables -A FORWARD -i $IFOUT -o $IFLAN -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT &&
    sudo iptables -A FORWARD -i $IFLAN -o $IFOUT -j ACCEPT
    

    So all I had to do to setup is do this:

    # sh nat.sh
    

    And IPTABLES take care of masquerading the IP addresses to-and-fro from local network to the internet. I received IP address 192.168.1.2 for the Laptop, which becomes a default gateway for rest of the machines connected to the router.

    Setting up Internet user: Desktop machine

    Now on the desktop machine ( with IP address 192.168.1.3 ), I only had to setup the routes and DNS server:

    # route add default gw 192.168.1.2
    # route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.1.2     0.0.0.0         UG    0      0        0 em1
    0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 em1
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 em1
    
    # cat /etc/resolv.conf 
    # Generated by NetworkManager
    #nameserver 192.168.1.3
    nameserver 208.67.222.222
    nameserver 208.67.220.220
    nameserver 192.168.42.129
    

    Thats all, that was needed. I had done the NAT + MASQUERADE setup earlier, however it was on Fedora Core 2 and some commands didn’t match up, esp. how to use conntrack module.

    References:

     
  • tuxdna 3:04 pm on April 17, 2013 Permalink | Reply  

    Understanding big Lucene index by inspecting a portion of it 

    I was wondering if I could get a sample out of many huge Lucene indexes and inspect them with Lukeall on my machine. I quickly realized, that copying such indexes over network would be time consuming.

    First I googled for a ready-made solution so that I could copy on a few documents from the whole index into a separate ( small ) index. That way I could quickly understand the document structure. I came across this blog which mentions only how to backup a Lucene index. My use-case is to get only a portion of it. However, it also mentions how to use Lukeall to export an index ( or a portion of it ) in XML format. That seemed to be in right direction. But, there is no way I could import it back into a Lucene index. Well, that is was a stumbling block. There is a defect open in Lukeall for precisely this feature here.

    For my purpose I have created a Scala script to copy first few documents of an index into an output index. The script is located here for now.  So, now I can get the first few documents from an index on a remote machine and inspect them locally.

    Are there any better ways ?

     
  • tuxdna 10:46 am on April 16, 2013 Permalink | Reply  

    On choosing Play2 framework 

    I was wondering whether or not to learn Play2 Framework. I already know Ruby On Rails. The main criteria right now is to run a web-application that will use lots of code already written in Java.

    Which one of Rails/JRuby or Play2 would be better when deploying on JVM? That is my main question. So far I have stumbled upon similar questions as below:

    There are two criteria that I considered for selecting Play2:

    • Learning curve
    • Performance

    For learning curve, definitely it would take more time for me to learn Play2 than just using Rails on JRuby. However, since Play2 is quite similar to Ruby On Rails, it would be fairly easy to map the concepts. Play2 provides type-safety, so some bugs will appear earlier at the time of development itself. I can choose either Scala/Java for development and also I can select different templates for HTML or JavaScript etc. For performance, I found something very interesting here.

    I am getting a feeling that Play framework will perform significantly better that Rails/JRuby. Well, that remains to be seen for now.

    I hope Play2 would be nice to learn.

     
  • tuxdna 2:38 pm on March 15, 2013 Permalink | Reply
    Tags: akka, ,   

    Emacs and Akka Pi example 

    I was trying The first Akka Example here

    Install the TypeSafe stack on RPM distro:

    $ sudo yum install typesafe-stack
    

    Setup a g8 project:

    $ g8 typesafehub/akka-scala-sbt
    Akka 2.0 Project Using Scala and sbt 
    
    organization [org.example]: in.tuxdna
    name [Akka Project In Scala]: akka-pi
    akka_version [2.0.1]: 
    version [0.1-SNAPSHOT]: 
    

    The I added the Pi.scala to src/main/scala folder. Then I tried to compile it from within Emacs, to check if it will be easier navigate compilation errors in the code. I got wierd output. Emacs compilation buffer was printing escape characters.

    For this I found two solutions:
    * Disable the colors generated by SBT in the first place: http://www.scala-lang.org/node/2198

     sbt compile -Dsbt.log.noformat=true
    

    * OR Enable ANSI colors in Emacs compilation buffer: http://stackoverflow.com/questions/13397737/ansi-coloring-in-compilation-mode

     (require 'ansi-color)
    (defun colorize-compilation-buffer ()
      (toggle-read-only)
      (ansi-color-apply-on-region (point-min) (point-max))
      (toggle-read-only))
    (add-hook 'compilation-filter-hook 'colorize-compilation-buffer)
    

    And here is the final output after I had resolved all the compilation errors. ( because I didn’t copy/paste all the code, I typed it out ):

    Enter number: ~/Downloads/akka-pi$ sbt run 
    [info] Loading project definition from /home/saleem/Downloads/akka-pi/project
    [info] Set current project to akka-pi (in build file:/home/saleem/Downloads/akka-pi/)
    
    Multiple main classes detected, select one to run:
    
     [1] in.tuxdna.Akkapi
     [2] Pi
    
    Enter number: 2
    
    [info] Running Pi 
    
    	Pi approximation: 		3.1415926435897874
    	Calculation time: 	991.0
    [success] Total time: 4 s, completed 15 Mar, 2013 8:04:33 PM
    

    Value of PI : 3.1415926435897874

     
  • tuxdna 5:59 pm on March 10, 2013 Permalink | Reply  

    Attending Jamia Developer Day 

    Students at JMI University had organized JDevDay ( formerly CONF@JMI). This was a two day conference on FOSS topics. The agenda is listed here:

    https://jdevday.wordpress.com/2013/03/05/talks-in-jdevday/

    I spoke on “Introduction to Scala”, the slides of which are uploaded to slideshare and on github.

    It was so nice to meet all the speakers and attendees. I took a few photos which I have uploaded on flickr.

    JDevDay Rocks!

     
    • Waseem 3:04 am on March 11, 2013 Permalink | Reply

      This looks awesome! Alas! I did not attend. I was not aware of this “gathering”. What are the channels where its schedule was published.

  • tuxdna 5:41 pm on March 10, 2013 Permalink | Reply  

    Emacs Org Mode for creating and generating presenations 

    Last time I created a presentation in Org Mode was in 2010 here.

    Creating presentation in Emacs Org Mode and publishing it as Latex, PDF and HTML, is so awesome.

    Here are the links to get you started:

    And follow these simple steps ( I am using Ubuntu right now but the steps should be easy on Fedora too.):

    Create a slides.org file as in the tutorial above:

    Install Beamer class for Latex.
    $ sudo aptitude install aptitude latex-beamer

    And export it to PDF using “Ctrl+c Ctrl+e p” in Emacs.

    Your presentation is in slides.pdf in the same folder as slides.org.

     
  • tuxdna 9:49 am on February 22, 2013 Permalink | Reply
    Tags: agave,   

    Where the heck did agave go from Fedora 17 repos? Yes I am asking the same question already been asked in fedora forum [1].

    Apparently it doesn’t [2] have any maintainer hence no build for Fedora 17.

    [1] http://forums.fedoraforum.org/showthread.php?t=276162
    [2] https://admin.fedoraproject.org/pkgdb/acls/name/agave
    [3] http://home.gna.org/colorscheme/

     
    • Máirín Duffy 2:54 pm on February 25, 2013 Permalink | Reply

      Agave upstream has halted anyway. A better tool is called Gpick, we have it on the package maintainers wishlist but nobody has picked it up yet :(

    • tuxdna 3:13 pm on February 25, 2013 Permalink | Reply

      @Máirín Duffy:

      I just tried Gpick on Ubuntu, and yes, it is far ahead of Agave. A quick google gave me this pointer link, http://pfrields.fedorapeople.org/packages/SRPMS/gpick-0.2.3-1.fc14.src.rpm i.e. SRM is already available for Fedora – pfrields packaged it sometime back for fc14.

      Thanks! I will see to it over the weekend, if possible earlier for packaging in Fedora.

    • Zane 8:54 pm on February 27, 2013 Permalink | Reply

      I actually blog likewise and I’m authoring something
      alike to this excellent blog, “DNA of the TUX | Organized thoughts” godlessradio.
      . Do you really care in case I reallyutilize a lot of of
      your personal suggestions? Many thanks ,Cherie

  • tuxdna 3:44 pm on February 21, 2013 Permalink | Reply
    Tags: bdd, ,   

    SBT and Specs for BDD in Scala 

    I had used RSpec earlier for Behaviour Development Development for a Ruby on Rails project. Today I learnt how to do BDD in Scala.

    Chapter 4 of Programming Scala introduces Traits and Specs for testing the code. Here is how I set it up:

    I already had Scala installed. So the first step was to setup sbt ( Simple Build Tool for Scala ). Setup was easy ( described in detail here ):

    $ sudo yum localinstall http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt//0.12.2/sbt.rpm
    

    Then, I created a sample project which is hosted on github ( https://github.com/tuxdna/trait-with-sbt-spec ):

    $ git clone git://github.com/tuxdna/trait-with-sbt-spec.git
    $ cd trait-with-sbt-spec
    $ sbt test
    

    And here is the output

    ...
    [info] Compiling 9 Scala sources to ...
    [info] Compiling 4 Scala sources to ...
    [info] ButtonClickableObserverSpec
    [info] A Button Observer should
    [info]   + observer button clicks
    [info] ButtonObserverSpec
    [info] A Button Observer should
    [info]   + observe button clicks
    [info] ButtonClickableObserverVetoableSpec
    [info] A Button Observer with Vetoable Clicks should
    [info]   + observe only the first button click
    [info] ButtonObserverAnonSpec
    [info] A Button Observer should
    [info]   + observe button clicks
    [info] Passed: : Total 4, Failed 0, Errors 0, Passed 4, Skipped 0
    [success] Total time: 19 s, completed Feb 21, 2013 9:04:57 PM
    

    Setting up SBT was easy, only that it took some time to fetch the libraries from maven repos. Its configuration is very similar to Maven POM files. And then adding specification was only a matter of extending ‘Specification’ class.

    References:
    [1] http://examples.oreilly.com/9780596155964/README.html
    [2] http://www.scala-sbt.org/release/docs/Getting-Started/Setup
    [3] http://code.google.com/p/specs/wiki/QuickStart
    [4] http://www.scala-sbt.org/release/docs/Getting-Started/Library-Dependencies.html
    [5] http://twitter.github.com/scala_school/sbt.html

     
  • tuxdna 8:13 pm on February 20, 2013 Permalink | Reply
    Tags: frameworks, mesos, spark   

    Apache Mesos – incubator project; and Spark Project 

    Apache Mesos, written primarily in C++ is a cluster resource allocation framework. It is used by the Spark Project ( majority of Spark project is written in Scala ).

    Apache Mesos – http://incubator.apache.org/mesos/
    Spark Project – http://spark-project.org/
    Tech Talk: Matei Zaharia (UC Berkeley) — “Spark: A Framework for Iterative and Interactive Cluster Computing” – http://vimeo.com/20757432

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
Follow

Get every new post delivered to your Inbox.