Skip to content

Instantly share code, notes, and snippets.

@twymer
twymer / solve.md
Created November 12, 2019 20:13 — forked from hkulekci/solve.md
Elasticsearch "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)" error

If u are getting below error while indexing:

{
  "error": {
    "root_cause": [
      {
        "type": "cluster_block_exception",
        "reason": "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
 }
### Keybase proof
I hereby claim:
* I am twymer on github.
* I am twymer (https://keybase.io/twymer) on keybase.
* I have a public key ASBFEbZt62sDK6-YDoR3vrSQQRj-K17URROqTR_PEeSN-wo
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am twymer on github.
  • I am twymer (https://keybase.io/twymer) on keybase.
  • I have a public key whose fingerprint is 769B BCFC FF8F EE7A 61D7 3AC6 1531 4B0C 68AE 6D34

To claim this, I am signing this object:

#!/bin/sh
osascript <<-eof
tell application "iTerm"
set myterm to (make new terminal)
set cdhqdir to "cd ~/code/dimagi/commcare-hq"
tell myterm
launch session "Default session"
tell the last session
write text "elasticsearch"
write text "pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
@twymer
twymer / post-checkout
Created August 20, 2013 14:29
Save this as .git/hooks/post-checkout and make it an executable file.
#! /bin/sh
# Start from repository root
cd ./$(git rev-parse --show-cdup)
# Delete .pyc files
find . -name '*.pyc' -delete
# Update submodules
git submodule update
@twymer
twymer / gist:1109542
Created July 27, 2011 15:00
How I handle nasty merge conflicts from github
git reset --HARD HEAD@{0} // Can see options with git reflog, this should undo the pull's changes
git reset --soft HEAD~ // Pull your last commit out to the index (might need to reset further)
git stash
git pull
git stash pop
Now fix your issues and push
@twymer
twymer / gist:1045445
Created June 24, 2011 19:09
Delete buffer but don't close screen split
function! s:closebufnotwindow(arg)
let bufnum = bufnr("%")
exe "enew"
exe "bd" . bufnum
endfunction
command! -nargs=* Bsnazzy call s:closebufnotwindow('<args>')
@twymer
twymer / vim move
Created May 20, 2011 15:18
Move a file to a new location, open this new file, and delete the old buffer.
function! s:movefunction(arg)
let oldnum = bufnr("%")
let newname = a:arg
execute "!mv %" . " " . newname
exe "new " . newname
exe "bd" . oldnum
endfunction
command! -nargs=* Newmv call s:movefunction('<args>')