Skip to content

Instantly share code, notes, and snippets.

View bheeshmar's full-sized avatar

Bheeshmar Redheendran bheeshmar

View GitHub Profile
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@sentientmonkey
sentientmonkey / test-logging.rb
Last active December 15, 2015 04:09
hourly log rotation in ruby logger via rotatelogs
#!/usr/bin/env ruby
require 'logger'
# rotatelogs required...
# http://httpd.apache.org/docs/2.2/programs/rotatelogs.html
logger = Logger.new("|rotatelogs ./foo.log.%Y-%m-%d-%H 3600", 0, 0)
10.times do
logger.error "testing..."
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@sj26
sj26 / chargify.rb
Created December 14, 2011 13:39
Yet Another Chargify HTTParty-based API gem for Ruby
require 'httparty'
# This may go away:
require 'active_support/all'
# (doesn't *require* Rails, but adds some niceties)
module Chargify
VERSION = "0.0.1".freeze
# Create a default `Client`, attempting to use Rails application config.
def self.client options=nil
@fxposter
fxposter / gist:1391475
Created November 24, 2011 14:34
Haml to ERB converter
require 'haml'
class ErbEngine < Haml::Engine
def push_script(text, preserve_script, in_tag = false, preserve_tag = false,
escape_html = false, nuke_inner_whitespace = false)
push_text "<%= #{text.strip} %>"
end
def push_silent(text, can_suppress = false)
push_text "<% #{text.strip} %>"