Configuring App Transport Security Exceptions in iOS 9 and OSX 10.11

Steven Peterson

What is App Transport Security (ATS)?

At WWDC 2015, Apple announced “App Transport Security” for iOS 9 and OSX 10.11 El Capitan. The “What’s New in iOS” guide for iOS 9 explains:

App Transport Security (ATS) lets an app add a declaration to its Info.plist file that specifies the domains with which it needs secure communication. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.

If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible.

In simple terms, this means that if your application attempts to connect to any HTTP server…

View original post 549 more words

Posted in Uncategorized | Leave a comment

Mass download of files via wget

A couple of days ago Eric Ligman, Microsoft Director of Sales Excellence had posted on the give away of free Microsoft eBooks. The list of eBook for give away is indeed long and in this post, I will be teaching you how to download them all with just two commands in linux.

The first command download the list of free ebook, the second command visit each of the link in the txt file and download them and save it as the name given from the server. Without the “–content-disposition –trust-server-names” option, the file will simply be save as the last portion of the url.


wget <a href="http://www.mssmallbiz.com/ericligman/Key_Shorts/MSFTFreeEbooks.txt">http://www.mssmallbiz.com/eri…/Key_Shorts/MSFTFreeEbooks.txt</a>
wget --content-disposition --trust-server-names -i MSFTFreeEbooks.txt

You may visit the original link from Eric Ligman here

Lastly this guide won’t be possible without help of unix stackexchange

Posted in Uncategorized | Tagged , , | Leave a comment

Creating Jar for JavaFX Application

This is a step by step guide to creating a Jar for a JavaFX Application using IntelliJ IDEA. It is only tested on IntelliJ IDEA 2016 with Java8. Steps might be slightly different for Java7.

First, open up File > Project Structure.

Next click on Artifacts as shown below.

step1

Next click on the plus icon to add a Jar From modules with dependencies… as shown.

step2

Once the above step is completed, the below pop-up will be shown. Select your main class. This will be the class that is accessed when your app launches. It is typically Main.java or something similar. Click OK twice to exit the pop-up and Project Structure.

step3

Now to generate the jar file, go to Build > Build Artifacts…

step4

Once you clicked on the Build Artifacts, the below will be shown, select Build for the Action. Once clicked, the jar will be generated in the folder /out/artifacts/ and you can run the jar file directly from it.

step5

Posted in Java, JavaFX | Tagged , , | Leave a comment

JavaFX load data on launch

To load data on launch for a JavaFX app, you would simply need the following in your Controller.

The initialize method is the first piece of code that is run when you launch the JavaFX app.

@FXML
protected void initialize() {
    System.out.println(&quot;launched&quot;);
    //load data here...
}
Posted in Java, JavaFX | Tagged , | Leave a comment

Installing mysql on Raspberry Pi

In this post, I will go through how to install mysql on Raspberry Pi 2. Installing mysql is much simpler than installing Apache Tomcat as it can be done via apt-get


sudo apt-get install mysql-server

During the setup, you would be prompted to set a password for your sql server. Do remember the password that you had set as you would need that later.

After the setup is complete, you may access the mysql server with the password above by typing the following.

mysql -u root -p

[Updated 25 July 2016]

I had forgotten an important step during my initial post.

It is important to do the below as well to ensure that you have the mysql-connector, without this you will run into jdbc driver error.


sudo apt-get install libmysql-java

Posted in mysql, Raspberry Pi | Tagged , , , , | Leave a comment

Installing Apache Tomcat on Raspberry Pi

In this post, I will be documenting the process of running Apache Tomcat on Raspberry Pi 2.

Before we start installing Tomcat, it would be good to do a update.

sudo apt-get update

After the update, verify that you have java 8 installed. At this stage if everything is going correctly, you should already have java 8 installed.

java -version

Now we will start downloading Apache Tomcat via wget

