Installing Rails and mysql on CentOS on Rackspace / Slicehost Account from Scratch

08/08/2012

Installing Rails and mysql on CentOS on Rackspace / Slicehost Account from Scratch

Installing Rails and mysql on CentOS on Rackspace / Slicehost Account from Scratch

This is an advanced blog post for devs looking for online resources and examples

Below is the instructions to install rails from a clean centos build. It assumes you are logged in with ssh as root and that you have some understanding of the command line and a command line text editor like vi or vim.

First: Install the basics
> yum install git > yum install gcc gcc-devel make gcc-c++ zlib-devel > yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel > yum install mysql mysql-devel mysql-server
Second Install RVM, Ruby, and Rails
> curl -L https://get.rvm.io | bash -s stable --ruby > vim /etc/groups

edit line : rvm: add root.. Line should look similar to

rvm:x:500:root

*log off and back in to get your group

> source /etc/profile.d/rvm.sh > rvm install 9.1.3 > gem install rails execjs therubyracer > rails new myapp -d mysql > cd myapp
Step 3: Get rails running and open up the firewall

Now add a firewall rule to the iptables file like

vim /etc/sysconfig/iptables

Add:

-A INPUT -p tcp --dport 80 -j ACCEPT

and now you should be able to see your rails app when you run it

> rails server -p 80 *whatever port you want I'm using 80 for simplicity of testing

You can background the service by pressing -z and then once it changes tasks type

> bg

Another options is to just open another shell window and goto testapp directory

Now you should be able to visit MY.IP.ADD.RESS:80 in your browser and you should see the rails welcome page. You should also see some rails errors about mysql. We will fix that soon

Last step : Mysql config

Start the service

> /etc/init.d/mysqld start > mysql create database SOMEDB; grant all on SOMEDB.* to USERNAME@localhost identified by 'PASSWORD'; exit vim /config/database.yml

Edit the database name, username, and passwords to match the USERNAME PASSWORD and SOMEDB and then you can restart rails and refresh the page and see the connection errors have gone away

Converting Flash to HTML5 Wins, Woes, and Wisdom

07/23/2012

HTML5 Animation Wins, Woes, and Wisdom

Making HTML5 from Flash, animation and interaction for multiple devices, wins, losses, and tips.

A popular request in 2012 is converting Adobe Flash animation and graphical interactions to HTML5. Approaches and information on how to do so is constantly changing and evolving. The team at Jibwa LLC in Tucson has been working out this issue for various projects for years now and have some thoughts to share with other engineers, marketers, and strategists looking to accomplish this feat of technology the right way.

The bad news first

In most cases there is little to no chance this conversion will be exact, and the reality is the conversion will be costly and many items may end up on the chopping block. There are strengths of Flex/Flash that are very weak in HTML5 and the team will have to work around them. Chances are the new HTML5 version will look the same or worse than the Flex/Flash version, but there is a possibility of taking the experience to vastly improve your presentation in other, more important ways.

The good news

Once the new cross-browser cross-device HTML5 baby is born you can rest assured you are not alienating anyone from your product, service, business, readership, etc. The new HTML5 version should have updates and considerations for retina displays as well as small screens and touch interaction. Further you can make graphic updates and keep your old flash version and use that on older desktop browsers. This means the HTML5/Flash hybrid is going to look great to 99.9% of your audience which is pretty amazing.

List of things to know before considering a HTML5 interaction in 2012

First and foremost: Understanding the limitations of HTML5 and having cross-device and cross-platform solutions is key. Here are some tips and considerations to help determine viability and approach to this sort of solution.

  • HTML5 canvas based solutions won’t work on most devices. Don’t count on the canvas element if the end product is going to be public facing.
  • CSS3 animations are way more efficient but also pose the same problem as canvas elements, they don’t work on most browsers, even modern ones.
  • Javascript animations using elements and DIVs with background images are probably the best choice to reach all browsers (back to IE 7). This creates a lot of limitations in terms of efficiency but solves the problem with the least amount of headache and largest reach.
  • Use loaders and sprite sheets for everything. On mobile devices this is especially important.
  • Think about retina displays and start at those resolutions with your sprites sheets. You can always scale them down for performance. Also note that there is maximum image sizes on some Web-kit / iOS devices (even the retina displays that create the need for maximum resolution!) .
  • Before getting started consider the impact of touch displays on interaction and animations. If you have hover interactions get rid of them or create a solution that appears on touch devices only.

