UBNT EdgeRouter X – Configure OpenVPN + SmartDNS from Expressvpn

January 9, 2018  |  networking  |  , , , , , , ,  |  No Comments  |  Share

if you are like me, and content you surf is localized, you will get frustrated soon, you will opt for VPN, proxies and smart DNS, what I am going to share below is a specific setting, for my router which is UBNT EdgeRouter X 5 Port.

1. SCP/SFTP >> file into router my_expressvpn_anycountry_-_any_city_udp.ovpn, you will find this from expressvpn.
2. You need to ssh into the router,
3. Create a file in /config/auth/user-pass.txt, enter username on the first line and password on second, you will get these from expressVPN
4. Edit .ovpn file you just copied over with either vi or nano,
5. Insert “/config/auth/user-pass.txt” in front of auth-user-pass and below that write route-nopull
6. In router shell type configure,
7. execute these:

 

set interfaces openvpn vtun0 config-file /config/auth/my_expressvpn_anycountry_-_and_city_udp.ovpn
set interfaces openvpn vtun0 description 'ExpressVPN'

set firewall modify express_vpn_route rule 10 description 'ExpressVPN'
set firewall modify express_vpn_route rule 10 source address 192.168.0.0/32
set firewall modify express_vpn_route rule 10 modify table 1

set protocols static table 1 interface-route 0.0.0.0/0 next-hop-interface vtun0

set interfaces switch switch0 firewall in modify express_vpn_route

set service nat rule 5001 description 'ExpressVPN'
set service nat rule 5001 log disable
set service nat rule 5001 outbound-interface vtun0
set service nat rule 5001 type masquerade

NOTICE:set firewall modify express_vpn_route rule 10 source address 192.168.0.0/32
it first suggested in this post, where I found this part from, suggested to send one ip to to vpn, where as my plan was to send everything in my router through vpn, so I wrote 0.

8. type in commit press enter and then type in save and press enter.
9. we need to change DNS so that every DNS query goes through expressVPN, so go to DHCP services in Router and type DNS 1 and DNS 2 as told by expressVPN in media streamer support page.

and you are done.
it seems to work with my every device, be it chromecast, or smart tv and streaming paid websites.

Hybris Cluster Deployment: The One-Stop Guide

December 5, 2017  |  Hybris  |  , , ,  |  No Comments  |  Share

to my surprise something so powerful and in demand, had to be searched so much, information is fragmented and outdated,

I have chosen to host this cluster on AWS. for now this article will assume you have basic knowledge of hybris and its architecture, later if I find time I will provide more details, which I will brush over right now.

prep the system by uploading Hybris version 6.5 on it, write down b2c extensions in localextensions.xml and in local.properties copy down the below settings

clustermode=true
cluster.id=0 # change for each node
cluster.broadcast.method=jgroups

cluster.broadcast.method.jgroups=de.hybris.platform.cluster.jgroups.JGroupsBroadcastMethod
cluster.broadcast.method.jgroups.tcp.bind_addr=aws.private.ip*************************
cluster.broadcast.method.jgroups.tcp.bind_port=7800
cluster.broadcast.method.jgroups.channel.name=hybris-broadcast
cluster.broadcast.method.jgroups.configuration=jgroups-tcp.xml

next step is in platform folder; make a file

jgroups-tcp.xml

exec ant command start the server + init.

go in cluster page check if nodes are showing up. once a proper instance is configured make an ami of it and take the cluster.id and from environment cluster.broadcast.method.jgroups.tcp.bind_addr and http://169.254.169.254/meta-data(link) could be used for auto-scaling it requires two parameters which cluster.id and ip which can be automated.

for deploying cluster in udp unicast method; use below config in local.properties files;
———————–
clustermode=true
cluster.nodes.autodiscovery=true #if enabled, you wont have to explicitly define cluster node id.
cluster.broadcast.methods=unicast
cluster.broadcast.method.unicast.serveraddress=aws.private.ip
cluster.broadcast.method.unicast.port=9997 #needs to be same in all clusters
cluster.broadcast.method.unicast.clusternodes= this-node-private-ip:with-above port ; other-node-private-ip:with-same-port ;
cluster.broadcast.method.unicast.sync.nodes.interval=1 #anything below, will not sync.
———————–

thats it. what I realized it if your cluster is going to handle a blackfriday load, you are better of with jgroups as its faster, but for normal node 3 nodes in unicast with load balancer would suffice. once could use multiple cluster with multiple groups each having there own work load like for example one cluster group handles storefront and 2nd cluster group handles backend activities like cornJobs and indexing, and third cluster group handles backoffice/admin. but it raises a question does not installing those extension on other cluster group create db problems for example if storefront extension is not available in cluster group 3 will it create problem in database models, I feel it should not until and unless some custom extension is deployed, will have to test thoroughly. and to better understand the difference between different clustering method, I plan on running detailed jmeter load test, will publish my results soon with test case.