cd /opt
wget http://www.us.apache.org/dist/tomcat/tomcat-9/v9.0.0.M8/bin/apache-tomcat-9.0.0.M8.tar.gz
tar xzf apache-tomcat-9.0.0.M8.tar.gz
mv apache-tomcat-9.0.0.M8 tomcat9

Now that tomcat is downloaded and extracted from the zip to the respective location. Before we process to the next step, we need to get bash on evaluated permission by typing the below

sudo bash

With that, we could proceed to set the environment variable.

echo 'export CATALINA_HOME='/opt/tomcat9'' &gt;&gt; /etc/environment
echo 'export JAVA_HOME='/usr/lib/jvm/java-8-oracle'' &gt;&gt; /etc/environment
echo 'export JRE_HOME='/usr/lib/jvm/java-8-oracle/jre'' &gt;&gt; /etc/environment
source ~/.bashrc

Next we will need to perform a set up of the various user accounts for using the gui management.

You would have to go to conf/tomcat-users.xml  and added in the below. Replace _SECRET_PASSWORD_ with your secured password.

<pre><!-- user manager can access only manager section -->
<role rolename="manager-gui" />
<user username="manager" password="_SECRET_PASSWORD_" roles="manager-gui" />

<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui" />
<user username="admin" password="_SECRET_PASSWORD_" roles="manager-gui,admin-gui" /></pre>

Once that is done, you could launch tomcat by doing the below

cd /opt/tomcat9
./bin/startup.sh

You should now see something like

Using CATALINE_BASE: /opt/tomcat9
Using CATALINE_HOME: /opt/tomcat9
...

Verify that tomcat is running by going to the browser and point to http://localhost:8080

It is also important to go into /conf/server.xml to change the port that tomcat listen to from 8080 to 80 if that is what you requires on your client side.

References used

How to Install Tomcat 9 (Alpha) on Ubuntu, Debian & LinuxMint

Bash evaluated permission

Posted in apache tomcat, Raspberry Pi | Tagged , , , , , | Leave a comment

Setup VNC server on Raspberry Pi

In this post, I will go through with you on how to setup vnc server on the Raspberry Pi. While the Raspberry Pi has a full HDMI port for output, it might be more convenient to access it remotely via ssh or if you would like a graphical interface, you would need to install a virtual network connection (vnc) server.

TightVNC is a good option and I will be using it.

To install TightVNC, head over to the terminal on your Pi and use the below command. You would be prompted to set a password. The password would be required when you are accessing it.


sudo apt-get install tightvncserver

Once it is installed, you might launch it by the below.


tightvncserver

Start a new session by typing the below


vncserver :1

To access the screen on macOS, go to Finder and press Cmd + K. The server address would be vnc://raspberrypi.local:5901

If you are having problem accessing it, replace “raspberrypi.local” with the pi ip address. 5901 refers to the port number being used and it typically start from 5900.

For example if you start a session by vncserver :2, then the port number to use would be 5902.

The next step is very important because you would want the tightvncserver to launch right after booting up your Pi. Otherwise the whole point of setting up the vnc server is pointless.

Now you would have to go over to /etc and edit the the “rc.local” file. This is the file that is executed during booting up.

Simply adding in the below code before the “exit 0”


# Start tightvncserver

su - pi -c /'usr/bin/tightvncserver :1'

This command switches user to be the ‘pi’ user with su – pi. The su stands for ‘switch user’ the dash (-) makes sure that the user pi’s environment (like all their settings) are used correctly and pi is the user.

The -c option declares that the next piece of the line is going to be the command that will be run and the part inside the quote marks (‘/usr/bin/tightvncserver :1’) is the command.

The command in this case executes the file tightvncserver which is in the /usr/bin directory and it specifies that we should start desktop session 1 (:1).

After this, you should see that the tightvncserver is automatically running after a reboot or start up.

 

Reference used:

raspberry stackexchange-auto starting vnc
raspberry stackexchange-port

Posted in Raspberry Pi | Tagged , , , , | Leave a comment