Tricky customer support at verio

06/28/2012

Tricky customer support at Verio

A great example of how Jibwa makes sure to service our clients with the least hassle possible.

This afternoon we contacted Verio to recover a file that was lost while we were writing some CSS. We don't recommend Verio as a hosting company, but one of our clients was already set up with them.

Communication with customer support is a frequent problem and often times as web developers we don't have access to credentials to deal directly with hosting companies. As a result we try and get as much information as possible from them so we can give our clients a clear set of tasks to do with the hosting company. Below is an example of a chat transcript showing how we fight to go the extra mile to make sure we aren't making our clients spend any more time then they have to!

For web searchers this also will give you insight on how Verio does backup and recovery. We recommend Bluehost because with Bluehost it is free and simple to recover you backups. At the bottom of this article we will display the command line method of simple file recovery for Bluehost!

The Chat Transcript

Josh : How do I recover a file from my nightly backup?

Josh : I just have FTP access, is there a folder the backups are put in?

Kresta : Thank you for contacting Web Hosting Customer Care.

Kresta : Hello, Josh.

Josh : Hi Kresta

Kresta : I understand that you want to know how to recover a file from your nightly backup, is that correct?

Josh : yes

Kresta : I will be glad to assist you with your inquiry.

Kresta : Before we start, may I please have your full name?

Josh : Joshua White

Kresta : Thank you. Please give me a moment while I pull up your account information, Josh.

Josh : Sure

Kresta : Thank you for waiting.

Kresta : I apologize for any inconvenience; however, I am unable to find any account under your name and will be unable to provide you further support.

Kresta : If you know the person who has an account with us, they would need to call in and add you to their account.

Josh : Ok, so I have ftp access to the web server. I can't just go to a folder with the nightly backups?

Josh : Is it something I have to request from you guys?

Josh : If so I'll contact XXXXXX XXXXX and she will contact you guys

Kresta : I understand this is frustrating. With a recent change to our Authentication policy, we will be unable to access any account without the account owner`s name or account contact. At this time, I was unable to locate any account with your name listed.

Josh : ok, thats fine

Josh : at least then work with me to make sure I get the request phrased properly to my contact there

Kresta : I apologize. Even if you provide a different name that might possibly have an account with us, we can only provide support to customers who are currently listed on any account. We`re unable to provide further support because your name is not associated in any account.

Josh : I don't need you to do anything with the account

Josh : I need you to tell me how the file recovery process works there so I can get the right information to the person that owns the account

Josh : Otherwise I will just be wasting my, your, and their time guessing what I 'm supposed to tell them

Kresta : We can retrieve your backups through a restoration process but it has a charge.

Josh : ok. So I need to contact XXXXXX, who in turn needs to contact you guys, and then you can recover 1 file for a fee?

Kresta : The process to recover a file is via restoration.

Josh : Can I do the request with the cpanel online? Or does she need to call in?

Kresta : I apologize but I am unable to provide you any support or any account information because I was unable to pull up any account with your name listed.

Josh : Does my contact that has the information need to call in or can file recovery be requested VIA CPanel?

Kresta : If you know the person who has an account with us, they would need to call in and add you to their account.

Josh : thanks!

Kresta : Is there anything else I can assist you with aside from this?

Josh : Nope, I'm contacting the client. Thanks for the info

Kresta : Should you need further help, feel free to contact us. Thank you for contacting web hosting Customer Care. Have a nice day!

The Support Sage Continues

The client contacts Verio by phone

After this conversation I called my client and passed on the instructions and the file location of the file we were looking to recover. She let me know she would call them right away and get right back to me. About 45 minutes later she called me back and informed me that they were asking her technical questions she couldn't answer. She said she authorized me and my email on the account to call myself. After about 20 minutes of this process the support rep was still giving her trouble. Eventually the call got disconnected.

