Skip to content

Instantly share code, notes, and snippets.

View omps's full-sized avatar

Om Prakash Singh omps

View GitHub Profile
@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 / bookmarks.org
Last active March 30, 2016 05:13
bookmarks
@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 / 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 / vagrantvirtualbox.md
Created March 12, 2016 02:27
Starting vagrant and virtualbox

up vote 157 down vote

When you are stuck with your vagrant machine the way described above there is no need to boot in gui mode (and is impossible without an X server).

While your VM is booting, in a separate terminal window, just find out the id of the running machine.

vboxmanage list runningvms

@omps
omps / archlinux pacman commands.md
Created March 11, 2016 14:57
Arch Linux pacman cmds

pacman can update all packages on the system with just one command. This could take quite a while depending on how up-to-date the system is. This command can synchronize the repository databases and update the system's packages (excluding "local" packages that are not in the configured repositories):

# pacman -Syu

Querying package databases

pacman queries the local package database with the -Q flag; see:

$ pacman -Q --help
@omps
omps / rpm-from-source.sh
Last active March 10, 2016 09:46 — forked from fernandoaleman/rpm-from-source.sh
How to create an RPM from source with spec file
# How to create an RPM from source with spec file
# This is for Redhat versions of linux. Sometimes when you search for an rpm package,
# it is either outdated or not available. The only thing available is the source code.
# You can create a custom RPM package from source.
#
# For this example, I'll be using the latest version of Git, currently v.1.7.7.3
# Step: 1
# Install rpmbuild
@omps
omps / README.md
Created March 8, 2016 10:05 — forked from radmen/README.md
Apache vhost config for gitlab

unicorn config file

Edit file /home/gitlab/gitlab/config/unicorn.rb

Find line listen "#{app_dir}/tmp/sockets/gitlab.socket" and comment it. Uncomment line listen "127.0.0.1:8080"

required modules for apache

  • sudo a2enmod proxy
  • sudo a2enmod proxy_balancer
@omps
omps / gist:fdb653d12e78f2d6d604
Created March 8, 2016 07:13
Storing Git data in an alternative directory
y default, omnibus-gitlab stores the Git repository data under /var/opt/gitlab/git-data. The repositories are stored in a subfolder repositories. You can change the location of the git-data parent directory by adding the following line to /etc/gitlab/gitlab.rb.
git_data_dir "/mnt/nas/git-data"
Note that the target directory and any of its subpaths must not be a symlink.
Run sudo gitlab-ctl reconfigure for the change to take effect.
If you already have existing Git repositories in /var/opt/gitlab/git-data you can move them to the new location as follows:
http://serverfault.com/questions/575836/what-access-rights-could-be-blocking-access-to-a-gitlab-repository