Wednesday, June 03, 2015

Strongloop with Codenvy Part1

Setting up a Loopback project in Codenvy


From the codenvy dashboard, create a new project. Choose type: Blank Project and provide a name and description. As an example, I named mine: my-api with description: Sample project for Strongloop and Codenvy


Wait a bit for codenvy to initialize the project and IDE. Next, reveal the Runners tab by clicking on the Runners button at the lower left part of the IDE. Then go to the Configs tab and click on Create New button.


Replace the Dockerfile content with the one below. Make sure to change CODENVY_USER, CODENVY_PASS and CODENVY_PROJECT with your own values.


FROM henyojess/codenvy-strongloop:v1.0.1

RUN export PATH=/opt/codenvy-cli-2.10.0/bin:$PATH && \
CODENVY_USER=jessie@sample.com && \
CODENVY_PASS=samplepassword && \
CODENVY_PROJECT=my-api && \
codenvy login $CODENVY_USER $CODENVY_PASS && \
CODENVY_PROJECT_ID=$(codenvy list | grep $CODENVY_PROJECT | awk '{ print $1}') && \
echo "codenvy clone-local $CODENVY_PROJECT_ID" >> /home/user/.bashrc

Click on the Save button on the right side of runner config tab. This creates a runner with oracle java 7, the codenvy-cli 2.10.0, git, node, npm and strongloop-cli. This will also login the codenvy-cli and clone the project files and folders into the home folder.


Run the runner created above and access the Terminal tab. Create a loopback project with the strongloop cli:


cd my-api
slc loopback --skip-install

Push the created files to the project file system hosted by codenvy:


codenvy push

Reload the browser to see the new files in the IDE. You may also need to restart the runner for the new files to appear in /home/user/runtime. To run the application after restarting the runner, access the terminal then do:


cd /home/user/runtime
npm install && slc run

Saturday, October 25, 2014

GDG DevFest 2014: AngularJS Beginners Codelab


Slides used during the event can be found here

Code and other assets maybe found here

For support and other materials, join the AngularJS-PH community

Wednesday, April 02, 2014

OSX Development Environment Setup

I just upgraded a 2010 13” Macbook Pro with a 240GB Intel SSD 530. Started with a clean install of OSX 10.9 which I immediately updated to 10.9.2
Here are the apps I installed:
Platforms
Editors/IDE
GUI for common tools
Browsers
Utilities
  • Homebrew: package manager for OSX
  • TrimEnabler: enables SSD trim for non Apple drives
  • iTerm2: a better terminal
  • Alfred: quick search and productivity tool
  • Unarchiver: adds support for 7z and other archive file types
  • ClamXav: free opensource Antivirus
  • Synergy: cross-platform opensource Keyboard and Pointer sharing
  • Virtualbox: For virtualization needs
  • Dropbox: For cloud storage
  • Skype: free video chat and messaging client
  • Transmission: opensouce torrent client
  • VLC: Video Player
  • Cyberduck: Network File Transfer client
Almost all the applications above can be installed using brew-cask except for Homebrew, Xcode and GGTS
brew install phinze/cask/brew-cask
brew cask install java
brew cask install mamp
brew cask install sublime-text
brew cask install netbeans
brew cask install brackets
brew cask install lighttable
brew cask install sourcetree
brew cask install sequel-pro
brew cask install google-chrome
brew cask install firefox
brew cask install opera
brew cask install trim-enabler
brew cask install iterm2
brew cask install alfred
brew cask alfred link
brew cask install the-unarchiver
brew cask install clamxav
brew cask install synergy
brew cask install virtualbox
brew cask install dropbox
brew cask install skype
brew cask install transmission
brew cask install vlc
brew cask install cyberduck

Monday, February 17, 2014

iPhone 3GS 6.1.3 Jailbreak Unlock

I recently got back to using my iPhone 3GS 16GB with the following specs:

Firmware: 5.1.1 Jailbroken Locked

Serial: 86011XXXXXX

Bootrom: New(fixed)

Baseband: 05.16.05

