Skip to content

Instantly share code, notes, and snippets.

Avatar

Sion Chaudhuri sionc

View GitHub Profile
@sionc
sionc / rails-postgres-backbone-bootstrap-bootswatch
Last active Apr 6, 2020
Instructions on creating a new app using Ruby on Rails, Postgresql, Backbone.js, Twitter Boostrap, Bootstwatch
View rails-postgres-backbone-bootstrap-bootswatch
- Check rails version
$ rails -v
- To update rails
$ gem update rails
- Creating a new rails app using postgresql
$ mkdir rails_projects
$ cd rails_projects
$ rails new myapp --database=postgresql
@sionc
sionc / aws-crucible
Last active Oct 20, 2020
Deploying a crucible (code review tool) instance on AWS
View aws-crucible
Instructions
-------------------
- Go to Amazon Web Services (http://aws.amazon.com/) and create an account
- Launch the AWS management console (https://console.aws.amazon.com/console/home?#)
- Select EC2
- Make sure to select N. California as your region setting (top right corner)
- Create a new EC2 instance
- Select Amazon Linux as the operating system
- Use defaults for everything else
- Create a private key (e.g. "crucible")
@sionc
sionc / rails4_install
Created Jun 1, 2013
Instructions to install rails 4.0 and ruby 2.0 to create a new web app
View rails4_install
# Install openssl to avoid getting an openssl error while creating a new app
# Check out http://goo.gl/HapK4 for more details
$ rvm pkg install openssl
$ rvm pkg install iconv
# Install ruby 2.0 using rvm
$ rvm install ruby-2.0.0-p195 -C --with-openssl-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr
# Set ruby 2.0 as default
$ rvm use ruby-2.0.0-p195 --default
@sionc
sionc / fontawesome-installation
Created May 17, 2013
Installing FontAwesome
View fontawesome-installation
Move the font files into assets > font
Move the CSS files into assets > stylesheets
Edit stylesheet references to font files -> Delete .../font/ from all urls in font-awesome stylesheets
Add the following line to config > application.rb
# Add app/assets/fonts to the asset path
config.assets.paths << Rails.root.join("app", "assets", "fonts")
Add the following line to bootstrap_overrides.css
@sionc
sionc / postgresql-commands
Last active Dec 17, 2015
Basic postgresql commands
View postgresql-commands
Creating an rails app with Postgres
$ rails new app --database=postgresql
Creating a user
$ createuser rails_dev
Creating a database
$ createdb -Orails_dev -Eunicode sager_app_development
@sionc
sionc / heroku-commands
Created May 17, 2013
Basic heroku commands
View heroku-commands
Adding an existing database
$ git remote add heroku git@heroku.com:repository.git
Deploying to heroku
$ git push heroku local-branch:master
Resetting the database
$ heroku run rake db:drop
$ heroku run rake db:create
$ heroku run rake db:migrate
@sionc
sionc / guacamole-deploy-webapp
Last active Dec 17, 2015
Instructions to deploy Guacamole web app
View guacamole-deploy-webapp
Navigate to Guacamole web app directory
$ cd guacamole
Build using maven
$ mvn package
Deploying the application
---------------------------
Copy the guacamole app into the tomcat webapps folder
$ sudo cp target/guacamole-0.7.1.war /var/lib/tomcat6/webapps/guacamole.war
@sionc
sionc / guacamole-installing-dependencies
Last active Mar 6, 2017
Installing dependencies for Guacamole
View guacamole-installing-dependencies
Installing dependencies
----------------------------
The following steps need to be performed only once in order to install dependencies:
Cairo is a 2D graphics library with support for multiple output devices.
$ sudo apt-get install libcairo2-dev
libtool
$ sudo apt-get install libtool
automake
@sionc
sionc / guacamole-fork-on-github
Created May 17, 2013
This gist walks through the steps of creating a Guacamole repository fork on Github. The Guacamole project is currently hosted on Github. For development purposes, we had created a fork on Github and document the steps.
View guacamole-fork-on-github
The guacamole source files can be found on sourceforge. To create a fork on github, follow these steps:
Clone the git repository
$ git clone git://guacamole.git.sourceforge.net/gitroot/guacamole/libguac-client-vnc
Navigate to the directory
$ cd libguac-client-vnc
Create a new repository on github. After creating the repository, go to the Settings > collaborators
and add yourself (and other contributors) to the collaborators list.
@sionc
sionc / git-branching-workflow
Created May 17, 2013
Branching workflow for git
View git-branching-workflow
git branch -a
→ Displays all branches (including remote branches)
git checkout -b [local-branch] origin/[remote-branch]
→ Create a new local-branch (e.g. test-remote) based on remote branch (e.g develop)
git fetch
→ Fetch code from remote
git merge origin/[remote-branch]