Skip to content

Instantly share code, notes, and snippets.

View ik5's full-sized avatar
🎯
Focusing

ik5 ik5

🎯
Focusing
View GitHub Profile
@ik5
ik5 / config
Created February 8, 2019 10:47
my ~/.ssh/config
Host *
ControlPath ~/.ssh/sockets/master-%l-%r@%h:%p
ControlMaster auto
GSSAPIAuthentication=no
ServerAliveInterval 25
Compression yes
IdentityFile ~/.ssh/id_rsa
#ControlPersist yes
UseRoaming no
@ik5
ik5 / gist:5ae5a706397b0f4e90df1101b2494f6f
Created March 12, 2019 05:34 — forked from milosgajdos/gist:9f68b1818dca886e9ae8
Add a VLAN interfaces into Docker from the host machine
package main
import (
"fmt"
"log"
"net"
"github.com/milosgajdos83/tenus"
)
@ik5
ik5 / gist:6e383127ef12b5eb1281df3948d6458f
Created March 12, 2019 05:34 — forked from milosgajdos/gist:296fb90d076f259a5b0a
Add a MAC VLAN interfaces into Docker from the host machine
package main
import (
"fmt"
"log"
"net"
"github.com/milosgajdos83/tenus"
)
@ik5
ik5 / interfaces.go
Created March 26, 2019 06:51
list all ethernet interfaces and its data including mtu, state etc...
package main
import (
"fmt"
"net"
)
func main() {
ifaces, err := net.Interfaces()
for _, iface := range ifaces {
@ik5
ik5 / vim_cheatsheet.md
Created April 17, 2019 16:22 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@ik5
ik5 / int_to_ip.rb
Created June 5, 2019 11:17
short script to convert 32 bit integer to IPv4
#!/usr/bin/env ruby
require 'ipaddr'
ARGV.each do |int|
puts "#{int} = #{IPAddr.new(int.to_i, Socket::AF_INET).to_s}"
end
@ik5
ik5 / tmux-cheatsheet.markdown
Created June 17, 2019 05:29 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ik5
ik5 / schema-bad
Created June 25, 2019 08:58
simple schema for blog post
From - String
To - String/List of string
Message - String
@ik5
ik5 / custom_json_unmarshal.go
Last active April 15, 2025 13:27
Example of custom unmarshal of JSON in golang
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type To []string
@ik5
ik5 / language-layout.vue
Created July 22, 2019 10:01
solving layout changes in Vue.js
<template>
<ul class="language-selector">
<li
v-for="(language, idx) in $i18n.availableLocales"
:class="{selected: language === $i18n.locale}"
>
<a @click="changeLayout(language, $t(`languages.list[${idx}].bidi`))>
<Flag
:country="$t(`languages.list[${idx}].country-code`)"
:title="language"