Skip to content

Instantly share code, notes, and snippets.

@innyso
innyso / ansible_babun.md
Created June 15, 2016 00:28
Getting ansible working on babun

When using ansible on babun I am getting the following error

 [main] python2.7 16500 child_info_fork::abort: address space needed by '_speedups.dll' (0x4B0000) is already occupied

The error was due to the the _speedups.dll provided in markupsafe python library.

Uninstall the markupsafe (I have to do it manually)

@innyso
innyso / path_in_cygwin.md
Created May 23, 2016 00:45
Correct reference path in cygwin

In cygwin, when referring path from the c drive, make sure we add /cygdrive before the /c/folder1/folder2

@innyso
innyso / for_loop_in_makefile.md
Last active May 9, 2020 12:01
#makefile #forloop #syntax

how to do for loop in makefile

COFFEETYPE=flatwhite latte cappuccino 

forloop-test:
  $(foreach coffee, $(COFFEETYPE), echo $(coffee);)
@innyso
innyso / check_cmd_exist_in_make.md
Last active May 16, 2020 05:30
#makefile #cmd #exist #syntax #snippet

Check if a command exist in Makefile

LS := ; @which ls > /dev/null

ifndef LS
$(eval ls := $(shell which ls))
else
$(eval ls := something/ls
endif
@innyso
innyso / jinja2_template_file.md
Last active May 16, 2020 05:31
#python #jinja #template #input #snippet

Code snippet for how to use jinja2 with file as an input for template.

from jinja2 import Environment,FileSystemLoader

env = Environment(loader=FileSystemLoader('files'))
template = env.get_template('somefilename.sh.j2')
output = template.render(name='elmo')
print output
@innyso
innyso / copy_paste_babun_vim.md
Last active April 11, 2020 12:19
#vim #windows #cygwin #babun

Getting copy and paste working for vim in babun

Add this to your .vimrc so you can paste using right click on the mouse

set mouse-=a
@innyso
innyso / block_cursor_cygwin.md
Last active April 11, 2020 12:19
#vim #windows #cygwin #babun

Block cursor for vim in cygwin/babun

Put this in .vimrc

let &t_ti.="\e[1 q"
let &t_SI.="\e[5 q"
let &t_EI.="\e[1 q"
let &t_te.="\e[0 q"
@innyso
innyso / dos2unix.md
Last active May 9, 2020 11:56
#windows #linux #convert #dos #unix

when using babun, after importing .vimrc there was a lot of errors with ^M. Needs to convert file from unix to dos

find ~/.vim -type f | xargs dos2unix

@innyso
innyso / command_ps_memory_leak.md
Created March 31, 2016 03:47
Command for seeing which app has memory leak

Error saying fork: Cannot allocate memory

ps --sort -rss -eo rss,pid,command | head

@innyso
innyso / check_puppet_agent_disable.md
Created March 30, 2016 04:54
Check whether puppet agent is disable or not

if puppet agent is disabled, there will be a agent_disabled.lock file in the following location

/var/lib/puppet/state/agent_disabled.lock