Skip to content

Instantly share code, notes, and snippets.

View victorboissiere's full-sized avatar

Victor Boissiere victorboissiere

View GitHub Profile
@victorboissiere
victorboissiere / .htaccess
Created October 2, 2016 20:06
https redirection with Apache using a .htaccess file
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# workspace
# -------------------------
# To maximize none-editor paneItem e.g. setting-view
'atom-workspace:not(.editor)':
# conflicts insert-mode ctrl-w and ctr-w in mini editor, so comment out by default
# 'ctrl-w z': 'vim-mode-plus:maximize-pane'
'cmd-enter': 'vim-mode-plus:maximize-pane'
# all
# -------------------------
[
{
"keys": ["j"],
"command": "move",
"args": {
"by": "characters",
"forward": false
},
"context": [{
"key": "vi_mode_normal"
unmap h
unmap j
unmap k
unmap l
map j scrollLeft
map k scrollDown
map l scrollUp
map ; scrollRight
exec_always xmodmap -e "clear lock" #disable caps lock switch
exec_always xmodmap -e "keysym Caps_Lock = Escape" #set caps_lock as escape
@victorboissiere
victorboissiere / Basic ssh config
Created December 4, 2016 17:07
Default config for ssh config file
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/github_rsa
AddKeysToAgent yes
@victorboissiere
victorboissiere / .zshrc
Created November 25, 2017 22:57
Replace man with TLDR
function man()
{
OUTPUT="`tldr $1 2>&1`"
if [ $? -eq 0 ]; then
echo $OUTPUT
else
/usr/bin/man $1
fi
}
@victorboissiere
victorboissiere / Vagrantfile
Created March 31, 2018 20:14
Vagrantfile repmgr
Vagrant.configure("2") do |config|
(1..2).each do |n|
config.vm.define "server#{n}" do |define|
define.vm.box = "consumerlab/ubuntu-server-16-04-LTS"
define.ssh.insert_key = false
define.vm.hostname = "server#{n}"
define.vm.network :private_network, ip: "10.0.15.2#{n}"
define.vm.provider "virtualbox" do |node|
node.name = "server#{n}"
@victorboissiere
victorboissiere / output
Created March 31, 2018 22:35
Repmgr medium
Role | Name | Upstream | Connection String
----------+---------|----------|---------------------------------------------------------
* master | server2 | | host=server2 user=repmgr dbname=repmgr connect_timeout=2
standby | server1 | server2 | host=server1 user=repmgr dbname=repmgr connect_timeout=2
Role | Name | Upstream | Connection String
----------+---------|----------|---------------------------------------------------------
* master | server1 | | host=server1 user=repmgr dbname=repmgr connect_timeout=2
standby | server2 | server1 | host=server2 user=repmgr dbname=repmgr connect_timeout=2