Skip to content

Instantly share code, notes, and snippets.

View kainam00's full-sized avatar

Dmitriy Martynov kainam00

View GitHub Profile
@kainam00
kainam00 / rvm-amazon-linux.bash
Created July 31, 2015 15:31
Install RVM on Amazon Linux
#!/bin/bash
# Install prerequisites
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git
# Import key
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ruby
@kainam00
kainam00 / truncate-tomcat6-logs.rb
Created July 31, 2015 14:50
Truncate tomcat6 logs
#!/usr/bin/ruby
Dir.entries("/var/log/tomcat6").each do |filename|
if filename != "." && filename != ".."
filename = "/var/log/tomcat6/#{filename}"
File.truncate(filename,0)
end
end
@kainam00
kainam00 / genericinit.bash
Created July 15, 2015 19:10
Simple generic init script
#!/bin/bash
# chkconfig: 2345 90 90
# description: process-sqs
### BEGIN INIT INFO
# Provides: myapplication
# Required-Start: network
# Required-Stop: network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start the program