Skip to content

Instantly share code, notes, and snippets.

View kosmatov's full-sized avatar

Konstantin Kosmatov kosmatov

  • Servers.com
  • Cyprus
View GitHub Profile

Getting started with docker inside colima on Mac OS

NOTE: This is experimental way to setup the project

How it works TL;DR

Colima is a wrapper for Lima (Linux Machines) VM on Mac OS. Colima provides transparent access to container runtime inside a Lima VM so it looks like you work with container runtime on your host machine — you can use docker and docker-compose the same way as on Linux. Your home directory mounts directly inside the Lima VM in read/write mode. It provides a good performance with sshfs mounts but colima declare a much better performance with virtiofs

Requriements

Mac OS version 13.0 or later with installed homebrew

@kosmatov
kosmatov / vim-ssh-pbcopy
Last active December 7, 2020 08:27
Vim pbcopy through SSH
$ tail -3 ~/.ssh/config
Host pbcopy-host
HostName 10.0.1.1
User key
$ cat ~/.vimrc | grep pbcopy
Plug 'ahw/vim-pbcopy'
let g:vim_pbcopy_remote_cmd = "ssh pbcopy-host pbcopy"
$ cat .git/hooks/commit-msg
#!/bin/sh
ticket=`cat $1 | grep "PROJ-"`
if [ -z "${ticket}" ]; then
ticket_num=`git branch | grep "*" | grep -o "[0-9]*"`
if [ ${ticket_num} -gt 10 ]; then
echo "$(cat $1) PROJ-${ticket_num}" > $1
fi
fi
@kosmatov
kosmatov / application.js
Created November 15, 2012 10:01
Sortable
//= require jquery
//= require jquery_ujs
//= require jquery.ui.sortable
//= require sortable
@kosmatov
kosmatov / image-preview-html5.js
Created August 13, 2012 13:46
Image file preview on HTML5/JS/jQuery
$('form').on('change', '.image_preview input[type="file"]', function(e) {
var files = e.target.files,
f = files[0],
reader = new FileReader(),
t = this
;
reader.onload = (function(file) {
@kosmatov
kosmatov / calc.rb
Created July 20, 2012 03:42
Calculator
require 'sort_station'
station = SortStation.new(ARGV[0].to_s)
puts station.expr.join(' ')
@proc_stack = []
station.expr.each do |op|
if op.is_a?(Float)