Skip to content

Instantly share code, notes, and snippets.

@gsluthra
gsluthra / tree_html5.html
Created August 20, 2012 07:10
Fractal Tree Generation using HTML5 Canvas and Random Numbers
<html>
<head>
<script type="text/javascript">
window.onload = draw;
function draw(){
@gsluthra
gsluthra / capsule_create_form.rb
Created January 10, 2014 15:11
Capybara and RSpec Feature file that uses Page objects.
# Page Object
class CapsuleCreateForm
include Capybara::DSL
def submit_form(capsule={})
fill_in 'Title', :with => capsule[:title]
fill_in 'Description', :with => capsule[:description]
fill_in 'capsule_study_text', :with => capsule[:study_text]
fill_in 'capsule_assignment_instructions', :with => capsule[:assignment_instructions]
fill_in 'capsule_guidelines_for_evaluators', :with => capsule[:guidelines_for_evaluators]
@gsluthra
gsluthra / firewall-provision.pp
Created May 4, 2014 11:46
Puppet script to show how to open port 80 (HTTP) for incoming Apacahe Web requests via Puppet and iptables command on CentOS
### FIRE WALL ##########
exec { "open-port-80":
command => "sudo iptables -I INPUT 5 -m state --state NEW -p tcp --dport 80 -j ACCEPT",
path => "${os_path}",
unless => "sudo iptables-save | grep 80 | grep INPUT | grep ACCEPT | grep NEW | wc -l | xargs test 1 -eq",
notify => Exec["ip-tables-save"]
}
exec { "ip-tables-save":
@gsluthra
gsluthra / Sorting_Lists_In_Scala
Created July 26, 2014 06:24
Sorting lists in scala using sorted(), sortWith() and sortBy()
// Sequence of numbers
val xs = Seq(1, 5, 3, 4, 6, 2)
// Sort using Natural ordering as defined for Integers in Scala Library
xs.sorted //1,2,3,4,5,6
// Sort 'with' a comparator function
xs.sortWith(_<_) //1,2,3,4,5,6
xs.sortWith(_>_) //6,5,4,3,2,1
xs.sortWith((left,right) => left > right) //6,5,4,3,2,1
@gsluthra
gsluthra / setup-bahmni-firewall.sh
Last active August 25, 2021 09:30
Firewall settings for Bahmni (Allow only SSH, and Browser access to http, https and openerp. Block everything else). If you are using to setup on Digtial Ocean / CentOS v7.6, then scroll to bottom for comments.
# Refer to this link to understand below rules: https://wiki.centos.org/HowTos/Network/IPTables
# Set default input policy to ACCEPT
iptables -P INPUT ACCEPT
# Flush all current rules!
iptables -F
# Allow localhost interface
iptables -A INPUT -i lo -j ACCEPT
@gsluthra
gsluthra / default-setup.yml
Created May 25, 2016 06:12
A sample setup.yml file for installing Bahmni with default configuration
# To see the list of valid variables in Bahmni please refer to:
# https://bahmni.atlassian.net/wiki/display/BAH/List+Of+Configurable+Installation+Variables
timezone: Asia/Kolkata
implementation_name: default
selinux_state: disabled
@gsluthra
gsluthra / remote
Created May 25, 2016 07:20
sample remote inventory file for bahmni installation
192.168.33.10 ansible_ssh_user=vagrant ansible_ssh_pass=vagrant
192.168.33.11 ansible_ssh_user=vagrant ansible_ssh_pass=vagrant
[nagios-server]
[bahmni-emr]
192.168.33.10
192.168.33.11 passive=yes
[bahmni-emr-db]
@gsluthra
gsluthra / Openmrs Startup Error Log
Created August 5, 2016 09:25
An error seen on a OpenMRS / Bahmni v0.82 machine while connecting to OpenMRS
This file has been truncated, but you can view the full file.
05-08-2016 05:47:32 [WARN ] OpenmrsUtil - Unable to find a runtime properties file at /openmrs-runtime.properties
Aug 05, 2016 7:29:13 AM org.apache.catalina.core.StandardContext setPath
WARNING: A context path must either be an empty string or start with a '/'. The path [openmrs] does not meet these criteria and has been changed to [/openmrs]
Aug 05, 2016 7:29:19 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8050"]
Aug 05, 2016 7:29:19 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Aug 05, 2016 7:29:19 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Aug 05, 2016 7:29:19 AM org.apache.catalina.core.StandardEngine startInternal
@gsluthra
gsluthra / keybase.md
Created December 28, 2017 05:37
Keybase proof for public key and github - [email protected]

Keybase proof

I hereby claim:

  • I am gsluthra on github.
  • I am gluthra (https://keybase.io/gluthra) on keybase.
  • I have a public key ASBJQRTKLWbVsDr4Bf_C9RRtoSrh0zrmKdZx8QMSkJHxrQo

To claim this, I am signing this object:

@gsluthra
gsluthra / clone-bahmni-code.sh
Last active August 3, 2024 13:01
Clone all Bahmni EMR & Hospital system global product code and India ABDM code.
#!/bin/bash
## ------------------
## Bahmni Code Repos
## ------------------
echo "Creating folder: bahmni-global"
mkdir bahmni-global
cd bahmni-global/