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

Ubuntu Server 12.04.2 KVM Guest Setup

preparing the template image:
#Setup io scheduler and serial console for virsh
sed -i -r 's/GRUB_CMDLINE_LINUX=".*"/GRUB_CMDLINE_LINUX="elevator=deadline console=ttyS0,38400n8 console=tty0"/g' /etc/default/grub && update-grub


#Setup serial terminal console config
cat <<EOF >/etc/init/ttyS0.conf
# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 38400 ttyS0 vt102
EOF


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



#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "script must be run as root. run with sudo" 2>&1
exit 1
fi

old_name=`hostname`
echo "Current hostname:$old_name"
echo -n "Enter new server name:"
read new_name
echo "$new_name">/etc/hostname
hostname $new_name
sed -i "s/$old_name/$new_name/g" /etc/hosts

#regenerate udev persistent net rules on reboot
echo "Removing /etc/udev/rules.d/70-persistent-net.rules"
rm /etc/udev/rules.d/70-persistent-net.rules

echo "Regenerating ssh server keys"
rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server

echo "*** You should probably change the password and reboot ***"