Saturday, August 27, 2016

Ordinary User and WinSCP on Ubunut 14.04

WinSCP is a creature comfort. Transferring of files is a breeze but nowadays "root" isn't allowed to login and requires "sudo" which you can't run since the app is GUI and not terminal. There is a solution: SFTP and some settings that need to be changed.

Procedure:
  1. Edit sudoer and add this line "<user> ALL=NOPASSWD: /usr/lib/openssh/sftp-server".
  2. Go to WinSCP and edit your connection. Select SFTP, click "Advanced", look for the SFTP setting page and put this in: "sudo /usr/lib/openssh/sftp-server"
Note: check the actual directory of the file. It may be stored somewhere else

Here is another option



Ubuntu 14.04 and Laravel on Apache

Here is the fastest and straight forward guide to setup Ubuntu 14.04 with Apache-Laravel

https://www.howtoforge.com/tutorial/install-laravel-on-ubuntu-for-apache/

That's about it. :)

Saturday, August 20, 2016

SQL Server Connection from Ubuntu 14.04 and SQL Server using FreeTDS

So, everything is installed properly and it is time to test database connection to SQL Server. Here are some of my pointers:


  • Install FreeTDS and PHP with support for Sybase/SQL Server
  • Configure "odbcinst.conf"
[FreeTDS]
Description = FreeTDS Driver v0.91
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
fileusage = 1
dontdlclose = 1
UsageCount = 1
Note: just change to the correct path on the two modules
  • Configure "freetds.conf
[database_server_name]
host = 192.168.101.102
port = 1433
tds version = 4.2
client charset = UTF-8
Note: "database_name" is NOT the instance

  •  Configure "odbc.ini"

[jiradb]
Driver = FreeTDS
Servername = database_name_name
Port = 1433
Database = database_under_instance
TDS_Version = 4.2
Notes:

    • "Driver" field is the name header in "odbcinst.conf"
    • "Servername" field is the database header in "freetds.conf"
    • "Database" field is the target database under the instance
    • TDS_Version - run the command "tsql -C" and you should get the value
To connect:
isql database_server_name -U sa -P password
This is not a complete guide. Be sure to check the links below for further info.





SQL Server Connection from Ubuntu 14.04 and SQL Server using FreeTDS

So, everything is installed properly and it is time to test database connection to SQL Server. Here are some of my pointers:


  • Install FreeTDS and PHP with support for Sybase/SQL Server
  • Configure "odbcinst.conf"
[FreeTDS]
Description = FreeTDS Driver v0.91
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
fileusage = 1
dontdlclose = 1
UsageCount = 1
Note: just change to the correct path on the two modules
  • Configure "freetds.conf
[database_server_name]
host = 192.168.101.102
port = 1433
tds version = 4.2
client charset = UTF-8
Note: "database_name" is NOT the instance

  •  Configure "odbc.ini"

[jiradb]
Driver = FreeTDS
Servername = database_name_name
Port = 1433
Database = database_under_instance
TDS_Version = 4.2
Notes:

    • "Driver" field is the name header in "odbcinst.conf"
    • "Servername" field is the database header in "freetds.conf"
    • "Database" field is the target database under the instance
    • TDS_Version - run the command "tsql -C" and you should get the value
To connect:
isql database_server_name -U sa -P password
This is not a complete guide. Be sure to check the links below for further info.





Saturday, August 13, 2016

Error Connecting to pfSense 2.3 using Putty

I forgot got the error and simply updating your "putty.exe" to the latest fixed the problem. Here are some pointers as well:

"Couldn't agree a key exchange algorithm (available: curve25519-sha256@libssh.org"


  • Firewall rule(s)
  • NAT/port forward rule(s)
  • Gateway - well, quite far but I was doing a port forward of RDP for several hours that my target host gateway uses a different firewall :(

I'll update this post once I get to remember what particular error I encountered.


Error Connecting to pfSense 2.3 using Putty

I forgot got the error and simply updating your "putty.exe" to the latest (Release 0.67) fixed the problem. Here are some pointers as well:


"Couldn't agree a key exchange algorithm (available: curve25519-sha256@libssh.org"
  • Firewall rule(s)
  • NAT/port forward rule(s)
  • Gateway - well, quite far but I was doing a port forward of RDP for several hours that my target host gateway uses a different firewall :(

I'll update this post once I get to remember what particular error I encountered.


JIRA on AWS EC2 t2.micro

Finally, we were able to setup a demo of JIRA on AWS EC2 t2.micro.  Initially, it crashed due to insufficient memory...

The solution: instead of upgrading the instance type, just add SWAP :)


  1. Create a new EBS volume
  2. Attached it to the EC2 instance
  3. Start the instance and configure the new storage to be swap/swap file

Disk /dev/xvdg: 1073 MB, 1073741824 bytes

139 heads, 8 sectors/track, 1885 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfc4b3755

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdg1            2048     2097151     1047552   82  Linux swap / Solaris

ubuntu@iemijira:/$ free -h
             total       used       free     shared    buffers     cached
Mem:          992M       914M        78M        16K       2.2M        25M
-/+ buffers/cache:       886M       106M
Swap:         1.0G        12M       1.0G

Not sure when will I update this one :)

JIRA on AWS EC2 t2.micro

Finally, we were able to setup a demo of JIRA on AWS EC2 t2.micro.  Initially, it crashed due to insufficient memory...

The solution: instead of upgrading the instance type, just add SWAP :)
  1. Create a new EBS volume
  2. Attached it to the EC2 instance
  3. Start the instance and configure the new storage to be swap/swap file

Disk /dev/xvdg: 1073 MB, 1073741824 bytes

139 heads, 8 sectors/track, 1885 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfc4b3755

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdg1            2048     2097151     1047552   82  Linux swap / Solaris

ubuntu@iemijira:/$ free -h
             total       used       free     shared    buffers     cached
Mem:          992M       914M        78M        16K       2.2M        25M
-/+ buffers/cache:       886M       106M
Swap:         1.0G        12M       1.0G