I contact Verio by phone.

I call Verio and the support rep states that I am not verified and that they can't help me. I request a supervisor and am promptly hung up on.

I contact Verio by phone, again.

I call Verio back and inform Jasper that I need a direct connection to a supervisor because I was hung up on. I also asked for his employee or call center ID number which he refuses to provide. After about 2 minutes of telling me he needs to verify me he puts me on hold to 'find' a supervisor. 15 minutes later he picks up the line, asks me for a call back number. Hold for another 5. Another 15. Eventually I hang up and call my client back to request a conference call to Verio.

I contact the client

I give her the scoop on how it worked out on my call. We laugh and she states they responded to her authorization request which states I will be added to the account within 24 hours. Unfortunately that means we won't have the file for at least another and suggest we try and conference call Verio.

We conference Verio

We get through the authorization! Now we request to get the file recovered.

After about 1/2 hour we are able to communicate the location and story of the file. The story of the file is that it was on the server and we had been testing our new responsive layout for a few days. We saved with FTP and the server disconnected while saving. Somehow Notepad++, WinSCP, or their server overwrote the file on the server as blank. After re-opening it we found the file was blank and then the computer went blue screen. Unfortunately we didn't have it in version control which was our bad, but we had evaluated Verio who claims to keep nightly backups.

Our request was to simply recover the file (responsive.css) from the nightly backup and drop it somewhere in the webroot. We are then informed that not only did we have to spend a combined 4 hours getting to this point, but that it is required that we pay $50. Not only do we need to pay $50 but we also need to wait 24-48 hours, and they aren't sure if the file will even be there. At this point we confirmed with the service agent that they were unable to offer us any other option and ended the call.

Results and Support Time Totals

Josh - On Chat w/Kresta - 30 minutes - Got a plan

Client - Phone w/ Rep2 (Hangup) - 40 minutes - Supposed Authorization

Josh on phone with Rep3 (Hangup) - 10 Minutes - Not Authorized

Josh on phone with Jasper (Endless hold, I hung up) - 20 Minutes - No Progress

Josh and client on conference with Ryan - 30 minutes - Confirmed couldn't help

Conclusions

Don't ever host with Verio

Don't trust server backups

When you sync a local file up to the server back it up before syncing it back down

Always host with a provider that supports GIT

Bluehost Command Line Method

I've been hosting with Bluehost for a long time and have accidently deleted a file. It usually takes me under 5 seconds to recover it. Below is an example of how!

>cd ~ >cd .. >ls ./ ../ saveandr/ saveandr.daily/ saveandr.monthly/ saveandr.weekly/ >cp saveandr.daily/file.txt ~/

And you are done!

Andriod Development 101 - Wireless Deployment and Flex Debugging

06/26/2012

Andriod Development 101 - Wireless Deployment and Flex Debugging

Quick instructions to set up wireless apk deployment and debugging with Android. Also how to get it working with Flex Builder 4.6

NOTE:This post is for developer types that are looking for some ideas or ways to better work with debugging on their Andriod devices.

We have been trying to find the best way to work with Android development and one of the recent issues We ran across was a need (want) to work with multiple devices via WIFI. This proved to be pretty difficult and I am going to describe the steps I had to take to do it.

