Skip to content

Instantly share code, notes, and snippets.

View mkozjak's full-sized avatar

Mario Kozjak mkozjak

View GitHub Profile
@mkozjak
mkozjak / gcrgc.sh
Created October 25, 2018 10:20 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@mkozjak
mkozjak / reset_routing_table.sh
Created June 15, 2018 13:38 — forked from midwire/reset_routing_table.sh
Reset routing table on OSX
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times
@mkozjak
mkozjak / disable_vim_auto_visual_on_mouse.txt
Created June 14, 2018 12:59 — forked from u0d7i/disable_vim_auto_visual_on_mouse.txt
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
@mkozjak
mkozjak / ruby-on-raspbian.md
Created May 27, 2018 16:52
Script to Install Latest Ruby on Raspberry Pi (Raspbian)
# Install asdf, our Ruby version manager
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc

# Install dependencies (source: https://github.com/asdf-vm/asdf/blob/master/README.md)
sudo apt-get update
sudo apt-get install automake autoconf libreadline-dev libncurses-dev libssl-dev libyaml-dev libxslt-dev libffi-dev libtool unixodbc-dev
Add: ":NSPhotoLibraryUsageDescription" Entry Already Exists
Add: ":NSMicrophoneUsageDescription" Entry Already Exists
Add: ":NSCameraUsageDescription" Entry Already Exists
Info: creating stash file /private/tmp/prepared/ios/scripts/.build.oJmihXiwQhLv8lBw/.qmake.stash
[11:29:58]: x27[33mGet started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfilex27[0m
[11:29:59]: x27[32m---------------------------------x27[0m
[11:29:59]: x27[32m--- Step: update_project_team ---x27[0m
[11:29:59]: x27[32m---------------------------------x27[0m
[11:29:59]: Updating development team (764E32E93Y) for the given project 'myapp.xcodeproj/project.pbxproj'
[11:29:59]: x27[32mSuccessfully updated project settings to use Developer Team ID '764E32E93Y'x27[0m
@mkozjak
mkozjak / golang_on_rpi.md
Created February 4, 2018 08:41 — forked from simoncos/golang_on_rpi.md
Install Golang 1.9 on Raspberry Pi

Install Golang 1.9:

wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile

If already installed old golang with apt-get:

// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
5E618435888B9D49F8540165 = {
buildActionMask = 2147483647;
files = (
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/go-log/log"
packages = [".","log"]
revision = "37e2e1f19306361e1fc152a1839f1236149cb4e4"
version = "v0.1.0"
[[projects]]
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="./lib/rpcwebsockets.js"></script>
<script type="text/javascript">
function myFunction() {
var ws = new RPCWebSocket("ws://127.0.0.1:3333")
ws.once("open", function() {
console.log("socket opened")
'use strict'
var rws = require('rpc-websockets')
var wss = new rws.Server({ port: 3333 })
wss.register('sum', function(params) {
return params[0] + params[1]
})