Skip to content

Instantly share code, notes, and snippets.

View mkozjak's full-sized avatar

Mario Kozjak mkozjak

View GitHub Profile
@mkozjak
mkozjak / Toggle Safari Picture-in-Picture.applescript
Last active August 29, 2023 12:54 — forked from ybbond/Toggle Safari Mute.applescript
This will trigger Safari.app Picture-in-Picture without the need to "Allow JavaScript from Apple Events"
--------------------------------------------------------------------------------
# Auth: Yohanes Bandung Bondowoso, Mario Kozjak
# dCre: 2021-07-11 20:18
# dMod: 2023-08-19 15:51
# Appl: System Events, PIPAgent, Safari
# Task: Toggle Picture in Picture (PiP) on and off
# Libs: None
# Osax: None
# Aojc: True
# Tags: @Applescript, @Script, @System_Events, @PictureInPicture, @PiP, @Safari
@mkozjak
mkozjak / DefaultKeyBinding.dict
Created September 23, 2022 10:21 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@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:

@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
@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 / 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 / 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 / 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