Skip to content

Instantly share code, notes, and snippets.

View mongris's full-sized avatar

M mongris

  • Auckland, New Zealand
View GitHub Profile
@mongris
mongris / git-subdir.sh
Created February 21, 2013 11:42
Detach subdirectory into separate Git repository from: http://stackoverflow.com/a/9510944
#!/bin/bash
#
# git-subdir.sh
#
git clone --no-hardlinks $1 $2
cd $2
git filter-branch --subdirectory-filter $2 --prune-empty --tag-name-filter cat HEAD -- --all
@mongris
mongris / git-rmsubdir.sh
Created February 21, 2013 11:49
Remove sub directory from git: git-rmsubdir.sh gitrepo subdir
#!/bin/bash
#
# git-rmsubdir.sh
#
cd $1
git filter-branch --index-filter "git rm -r -f --cached --ignore-unmatch $2" --prune-empty HEAD
@mongris
mongris / private.xml
Created February 22, 2013 05:25
private.xml for KeyRemap4MacBook
<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+cmd+opt) + F19 Only, F19)</appendix>
<identifier>private.f192f19</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
@mongris
mongris / rename-repo.md
Last active November 22, 2017 14:00
Rename repo's name in gitolite and gitlab
  • list your repositories

    cd /home/git
    sudo ls repositories/
  • rename specified repo

sudo mv repositories/old-name.git repositories/new-name.git

.select2-container .select2-choice {
border: 2px solid #dce4ec;
font-family: "Lato", sans-serif;
font-size: 14px;
text-indent: 1px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
#!/bin/bash
#
# Install Postgres 9.2 on a clean Ubuntu 12.04
"""
LC_ALL issue
comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file.
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.
/**
* Patch the console methods in order to provide timestamp information
*
* Usage:
* > console.log('ok')
* 2012-09-06T11:52:56.769Z ok true
*
* Note:
* The patch will only be applied with the first call.
*
input {
file {
type => nginx_web
path => ["/var/log/nginx/*"]
exclude => ["*.gz"]
}
}
filter {
grok {
@mongris
mongris / kibana.conf
Last active December 19, 2015 13:59 — forked from technosophos/kibana.conf
# kibana.conf# kibana - log viewer
#
description "Kibana logstash viewer"
start on virtual-filesystems
stop on runlevel [06]
respawn
respawn limit 5 30
description "logstash collector server"
start on runlevel [2345]
stop on runlevel [06]
# tell upstart we're creating a daemon
# upstart manages PID creation for you.
expect fork
script