Skip to content

Instantly share code, notes, and snippets.

@tobidope
tobidope / main.py
Created December 2, 2021 06:22
AOC2021 day2
data = """
"""
def solve1(data):
hpos = 0
depth = 0
for instruction in data.splitlines():
direction, number = instruction.split()
number = int(number)
if direction == "forward":
map = """\
......#...........#...#........
.#.....#...##.......#.....##...
......#.#....#.................
..............#.#.......#......
.....#.#...##...#.#..#..#..#..#
.......##...#..#...........#...
.......#.##.#...#.#.........#..
..#...##............##......#.#
.......#.......##......##.##.#.
package test.picocli;
import io.micronaut.configuration.picocli.PicocliRunner;
import io.micronaut.context.ApplicationContext;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
import picocli.CommandLine.Parameters;
@tobidope
tobidope / pom.xml
Created February 9, 2020 15:11
Minimale pom für ein Micronaut CLI Projekt
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test.picocli</groupId>
<artifactId>test-picocli</artifactId>
<version>0.1</version>
<properties>
<micronaut.version>1.3.0</micronaut.version>
<jdk.version>13</jdk.version>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
@tobidope
tobidope / .block
Last active September 22, 2017 11:29
Tracking Experiment
license: mit
@tobidope
tobidope / vpnbook
Last active December 8, 2020 16:11
Simple script to extract the ever changing credentials from the website of the VPN provider VPNBook. Especially useful on OpenWRT based routers.
#!/bin/sh
# Extracts the user and password for the VPNBook free VPN service
# out of their web site
# URL to the site containing user and password
SITE="http://www.vpnbook.com/freevpn"
# File where VPNBook credentials get stored
AUTH_FILE="/etc/openvpn/vpnbook.auth"
# Path to temporary file
AUTH_FILE_TMP="/tmp/vpnbook.$$"