Skip to content

Instantly share code, notes, and snippets.

View bawerd's full-sized avatar

Bawer Dagdeviren bawerd

  • Sweden
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bawerd on github.
  • I am bawerd (https://keybase.io/bawerd) on keybase.
  • I have a public key ASD0uuNDxfyihdGHQ7VbP4-ufOKapk4NRZzgx14L68m-Bgo

To claim this, I am signing this object:

Introduction

The objective of this post is to get people up and running with SmartOS with enough development tools to do some C/C++ and NodeJS development and take advantage of some amazing tools available only on this platform.

In my case the killer app available on SmartOS is DTrace, which enables me to peak inside a running nodejs application and observe various aspects of it's operation.

Install SmartOS

In my case I normally use the VMWare version of dtrace, this can be downloaded from SmartOS Download Page.

Once downloaded this just needs to be copied to your Documents/Virtual Machines folder and launched by double clicking on the file.

# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@bawerd
bawerd / ubuntu-11.10-gems.erb
Created March 17, 2012 19:55 — forked from millisami/ubuntu-11.10-gems.erb
Chef bootstrap With rvm and ruby 1.9.3 on ubuntu 11.10
bash -c '
<% if knife_config[:bootstrap_proxy] -%>
(
cat <<'EOP'
<%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
EOP
) > ~/.curlrc
<% end -%>
if [ ! -f /usr/bin/chef-client ]; then
@bawerd
bawerd / gist:1875752
Created February 21, 2012 10:48 — forked from fernanDOTdo/gist:1120286
My Nginx Multi-Symfony2 configuration
server {
listen 80 default;
server_name 192.168.0.34 localhost;
server_tokens off;
root /home/nginx/$host/web;
index app.php index.php index.html;
access_log /home/nginx/$host/app/logs/access.log;
error_log /var/log/nginx/error.log;
try_files $uri $uri/ @rewrite;
@bawerd
bawerd / defaults
Created February 21, 2012 10:42 — forked from marfillaster/defaults
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}