Correctly switch between 2 Column and 1 Column grid on iPhone Landscape/Portrait mode

I had been designing a website with 4 banner that each takes col-md-3 for desktop-sized screen and takes col-xs-12 on portrait mode on the iPhone.

//screenshot will be added in a short moment.

It turned out that it looks horrible on landscape mode as the banner are over-stretched. In this post, with the help of xander, we had managed to successfully put up 2 column of grid on the landscape mode. The main issue here is that on the landscape mode, the iphone will only use c0l-xs as such we have to force it to use col-sm.

@media only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 568px) {
.col-sm-6 {
float: left;
width: 50%;
Posted in Web Development | Tagged , , , | Leave a comment

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="">…/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.


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


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 or something similar. Click OK twice to exit the pop-up and Project Structure.


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


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.


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.

protected void initialize() {
    //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
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

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