################
log4j.logger.de.hybris.platform.cluster.PingBroadcastHandler=DEBUG
## add above for debugging.

change the required settings of session as required if nodes in cluster require session replication or you could use few of your nodes for storefront and other nodes with no session replication for back office. I have seen this happen, for example one node is for consumers and others for back office/admin. so consumer one will have extensions related to him and not of back office, and vice versa for back office node. so when load hits just let auto-scaling handle the consumer end nodes.

as I find time I will try to keep this post updated and differentiate in parts, and explain further.

nas4free embedded: auto mount samba share on boot

nas4free embedded: auto mount samba share on boot

October 26, 2017  |  FreeBSD/NAS4Free, NAS Server  |  No Comments  |  Share

Nas4Free Embedded, is the most fault tolerant version for nas4free, but it has a downside; changes are not persistent. like, for example, I required my other samba shares to be mounted on nas4free embedded on boot  so what I did was; placed the below script in command script GUI page placed “.nsmbrc” on share drive named prime – which had the password so it does not get prompted during boot for password and kept the mount folder inside share also, obviously that folder inside share named “SHARENAME” will not be accessible by the network, but it was the only place persistent, we can also extend the command script to make the folder in /mnt.

 

cp -vr /mnt/prime/mise/.nsmbrc /root/.nsmbrc && sudo mount_smbfs -N -I 10.0.0.2 //username@NETBIOSNAME/SHARENAME /mnt/prime/SHARENAME/

below is what I wrote in .nsmbrc

[NETBIOSNAME]
addr=10.0.0.2

 
 
[NETBIOSNAME:USERNAME]
password=abc123

 

** CAPITAL letters are used to stress case-sensitivity.

reason for writing this was people were having trouble on automount on boot on nas4free embedded because anything changes in fstab on boot will be purged.

format and flags used in .nsmbrc
http://web.mit.edu/freebsd/head/contrib/smbfs/examples/dot.nsmbrc

Jenkins Docker Container With Its Own Host Docker Support

October 25, 2017  |  Container, Jenkins  |  , , ,  |  No Comments  |  Share

I call it, Docker-Jenkins-Inside-Docker;

What it does is; creates a container of ubuntu 16.04, mounts -v /var/run/docker.sock:/var/run/docker.sock from host into container, install Docker.io, Jenkins exposes 8080 port starts Jenkins and lands one, inside with bash so one can check the init password and set up Jenkins, now when times comes to do continuous integrations and deployments, we can pull in separate docker containers and perform those automate builds(java) in those Docker containers, isolate jobs in Docker containers.

Github
https://github.com/kazimurtaza/docker-jenkins-inside-docker
Hub Docker
https://hub.docker.com/r/kazimurtaza/docker-jenkins-inside-docker/

interesting article;
https://engineering.riotgames.com/news/thinking-inside-container

Installation trouble of deluge on nas4free/FreeBSD 9.2/9.1

Hello everbody,

if you are trying to install deluge on a FreeBSD / Nas4Free 9.2 (FreeBSD 9.2-RELEASE-p3 (kern.osreldate: 902001) (9.2.0.1 – Shigawire (revision 943))).
and goal is to run the most current version of deluge in a console only / WebUI fashion. And you do not want to run the application inside a jail. During the installation you will run into trouble as detailed below. The installation does not seem to go through properly.

This is what the outputs looks like:

pkg_add -r deluge >& install.log:

1
2
pkg_add: command '/usr/bin/printf '1a\n./deluge-1.3.6-py2.7.egg\n.\nw\nq\n' |  /bin/ed /usr/local/lib/python2.7/site-packages/easy-install.pth' failed
Done.

deluged -L error -l firststartlog.log >& firststart.out:
firststartlog.log was empty
firststart.out:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[ERROR   ] 10:55:34 main:237 No module named zope.interface
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/main.py", line 229, in start_daemon
from deluge.core.daemon import Daemon
File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/core/daemon.py", line 39, in <module>
from twisted.internet import reactor
File "/usr/local/lib/python2.7/site-packages/twisted/internet/reactor.py", line 37, in <module>
from twisted.internet import default
File "/usr/local/lib/python2.7/site-packages/twisted/internet/default.py", line 56, in <module>
install = _getInstallFunction(platform)
File "/usr/local/lib/python2.7/site-packages/twisted/internet/default.py", line 52, in _getInstallFunction
from twisted.internet.selectreactor import install
File "/usr/local/lib/python2.7/site-packages/twisted/internet/selectreactor.py", line 14, in <module>
from zope.interface import implements
ImportError: No module named zope.interface

Then try  “easy_install zope.interface” 