Some applications refused to run as they require a higher version of iOS so I decided to upgrade to 6.1.3.

Preparation

  • I downloaded the following two firmware packages:

  • Next I downloaded the latest version of RedSn0w. At the time of this writing: 0.9.15b3

Update to stock 6.1.3 using iTunes

  • I connected the iPhone 3GS to my windows PC with iTunes installed.
  • Allow iTunes to launch but skipped syncing and backup as I wanted a fresh/new phone
  • Turned off the phone via slide to poweroff
  • Switch to DFU mode by:

    • holding both power and home button for 10 seconds
    • then releasing the power button but continuing to hold the home button for 15 seconds
  • Restored stock 6.1.3 using iTunes by holding down the shift key will clicking the Restore button
  • Waited for phone to reboot and

Jailbreak and Unlock using RedSn0w

  • I connected the iPhone 3GS to my windows PC
  • Closed iTunes and Turned off the phone via slide to poweroff
  • Launched RedSn0w and clicked on Extra then Select IPSW
  • Selected the 6.0.0 IPSW file then went back and clicked on Jailbreak button
  • Selected Install Cydia and install ipad baseband
  • Followed onscreen instructions to complete jailbreak
  • Waited for phone to reboot
  • Relaunched RedSn0w and clicked on Extra then Select IPSW
  • Clicked on extra then Just Boot tethered button
  • Followed onscreen instrunctions to complete tethered boot
  • Waited for phone to reboot and launched Cydia
  • Searched Cydia for p0sixspwn and installed it to unthether
  • Relaunched RedSn0w and clicked on Extra then Select IPSW
  • Selected the 6.0.0 IPSW file then went back and clicked on Jailbreak button
  • Deselected Install Cydia and selected downgrade baseband
  • Followed onscreen instructions to complete baseband downgrade
  • Waited for phone to reboot and launched Cydia
  • Searched Cydia for ultrasn0w and installed it to unlock

Installed Jailbreak tweaks

  • Five Icon Dock
  • NoNewsIsGoodNews
  • Activator
  • SBSettings
  • biteSMS
  • RotationInhibitor

I'm beginning to wonder if jailbreaking is still worth it.

Monday, July 01, 2013

Ubuntu Server 12.04.2 KVM Host Setup

#!/bin/bash
#KVM Virtual machine host package installation:
apt-get install ubuntu-virt-server

#set scheduler on all sd? devices
find /dev/ -name sd? -type b | cut --delimiter='/' -f3 | while read -r; do echo "deadline" > /sys/block/$REPLY/queue/scheduler; done && \
find /dev/ -name sd? -type b | cut --delimiter='/' -f3 | while read -r; do echo -n "$REPLY:";cat /sys/block/$REPLY/queue/scheduler; done

#configure default io scheduler to deadline
sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="elevator=deadline"/g' /etc/default/grub && sudo update-grub

#configure fstab mount options to relatime(assumes ext4 file systems)
sed -i -r 's/ext4(\s+)errors/ext4\1relatime,errors/g' /etc/fstab

#remount all filesystems with relatime using UUID
cat /etc/fstab | grep relatime | cut -f1 --delimiter=' ' | cut -f2 --delimiter='=' | xargs --verbose mount -o remount -U

#install NTP and configure to sync time with at least 2 local NTP servers if available
apt-get install -y ntp && service ntp stop
read -p "Enter IP/URL of primary time server:" primary_ntp_server && read -p "Enter IP/URL of backup time server:" backup_ntp_server
cat <<EOF >/etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server $primary_ntp_server iburst
server $backup_ntp_server
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
EOF
service ntp start

#configure bridge networking with eth0 (assumes eth0 has static ip configured)
sed -i -e '/^[[:space:]]*#/!s/eth0/br0/g' -e '/^[[:space:]]*[^#]*iface br0 inet/a \
\tbridge_ports eth0 \
\tbridge_fd 9 \
\tbridge_hello 2 \
\tbridge_maxage 12 \
\tbridge_stp off'  /etc/network/interfaces
invoke-rc.d networking restart