Skip to content

Instantly share code, notes, and snippets.

@innyso
innyso / mount_external_rw.md
Last active April 12, 2020 11:13
#cmd #osx #mount

osx mount external drive in rw

sudo mount -u -o rw /Volumes/Untitled
@innyso
innyso / command_prepend_timestamp.md
Last active May 16, 2020 05:25
#linux #cmd #timestamp

Prepend timestamp to command

command | ts '[%Y-%m-%d %H:%M:%S]'
@innyso
innyso / heredoc_dockerfile.md
Created January 25, 2017 00:49
Workaround heredoc in Dockerfile
RUN echo 'workaround:\n\
  heredoc: in dockerfile\n\
just another level of yml:\n\
  something: else\n\
  >> some_output.yml
@innyso
innyso / calling_other_targets_with_param_in_makefile.md
Last active May 9, 2020 12:02
#makefile #calling #target #syntax

calling other targets with parameters in Makefile

build:
  docker-compose build

stop:
  docker-compose stop ${service}
  
remove:
 yes | docker-compose rm ${service}
@innyso
innyso / vim-golang-ide.md
Last active April 11, 2020 12:18
#vim #golang

The aim of this is to setup vim for golang development on my mac. Things that we are looking for is:

  • autocomplete especially for buildin method and variables in the same file
  • shortcut for running test and building code
  • method listing
  1. Make sure I have xcode commandline installed so that I can install the latest vim using brew in the next step without getting some sort of ruby error xcode-select --install

  2. Need to get latest vim with lua support

@innyso
innyso / docker_cooperate_proxy.md
Last active April 12, 2020 11:16
#docker #macos #proxy

using docker for mac behind cooperate proxy

Assuming that you are behind a cooperate proxy and running cntlm or squid to proxy all your outgoing traffic to the interweb.

When using docker for Mac, becuase docker for mac provision a xhyve VM under the hood, so having set the docker preference proxy setting to http[s]://localhost:3128 is not going to help as localhost == xhyve VM not the Mac.

Logging into the xhyve VM

@innyso
innyso / pip_list_upgrade.md
Last active April 12, 2020 11:17
#python #pip

list and upgrade pip modules

pip list --outdated | cut -d' ' -f1 | xargs pip install -U
@innyso
innyso / atreus_fireware_upload_command.md
Last active April 27, 2020 23:40
#keyboard #atreus

command for upload firmware to atreus and the most important is to remeber the usb device identifier

make upload KEYMAP=mykeymapfile USB=/dev/cu.usbmodem1421
@innyso
innyso / babun_golang_setup.md
Last active July 14, 2016 05:19
Setting up Golang on babun

When setting up golang in babun or cygwin, make sure we set the following

export GOROOT=<<root to your go installtion. e.g. "c:\tools\go">>>
export GOPATH=<<full path to working dir in qoute, cant use linux style path e.g. "c:\workspace\">>
@innyso
innyso / container_arbitrary_uid.md
Created June 22, 2016 03:04
Support Arbitrary user ids

When running container in container with arbitrary user id but you want a proper uid to perform task like git pull or any runnable container task.

User nss_wrapper

in Dockerfile

yum install nss_wrapper
.....
command ["./startup.sh"]