But now trying to start the deluge-web fails: “deluge-web >& deluge-web.out”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Traceback (most recent call last):
File "/usr/local/bin/deluge-web", line 9, in <module>
load_entry_point('deluge==1.3.6', 'console_scripts', 'deluge-web')()
File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/ui/web/web.py", line 138, in start
web.start()
File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/ui/web/web.py", line 107, in start
import server
File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/ui/web/server.py", line 59, in <module>
from deluge.ui.web.auth import Auth
File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/ui/web/auth.py", line 61, in <module>
from deluge.ui.web.json_api import JSONComponent, export
File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/ui/web/json_api.py", line 60, in <module>
from deluge.ui.web.common import _, compress
File "/usr/local/lib/python2.7/site-packages/deluge-1.3.6-py2.7.egg/deluge/ui/web/common.py", line 38, in <module>
from mako.template import Template as MakoTemplate
ImportError: No module named mako.template

Try “easy_install mako.template” 

this should fix the problems and deluge should start working again.

 

DIY: 3 PC-USB KVM

IMG_20130908_121553

IMG_20130908_121217

IMG_20130908_121210

IMG_20130908_121203

 

 

 

 

 

 

 

 

 

 

 

 

 

Hello again,

The trouble, I was facing when I made this was that, I was using three machines together so that means 3 keyboards and 3 mouse, well 2 mouse one of those machines was console based, and I didn’t had much space on my table it was getting much hectic managing all the keyboards and mouses. And KVM’s in market I found were quiet expensive. so the solution was quiet simple and cheap; I took 8 small relays, cut-out of vero board, two toggle buttons, one usb-female for wireless RF receiver of Keyboard and Mouse and 3 usb-male for 3 machines and Altoids box to fit it all in.

I powered it externally, do not use usb to from machine to power the relays, it could fry your usb controller hub in machine. so two toggle switches meant;

 

00, 01, 11, 10

 

concept was quiet simple usb has 4 wires 2 of them are for power and 2 in center for data .. I distributed them, on toggle the connection of wires changed from one usb-male to another .. Sharing one wireless keyboard and mouse with 3 machines.

Kinect Car

 

 

De’Ranged Bot from Kazi Murtaza.

My FYP, just started

hello hi, as this is my final semester in my university Szabist doing Bs-Computing, and my final year project is Autonomous Obstacle Detection And Avoidance on Scaled Car Model, yes its a mouth full,
my objective is;

  • Navigating System, which controls the car for autonomous obstacle avoidance
  • System, Flexible enough to be implementing on other robots, or future projects.

Using state of art Technology Like; Kinect for computer vision, micro controllers  like; Raspberry Pi, Netduino and Arduino this could never be easier, achieving this goal is challenging but possible, this will be an interesting project at least. My basic draft concept at this point is;  a robot using four-wheeled, deferentially steered, The base of the robot is almost rectangular, The robot is equipped with two batteries, each 30 Ah 12 V, supplying the robot and the Kinect sensor with power. Besides the Kinect sensor, the robot is also equipped with range sensors. Four analogous SHARP IR sensors, GP2Y0A21YK, two placed in the robot’s direction of heading and the other two pointing in the opposite direction. In addition, the robot is equipped with two digital ultrasonic Maxsonar EZ1 from MaxBotix pointing forward. The IR and ultrasonic sensors are used for emergency situations only, bypassing the navigation system by braking the motors in case the risk of collision is imminent. The robot is equipped with four microcontrollers. Two of the microcontrollers read wheel encoder values and control the rotational speed of the two motors. The third microcontroller controls the power supply and monitors the charging of the batteries. The fourth microcontroller handles communication between the other controllers as well as processing of sensor input from the IR and ultrasonic sensors. It also handles the communication between the robot and the laptop running the navigation system. The robot and the Kinect sensor are connected via USB to the laptop placed on top of the robot.

So far what I have achieved is installed Kinect on my Machine for testing the steps I followed were listed at this site here; but I guess the steps were not updated and there is difference at some points, which I will list down below.

Step 0

Uninstall any previews drivers, such as CLNUI. Look at the end of this post if you want to see how you can have multiple drivers installed.

Step 1

  • Download Kinect Drivers and unzip.
  • Open the unzipped folder and navigate to Platform/Win32/Driver.
  • Run dpinst-x86.exe (if you have a 32-bit processor) or dpinst-amd64.exe (if you have a 64-bit processor).

Step 2

Download and install the latest stable or unstable OpenNI Binaries from OpenNI website.

the link in step is a 404 and you should go and install OPENNI SDK v1.5.4.0 from here

Step 3

Download and install the latest stable or unstable OpenNI Compliant Middleware Binaries (NITE) from OpenNI website.

