Monday, October 24, 2016

Setting up rocketchat on a UBUNTU 16.04 server

Steps to install on UBUNTU 16.04

1.     Perform the basic install of Unbutu 16.04 server.
Using the default drive sizing settings etc are probably fine, especially if you are testing this.

         Set an appropriate username (ex.  Administrator)
         Set the appropriate country
         Set the appropriate timezone
         Set Hostname (ex Rocketchat)

2.     When installation is completed, server will reboot.

3.     Log into the server and reboot the box again (Weird Ubuntu thing I’ve encountered in the past)
Reboot [enter]

4.     Box restarts, log in and do the following:

5.     sudo apt-get update
6.     sudo apt-get dist-upgrade
(this will take 30 minutes probably)

7.     sudo snap install rocketchat-server
8.    reboot

9.     If you want to hardcode an IP,  eetup IP address by editing the file:  /etc/network/interfaces/
iface eth0 inet static
address x.x.x.x
netmask x.x.x.x
gateway x.x.x.x

10.  Save your changes
11.  Reboot

By default RocketChat uses port 3000 so, if you want to forward standard :80 port, you can do it with this in UBUNTU with this following commands

sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 3000
sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000

Done!  You should now be, by default, http://IPofYourServer:3000 and be prompted by a rocketchat webpage.
Register as a new user, this user will automatically become the Administrator user.
You can go in an resign this permission to other users, so its not permanent.

Should you wish to update it.  These commands will help:

"snap find rocketchat-server" will pull the SNAP repository for the latest version.

"sudo snap refresh rocketchat-server" will update your version to the latest.  Takes a minute or so usually to download, the upgrade is under a minute and users probably will just see some "reconnecting" indications if they are logged in, but usually only takes 10-20 seconds for the service to restart.  Everyone will automatically log back in.

If running the above sudo command gives you an error similar to the following:
bla bla bla assumes unsupported features: snapd2.23 

Try the following command:

sudo apt update sudo apt install snapd

The re-run the snap find/snap refresh commands again. You should be good to go.

Friday, October 21, 2016

Aligning two sets of data in excel with each other

Here is how to align two sets of data in excel each set containing multiple rows, but only one common element between the two to use as a 'key'.

In this example the BLUE and RED need to be aligned, the common element being the 4 digit number.

Example 1

With the code further below, the data will look something like this when merged, the red data now aligned with the blue data.



The data circled above in RED, ( C,D & E ) is now aligned with column A & B in example 2, with all the rows data maintaining their relevant position as well.

Here's some Excel magic.

  1. First make sure the common data of the two sheets are in the proper columns.  In the BLUE data, which contains the majority of the values, i put the 4 digit number on the right.
    The RED data, which is the lesser data for this example, I put on the LEFT
  2. First selected the the data that you want to align.  (the stuff in RED in my example) and move it to a new tab in the Excel document.

  3. In the new tab you created, make sure the data is selected
  4. In the name box (circled in red below) type in "MyData" in that box.  This gives that selected data a name now.



Now go back to the original tab that contains the data circled in Blue.
Were now going to have Excel look at 4 digit in column B (circled in BLUE) and pull data from "MyData" and merge it.

So, click on an empty column.  I've clicked on column "C" in my example.  Since I have columns to match, I'm going to do the code in 3 different columns

Assuming that in the blue data, the data is in the second column we would use the following code.
If it were in the first column, you would use $a1 and if it was in the 3rd you would use $a3
In Cell C1 put in:
=vlookup($b1,MyData,1,false)

Cell D1
=vlookup($b1,MyData,2,false)

Cell E1
vlookup($b1,MyData,3,false)

Like this:


Depending on the matches, you may see data appear or see #N/A, which indicates no match.


Selected the 3 boxes, then auto filled the boxes below with the formula.

All the data is aligned now.  The boxes that have no matches show "#N/A" in excel.

Monday, October 3, 2016

Tether an iPhone to router for Internet access

Scenario:
The ISP providing internet to your office/home network (wired and wireless) is unavailable and you need internet to work again.  The method described here will allow you to have multiple connections through your iPhone's data plan using your existing SOHO router.

To use your iPhone with your router, you will need to utilize a computer that will host the connection between your iPhone and your router.  You can still use this machine for internet access, however it will have limited access to your LAN resources since it is 'outside' the network.




(Mobile Network Data) <-> iPhone <-> Host Computer <-> Router <-> (wired/wireless LAN)
  1. On the host computer, (tested on windows 7 and 10), plug your iPhone into it with the USB cable.
  2. Enable Personal Hotspot
  3. When prompted with this message, select USB ONLY
  4. After 30 secs or so, windows SHOULD recognize this as a device in your computer network settings.
  5. Now select the "Apple Mobile Device Ethernet", hold down the CTRL key and click on the Local Area Connection that coincides with the Ethernet port of your host computer.

  6. Right click on this and then select BRIDGE CONNECTIONS.  You'll see this message appear.
  7. Then you'll see a new network device show up....
  8. Give it a minute or so, but eventually you'll see this:
  9. You'll see the new Ethernet device show up as "iPhone"
  10. (On the host computer, you'll see that the iPhone has provided the new "Ethernet 2" connection an IP of 172.20.10.2, and the iPhone itself has the ip of 172.20.10.1  )

  11. Now plug in the host computer into your router's "WAN" port
  12. Depending on the router model/design, you may have some due diligence to allow it to accept this new connection.  The router has to obtain a proper WAN side ip, in our example, it would be an IP of 172.20.10.X


Once your router has obtained the IP from the host computer/iPhone bridge, then your machines that are connected to this router through a wired and/or wireless connection will now have internet access.

Your router LAN IP structure will stay exactly the same, so all your local users should still have access to the same local resources they are used to.  The router will automatically make the internet available to these users.

Remember, all these machines will be using your data plan, so be cautious of usage!