How to 'safely' root a MyTouch 4g (and other devices I'm sure).

There are a lot of tutorials discussing a way to root the MyTouch 4G which requires a lot of work and a downgrade to Froyo from Gingerbread. I really didn't want to do a lot of the required steps because it meant possibly breaking my phone, potentially losing config ad contacts, and just a lot of work. Here is what I did instead.

  • Make sure you have the andriod sdk installed and adb.exe (Found in the platform-tools folder) as well as you phone drivers installed and usb debugging configured. There are lots of tutorials for that online so I'll skip the instructions here.
  • Follow JUST THE "Gaining Temp Root" instructions HERE
  • Once you have succeeded with the gain root instructions open a text editor and create a file called temproot.bat in your platform-tools folder with these contents so we can automate this gainroot process.

    temproot.bat

    adb shell chmod 777 /data/local/tmp/fre3vo adb shell /data/local/tmp/fre3vo -debug -start FAA90000 -end FFFFFFFF Now you can just temproot on the command line when you are connected with USB debugging.

How to get wifi debugging activated and connected

Now get on the windows command line type these commands. adb tcpip 5555 adb connect 192.168.1.XXX
  • I actually added the two lines above to my temproot.bat
  • Some notes

    I actually have been working with the Flash Builder 4.6 debugger and after connecting with WIFI to my device it wasn't showing in the list of devices to debug to. In order to fix that issue I actually had to restart the phone and move my temproot.bat to the adobe adb folder. After a quick search I found it "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\lib\android\bin". So now when I decide to start debugging I run the same commands I describe above, but now from that folder. Here is what I put in the command line to get started and be able to debug!

    Command Line

    > cd "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\lib\android\bin" > temproot

    Jibwa and LinkedIn agree on HTML5 Apps

    05/02/2012

    Jibwa and Linked in agree on HTML5 Apps

    We firmly believe everyone should be building sites and apps with HTML5 when they can. LinkedIn definitely agrees with their new HTML5 IOs app.

    By Joshua White | May 30, 2012

    The recent article found here by Venture Beat is a great example of what is to come from HTML5 on the web. It discusses the approach taken by the technical team at LinkedIn in building an appealing app for the IPad and how they focused on what was important and clean and produced what appears to be a top notch IOs app. The best part about the application is that beyond its simplicity and beauty is that it contains almost no native IOs code and instead is 95% HTML5.

    It is hard to explain to individuals why HTML5 is so significant going forward, but the case study of LinkedIn is a great place to start. Now that they have presented their application in HTML5 they can easily port the same code to all tablets, phones, desktops, and devices. Doing so will same them massive amounts of development and design costs while providing their customers with consistent look, feel, and features across devices. It also means that they are writing for the future and the code base they maintain in HTML5 could easily survive for a decade of more. We realize, at Jibwa, that you can't do every application in HTML5, but when you can, you should. Nice work LinkedIn!

    Mobile Devices

    04/30/2012

    Mobile Device Performance

    Image of Jibwa application Poor coding choices lead to diminished performance and higher battery consumption on mobile devices.

    By Kory Leavitt | April 30, 2012

    A recent study was conducted by Stanford University, and it concluded that poor coding choices led to diminished performance and higher battery consumption on mobile devices. Performance of websites on mobile devices require advanced coding techniques and skills.

    Jibwa utilizes modern standards of HTML5, and professional coding practices to build websites optimized for mobile devices.

    Visit the BBC News website to read the full article.

    Jibwa Retail

    04/29/2012

    Jibwa Retail

    Jibwa has created a unique web app to leverage online marketing, e-commerce, and inventory management for independent retailers.

    By Kory Leavitt | April 29, 2012

    Jibwa has created a unique web app to leverage online marketing, e-commerce, and inventory management for independent retailers. RareFinds Market is an online boutique featuring high-quality furniture, art, and decor produced by Tucson's finest independent artists and craftsmen.

    This platform can be adapted and re-branded for an array of industries such as real estate and automobiles.

    Visit RareFindsMarket.com to see how we do retail.

    Information Technology in the Medical Field

    04/19/2012

    Online Electronics Health Records and Practice Management Software

    Information technology in the medical field is making a new push to make health records electronic.

    By Kory Leavitt | April 18, 2012

    Information technology in the medical field is undergoing huge growing pains with a new push to make health records electronic. This drive is forcing the private sector and public sector to coordinate efforts in order to make disparate electronics records systems compatible and interoperable.

    Image of Pediatrics One medical application

    The Health Information Technology Standards Panel www.hitsp.org is helping to coordinate the industry standards. Jibwa is an innovator in online electronics health records and practice management software. See this example of a Pediatrics PM and EMR system called PedOne.



    View the demonstration videos

    WordPress Vulnerabilities

    04/19/2012

    WordPress Vulnerabilities

    WordPress websites are a security threat to your business.

    By Kory Leavitt | April 19, 2012

    WordPress websites are a security threat to your business. TechWorld.com reports that the recent Apple Mac Flashback Trojan was a result of a malicious plug-in associated with WordPress blogs.

    Image of the HTML5 logo
    "Websense has estimated the number of infected WordPress sites to be 30,000, with others putting the number as high as 100,000"

    Read the TechWorld Article

    Jibwa will create a custom website using modern technologies and standards that ensure responsive, compliance, and security for your business.

    Secure Web Applications

    04/18/2012

    Secure Web Applications

    Jibwa builds custom applications without plugins and third-party tools that create security vulnerabilities.

    By Kory Leavitt | April 18, 2012

    Jibwa builds custom applications without plugins and third-party tools that create security vulnerabilities. We utilize a whitelist approach in conjunction with PCI compliance to build secure apps for our clients.

    Beware Apps Bearing Unwanted Gifts- The Wall Street Journal

    Take care when considering third-party apps, and contact us to build your own.

    The Arizona Technology Council

    04/10/2012

    The Arizona Technology Council

    Today Jibwa is proud to announce that we are officially a member of the Arizona Technology Council!

    By Kory Leavitt | April 10, 2012

    Today Jibwa is proud to announce that we are officially a member of the Arizona Technology Council! We look forward to collaborating with the technology community in Arizona in an effort to grow the technology industry. Jibwa will not only provide the cutting-edge software solutions to Arizona businesses, but we also aim to be the leading software development and management training organization!

    Image of the Arizona Technology Council's logo

    Creating an Effective Presentation

    03/28/2012

    Creating an Effective Presentation

    Jibwa builds websites that are adaptive, compliant, and responsive.

    By Kory Leavitt | March 28, 2012

    Anyone who has ever produced an effective presentation understands that there are several considerations before you can begin. To create an effective presentation you must consider all factors including the canvas, the medium, the audience, the location, and the scope.

    Image of the Wings for Warriors logo
    Click the image to see an example of what we can accomplish for your organization or business

    Your website is the primary presentation that your organization uses to connect with your clients, prospects, and partners. Jibwa builds websites that are adaptive, compliant, responsive, and easy to use for everyone, anywhere, anytime, and on any device.

    The Benefits of HTML5

    03/23/2012

    The Benefits of HTML5

    HTML5 benefits application developers and end-users.

    By Kory Leavitt | March 23, 2012

    HTML5 benefits application developers and end-users by circumventing native app monopolies. Lagging manufacturers like RIM are recognizing this.

    Leading manufacturers like Apple will find out. Jibwa sees the future and it is bright.

    Image of the HTML5 logo
    Click the image to view Slashgear's article concerning the rise of HTML5 applications.

    Meeting the Challenges of Cross-Platform Development

    03/22/2012

    Meeting the Challenges of Cross-Platform Development

    Building modern applications is a complex task for today's designers and developers.

    By Kory Leavitt | March 22, 2012

    Building modern applications is a complex task for today's designers and developers. The multitude of devices, displays, operating systems, and other variables are creating new challenges, and new opportunities, for software companies.

    Jibwa is a leader in the industry through the use of breakthrough technologies such as Sencha, Phone Gap, Adobe Air, and HTML5.

    Image of multiple browser icons

    The Evolution of Website Design

    03/21/2012

    The Evolution of Website Design

    The modern web is now about availability and attention to content.

    By Kory Leavitt | March 21, 2012

    The modern web is now about availability and attention to content. Clean, clear, compliant. The only path to success on the web starts with considering the customer and their device's needs and capabilities first.

    Web 2.0 is finally over and we at Jibwa are rejoicing. HTML5 means massive improvements to the overall web experience and this means even more potential and efficiency we can offer to our clients.

    Jibwa's Grand Opening

    03/20/2012

    Jibwa's Grand Opening

    This summer will be the official grand opening of Jibwa as a full service and fully staffed IT solutions provider.

    By Kory Leavitt | March 20, 2012

    This summer will be the official grand opening of Jibwa as a full service and fully staffed IT solutions provider.

    Image of a Jibwa training session

    We can't wait to announce all of the great upcoming opportunities, presentations, and events on the horizon. Stay tuned...