again the is 404 and you should go and install NiTE v1.5.2.2.1 from here (scroll to bottom of the page you will see), guide also stated that it will require a PrimeSense key: 0KOIk2JeIBYClPWVnMoRKn5cdY4= , which it did not.

Step 4

Download and install the latest stable or unstable OpenNI Compliant Hardware Binaries from OpenNI website.
Both stable and unstable releases have worked for me. If you have trouble installing the unstable releases, just try the stable ones.

again 404, go here and install OpenNI-Compliant Sensor Driver v5.1.2.1

Step 5

  • Plug in your Kinect device and connect its USB port with your PC.
  • Wait until the driver software is found and applied.
  • Navigate to the Device Manager (Control Panel). You should see something like the following:

Kinect in the Device Manager window
You are nearly done.below steps were accurate;

Step 6

  • Download the KinectXMLs file and unzip. The extracted folders contain totally four XML files which are going to replace the ones OpenNI installed (the XMLs I provide simply contain the license key and the correct Kinect camera resolution).
  • Navigate to KinectXMLs\OpenNI folder and copy the SampleConfig.xml file. Navigate to C:\Program Files\OpenNI\Data (if you have a 32-bit processor) or C:\Program Files (x86)\OpenNI\Data (if you have a 64-bit processor) and replace SampleConfig.xml with the one you copied.
  • Navigate to KinectXMLs\NITE folder and copy the Sample-Scene.xml, Sample-Tracking.xml and Sample-User.xml files. Navigate to C:\Program Files\Prime Sense\NITE\Data (if you have a 32-bit processor) or C:\Program Files (x86)\Prime Sense\NITE\Data (if you have a 64-bit processor) and replace Sample-Scene.xml, Sample-Tracking.xml and Sample-User.xml with the ones you copied.

Step 7

Navigate to C:\Program Files\OpenNI\Samples\Bin\Release (or C:\Program Files (x86)\OpenNI\Samples\Bin\Release) and try out the existing demo applications. Try the demos found in C:\Program Files\Prime Sense\NITE\Samples\Bin\Release (or C:\Program Files (x86)\Prime Sense\NITE\Samples\Bin\Release), too. If they work properly, then you are done! Congratulations!

If they do not work, make sure that you have replaced the XML files I mentioned in step 5 with the ones I provided you. If the demos still do not work, try installing the stable version of OpenNI, middleware and hardware binaries. Personally, I have successfully installed OpenNI and NITE (both stable and unstable releases) in a 32-bit desktop and a 64-bit laptop following the methodology I described.

Step 8

You have successfully installed Kinect in your Windows PC! Read the documentation and familiarize yourself with the OpenNI and NITE API. You’ll find the proper assemblies in:

  • C:\Program Files\OpenNI\Bin (or C:\Program Files (x86)\OpenNI\Bin) and
  • C:\Program Files\Prime Sense\NITE\Bin (or C:\Program Files (x86)\Prime Sense\NITE\Bin)

OpenNI is the primary assembly you’ll need when developing Natural User Interfaces applications.

C# tutorials on using the managed OpenNI.net libraries coming soon! Stay tuned in this blog.

 
Original credit goes to, Software Developer Vangos Pterneas, a student of the Athens University of Economics and Business, Department of Informatics. This guide and any associated source codes and files is licensed under The Code Project website and also under the Code Project Open License. I wish to share this article to educate the Kinect community on how to install the Kinect to their Personal Computers. By doing so, we would like to advocate and promote the development of programs by developers worldwide.

Meme.pk – Meme Pakistan

February 2, 2013  |  Software  |  , , , ,  |  No Comments  |  Share
Scroll to Infinte

Scroll to Infinte

Meme.Pk – Meme Pakistan; channel for all local memes, want to know you memes ?, I made this just because I could ROFL, actually no there are many Facebook pages out there for this sorta thing but not really a proper channel, so I came up with this pinterest type theme, with basic interface   and endless scrolling* website, where one could collect,share,like and comment, its first version is up and ready, currently I am in search of some one who could help me maintain it, as it requires a lot of time, and I was planning to open meme submission and newsletters. if you find your self on meme.pk’s Facebook Page, do like it, would appreciate all the support I get..

Cloud Ftp Client

February 2, 2013  |  Software  |  , , , ,  |  No Comments  |  Share
after login

In Action

Cloud Ftp Client, is basically web-based FTP client written in Jquery and PHP.  I made this, keeping in mind of those tricky situations when you need it and not have it, and those where your hosting is providing a lame file explorer, or when you need to transfer files to your web hosting account or any other remote server, and you are using computers at some other place, where you do not have desktop FTP client installed, this could help you there. Although this is still in alpha mode, its ready with basic features, I am thinking of new features to add when I find some time; for now it supports one ftp account, it does not save any login details, traverses through directories,display’s current PWD, make new folders, make directory, move it, copy it and delete it.