Skip to content

Instantly share code, notes, and snippets.

View mkozjak's full-sized avatar

Mario Kozjak mkozjak

View GitHub Profile
@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 / 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 / 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 / simple_args_parsing.sh
Created March 20, 2019 11:23 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@mkozjak
mkozjak / gist:a19a754840f9b7e6afe6c96a312cce58
Created April 5, 2019 11:13 — forked from ejmr/gist:453edc19dd596e472e90
Update Git Submodules After Each Merge or Pull
#!/bin/sh
#
# This simple shell script is a Git hook that will automatically
# update all submodules any time you perform a merge or pull.
# This can be useful because you can do things like...
#
# $ git checkout master && git pull
#
# ...without having to remember to potentially update any
# submodules in the repository.
@mkozjak
mkozjak / rsa_util.go
Created June 26, 2019 15:38 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@mkozjak
mkozjak / open-vm-tools-vmware-ubuntu-sharing.md
Created July 21, 2019 13:17 — forked from darrenpmeyer/open-vm-tools-vmware-ubuntu-sharing.md
open-vm-tools and VMWare Shared Folders for Ubuntu guests

(NB: adapted from this Ask Ubuntu thread -- tested to work with Ubuntu 16 LTS branches and Ubuntu 17.10)

Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools package doesn't auto-mount shared VMWare folders. This can be frustrating in various ways, but there's an easy fix.

TL;DR

Install open-vm-tools and run:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
curl -d '{"hiddenListingIds":[],"schoolPolygons":{},"searchQuery":{"@type":"query.listing","ui-settings":{"sorting":{},"filters":{"YEAR_BUILT":{"max":null,"min":null},"SHOW_HIDDEN_HOMES":false,"HAS_PARKING":false,"IS_NEW_CONSTRUCTION":false,"FOR_SALE":true,"SHORT_SALE":false,"KEYWORDS":[],"AREA_PROPERTY_LARGE":{"min":null,"max":null},"LOT_SIZE_IN_ACRES":0,"PRICE_SALE":{"min":null,"max":null},"OPENHOME":false,"AREA_HOME":{"min":null,"max":null},"BEDROOMS":null,"COMING_SOON":false,"PRICE_REDUCED":false,"PROPERTY_SUBTYPE":[],"ACTIVE":false,"PENDING":false,"RECENTLY_SOLD":false,"BATHROOMS":null,"FORECLOSURES":false,"AREA_PROPERTY_SMALL":{"min":null,"max":null}},"map":{},"search":{"data":{"cityId":"REG-6582273003562340352-2","city":"Austin","state":"TX"},"type":"city"}},"listing":{"sorting":[{"LISTING_UPDATE_DATE":"DESC"}],"flags":{"clustersZoomLevel":4},"selector":{"filter":{"facet":{"$elemMatch":{"STATE":{"$eq":"TX"},"CITY":{"$eq":"Austin"}}},"$and":[{"$or":[{"$and":[{"facet":{"$elemMatch":{"LISTING_CATEGORY_ID"
2020-04-16 10:47:29 +0000 UTC info: Running Mender version 2.2.0
2020-04-16 10:47:29 +0000 UTC debug: handle update fetch state
2020-04-16 10:47:29 +0000 UTC debug: status reported, response 204 No Content
2020-04-16 10:47:30 +0000 UTC debug: Received fetch update response &{200 OK 200 HTTP/1.1 1 1 map[Last-Modified:[Thu, 16 Apr 2020 10:46:13 GMT] Accept-Ranges:[bytes] X-Amz-Id-2:[0g+34W7mTK0aEoD75Md0hqffNmfE/GHria7N4LBG3yAHn384JD4qv4dmRxZL8H2K3cntVuWzMww=] X-Amz-Request-Id:[693EE3AA81C2C818] Date:[Thu, 16 Apr 2020 10:47:30 GMT] Content-Length:[645017600] Server:[AmazonS3] Etag:["cc35966358d983004cdaa46a914a8cad"] X-Amz-Tagging-Count:[1] Content-Type:[application/vnd.mender-artifact]] 0x26f5420 645017600 [] false false map[] 0x2508600 0x2846060}+
2020-04-16 10:47:30 +0000 UTC info: State transition: update-fetch [Download_Enter] -> update-store [Download_Enter]
2020-04-16 10:47:30 +0000 UTC debug: handle update install state
2020-04-16 10:47:30 +0000 UTC debug: status reported, response 204 No Content
2020-04
@mkozjak
mkozjak / raspberry-pi-vpn-router.md
Created September 4, 2020 14:16 — forked from superjamie/raspberry-pi-vpn-router.md
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: