Skip to content

Instantly share code, notes, and snippets.

View mkozjak's full-sized avatar

Mario Kozjak mkozjak

View GitHub Profile
@mkozjak
mkozjak / gist:84710ba2c2661882bcab23d9a8f0e9bd
Created September 16, 2016 22:56
Uninstall XQuartz.app from OSX Yosemite/El Capitan/Sierra
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist && \
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist && \
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz && \
sudo pkgutil --forget org.macosforge.xquartz.pkg && \
rm -rf ~/.serverauth* && rm -rf ~/.Xauthorit* && rm -rf ~/.cache && rm -rf ~/.rnd && \
rm -rf ~/Library/Caches/org.macosforge.xquartz.X11 && rm -rf ~/Library/Logs/X11
@mkozjak
mkozjak / drop_encrypt.go
Created January 12, 2017 09:21 — forked from josephspurrier/drop_encrypt.go
Golang - Drag and Drop AES Encryption and Decryption
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
"os"
@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:

@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
@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"
)