Skip to content

Instantly share code, notes, and snippets.

View omps's full-sized avatar

Om Prakash Singh omps

View GitHub Profile
@omps
omps / git-dmz-flow.md
Created March 14, 2016 11:52 — forked from djspiewak/git-dmz-flow.md
Git DMZ Flow

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
@omps
omps / linux_ssl_cert.md
Created March 29, 2016 12:58
SSL certificate on Linux

SSL Certificate location on Linux For system wide use OpenSSL should provide you /etc/ssl/certs and /etc/ssl/private. The latter of which will be restricted 700 to root:root.

If you have an application not performing an initial privsep from root then it might suit you to locate them somewhere local to the application with the relevantly restricted ownership and permissions.

To install root certificates.

$ cd /usr/ssl/certs
@omps
omps / bookmarks.org
Last active March 30, 2016 05:13
bookmarks
@omps
omps / tips_emacs.md
Created March 30, 2016 05:16
emacs tips
```lisp
;; emacs initialization
(setq ring-bell-function (lambda()))
(setq inhibit-splash-screen t
initial-major-mode 'fundamental-mode) ;; removes the emacs splash screen and loads scratch buffer
;; initial-buffer-choice "h:/README.org");; removes the emacs splash screen and loads scratch buffer
```
@omps
omps / oneliners.md
Last active March 30, 2016 11:05
Tips and triks
  • How to abort a git merge? #git

git reset --hard HEAD

  • How to mail your agenda files? #emacs #org #cli

add to .gnus

(defun org-mail ()
   "Send mail of agenda to myself."
@omps
omps / ruby_tips.md
Created April 3, 2016 14:00
tips ruby and rvm

[octopress (source)]$ curl -L https://get.rvm.io | bash -s stable --ruby % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 184 100 184 0 0 149 0 0:00:01 0:00:01 --:--:-- 149 100 22865 100 22865 0 0 6744 0 0:00:03 0:00:03 --:--:-- 11977 Downloading https://github.com/rvm/rvm/archive/1.27.0.tar.gz Downloading https://github.com/rvm/rvm/releases/download/1.27.0/1.27.0.tar.gz.asc gpg: Signature made Tue 29 Mar 2016 07:19:47 PM IST using RSA key ID BF04FF17 gpg: Can't check signature: No public key Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found.

@omps
omps / new_post.rb
Created April 24, 2016 10:03
rak new_post task
# usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
desc "Begin a new post in #{source_dir}/#{posts_dir}"
task :new_post, :title, :tweet do |t, args|
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
mkdir_p "#{source_dir}/#{posts_dir}"
args.with_defaults(:title => 'new-post', :tweet => '')
title = args.title
filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
if File.exist?(filename)
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
@omps
omps / twitter_config.rb
Created April 24, 2016 10:04
rake twitter config
# Twitter config (for tweeting posts)
client = Twitter::REST::Client.new do |config|
config.consumer_key = "YOUR_CONSUMER_KEY"
config.consumer_secret = "YOUR_CONSUMER_SECRET"
config.access_token = "YOUR_ACCESS_TOKEN""
config.access_token_secret = "YOUR_ACCESS_TOKEN_SECRET
end
# MAKE SURE THERE IS A TRAILING SLASH, otherwise the linking won't work
blog_url = "YOUR_BLOG_URL/"
@omps
omps / deploy_task.rb
Created April 24, 2016 10:06
rake deploy task
desc "Default deploy task"
task :deploy do
# Check if preview posts exist, which should not be published
if File.exists?(".preview-mode")
puts "## Found posts in preview mode, regenerating files ..."
File.delete(".preview-mode")
Rake::Task[:generate].execute
end
Rake::Task[:copydot].invoke(source_dir, public_dir)
@omps
omps / jenkins-centos.md
Created May 29, 2016 08:10
Install jenkins on centos
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo #Installation of a stable version LTS YUM repository for the LTS Release Lin
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

sudo yum install java #jenkins require Java to be present.