Monday, October 20, 2008

jianshi.org planned updates

- continuous integration for openmbp (currently rails, java client or native client in the future)
- gitorious setup
- moving this blog to jianshi.org (so i don't waste that domain name)

wtf am i doing. so much to do.

Tuesday, October 14, 2008

Random Annoyance (VLC on OS X)

Fix random crashes -

- Quit the application if it is running
- Delete the VLC folder in /Users/USERNAME/Library/Preferences
- Delete org.videolan.vlc.plist in /Users/USERNAME/Library/Preferences
- Delete org.videolan.vlc.plist in /DRIVENAME/Library/Preferences

Saturday, October 11, 2008

Quicker Rails Setup (Ubuntu)

Install Rails

sudo apt-get install ruby-full
wget http://rubyforge.org/frs/download.php/43985/rubygems-1.3.0.tgz
tar xvzf rubygems-1.3.0.tgz
cd rubygems-1.3.0
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
gem install rails

Install SQLite3
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby

Wednesday, September 24, 2008

Lightbot

196 commands first try all 12 levels.

Cisco VPN From Ubuntu

sudo apt-get update
sudo apt-get build-dep vpnc
sudo apt-get install libssl-dev fakeroot
mkdir ~/src/vpnc -p
cd ~/src/vpnc
apt-get source vpnc
cd vpnc-*

Edit the Makefile and uncomment 2 lines that have "OPENSSL" in the beginning of the line

dpkg-buildpackage
sudo dpkg -i ../vpnc*.deb

Edit /etc/vpnc/default.conf

IPSec gateway 10.10.10.10
IPSec ID GROUPNAME
IPSec secret ########
IKE Authmode psk
Xauth username johndoe
Xauth password ########

Type "sudo vpnc"

To add foo.com to search path:

sudo echo "foo.com" >> /etc/resolvconf/head

Monday, September 22, 2008

VPS Updates

- rails with passenger
- openmbp deployment space up
- capistrano support for the git code base
- continuous integration with cruisecontrol.rb

Power APT-GET

Compile custom package newer than repos version? No problem. Check this out

git clone git://git.kernel.org/pub/scm/git/git.git

Gets git source.

Git's package in ubuntu is called git-core

This command gets you all the dependencies to BUILD git-core -- sudo apt-get build-dep git-core

Dopeness.

Friday, September 19, 2008

VPS

Sites:

- icsalumni.org running moinmoin 1.72
- jianshi.org in migration
- community domain
- local gitorious hosting

Software
- Apache2 with php, fastcgi, modwsgi, Passenger Phusion
- Ruby latest stable (1.87), Rails 2.1, Postgres, Mysql
- Git

Whew... More to come soon guys!

Tuesday, September 2, 2008

Holy Grail

Brah... LOLOLOLOL good stuff

find . -type d -name '.svn' -print0 | xargs -0 rm -rdf

Friday, August 22, 2008

Phusion Passenger (Modrails) on Ubuntu

Follow instructions from modrails.com

but at the end don't forget this.

cd /usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2
sudo find . -perm 0662 -exec chmod 664 {} \;

Some people messed up with permissions.

Ruby/Rails from Source

wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6.tar.gz
wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz

sudo cp -r ~/ruby-1.8.6 /usr/local/src/
sudo cp -r ~/rubygems-0.9.4 /usr/local/src/

# Ubuntu
sudo apt-get install zlib*

cd /usr/local/src/ruby-1.8.6/ext/zlib/

ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib
make
sudo make install

cd /usr/local/src/rubygems-0.9.4/
sudo ruby setup.rb config
sudo ruby setup.rb setup
sudo ruby setup.rb install

cd
sudo gem install rails --with-dependencies

Tuesday, July 29, 2008

Git on Rails

Rails project setup with Git.

rails project
cd project

# commands
git init
git status
git add .
git commit -a
touch tmp/.gitignore log/.gitignore vendor/.gitignore

# .gitignore
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3

Monday, July 21, 2008

Jackson JSON Consumption

Jackson is a Java based JSON consumption and emission library. It is now a Codehaus project that is currently considered the fastest JSON parser for Java. I'm writing a project module at work that consumes JSON from a REST interface and populates a Java user interface in SWT. Pretty sweet stuff!

Friday, June 20, 2008

PostgreSQL Server Installation from Source (Mac OS X 10.5)

Compilation and installation is straight forward for the most part.
Get the source 8.3.3 (Current latest): http://www.postgresql.org/ftp/source/v8.3.3/

1. Un-tar and Un-bzip: tar xvjf postgresql-8.3.3.tar.bz2
2. Change into uncompressed directory: cd postgresql-8.3.3
3. Configure script: ./configure --prefix=/usr/local/pgsql (Default prefix options)
4. Compille: make
5. Install: make install
6. Add /usr/local/pgsql/bin to your path.

You are finished if you need this just for development.

Role to run the server.
$ sudo dscl . -create /Users/
$ sudo dscl . -create /Users/ UniqueID
$ sudo dscl . -create /Users/ PrimaryGroupID
$ sudo dscl . -create /Users/ UserShell
$ sudo dscl . -create /Users/ NFSHomeDirectory
$ sudo dscl . -create /Groups/
$ sudo dscl . -create /Groups/ PrimaryGroupID

and should be postgres. However you can customize this.

Useful Commands

pg_ctl: Controls server operation.
PGDATA: Environment variable that points to your path to store data.
initdb: Initializes database path. Uses PGDATA

More to come later. Yes you can use an automated installer. No you won't have the latest version.

Moving Engineering Blog Here

Check for updates here. I don't want to deal with maintaining Wordpress anymore. Plus the whole open-id thing is cool, but I'd like my stuff in one place. Since people I know are already using Blogspot, I'll move here too.

Upcoming post topics (in no particular order) -- Rails, Java, DVCS, PostgreSQL, etc...


puts "Hello Blogger!"