Skip to content

Instantly share code, notes, and snippets.

@kozak127
kozak127 / main.py
Created April 16, 2023 15:43
Microsoft ToDo -> Google Calendar Tasks migration script
from __future__ import print_function
import os.path
import json
import time
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
import keyboard
import time
import random
while True:
keyboard.press_and_release("F13")
interval = random.randint(1, 179)
time.sleep(interval)
@kozak127
kozak127 / osx_docker_machine_eval.sh
Last active January 5, 2021 16:16
OSX CMD Docker DockerCompose Toolchain
# paste this into .zshrc/.bashrc
# check if `docker-machine` command exists
if command -v docker-machine > /dev/null; then
# fetch the first running machine name
local machine=$(docker-machine ls | grep "Running" | head -n 1 | awk '{ print $1 }')
if [ "$machine" != "" ]; then
eval "$(docker-machine env $machine)"
fi
fi
@kozak127
kozak127 / CustomRsqlVisitor.java
Created May 5, 2020 22:27
RSQL JPA Specification SpringBoot nestedProperties
import cz.jirutka.rsql.parser.ast.AndNode;
import cz.jirutka.rsql.parser.ast.ComparisonNode;
import cz.jirutka.rsql.parser.ast.OrNode;
import cz.jirutka.rsql.parser.ast.RSQLVisitor;
import org.springframework.data.jpa.domain.Specification;
public class CustomRsqlVisitor<T> implements RSQLVisitor<Specification<T>, Void> {
private RsqlSpecificationBuilder<T> builder;
@kozak127
kozak127 / wol.instructions
Last active September 12, 2017 08:20
Wake On Lan Linux
WOL_DISABLE=N in /etc/default/tlp
NETDOWN=no in /etc/default/halt
sudo systemctl enable wol@eth3
#############################
### GENERATE CERT AND KEY ###
#############################
# when generating key and cert, use password provided by administrator
cd ~/Workspace/Silvermedia/vpn
kozak127@callisto:~/Workspace/Silvermedia/vpn$ openssl pkcs12 -in michal.wesoly.p12 -nocerts -nodes -out michal.wesoly.key
Enter Import Password:
#!/bin/bash
chromium-browser-bin --process-per-tab "$@"
{
"caret_style": "blink",
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"font_size": 12,
"highlight_line": true,
"ignored_packages":
[
"Markdown",
"Vintage"
],
@kozak127
kozak127 / xfce4-keyboard-shortcuts.xml
Last active October 27, 2016 16:37
Code snippet to paste to xfce4-keyboard-shortcuts.xml file
<property name="XF86AudioNext" type="string" value="dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"/>
<property name="XF86AudioPrev" type="string" value="dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"/>
<property name="XF86AudioPlay" type="string" value="dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"/>
<property name="XF86AudioStop" type="string" value="dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"/>
#!/bin/bash
#Give a name to the terminal window.
TITLE="desktop_terminal"
#HxW size given in # of charactors. Example: 25x60
DIMENSIONS=130x45
#X+Y position given in pixels. Example: 100+200
POSITION=0+0
TERMOPTS="--default-working-directory=~ --display=:0 --maximize --hide-borders --hide-toolbar --hide-menubar --title=$TITLE"
if [[ -z $DIMENSIONS || -z $POSITION ]] || [[ -z $TITLE ]] ; then