Skip to content

Instantly share code, notes, and snippets.

Avatar
🕺

John Ahlroos johndevs

🕺
View GitHub Profile
@johndevs
johndevs / vpn-util.sh
Created Aug 27, 2021
Gnome extension script for toggling OpenVPN 3 tunnel status
View vpn-util.sh
#!/bin/bash
#
# Provides a utility script for https://gitlab.com/XavierBerger/custom-vpn-toggler to toggle a OpenVPN 3 tunnel
#
# Steps to install:
# 1. Install OpenVPN 3 by following https://www.cactusvpn.com/tutorials/how-to-set-up-openvpn-3-linux/
# 1. Download this script and save it somewhere
# 2. Install the Gnome extension https://extensions.gnome.org/extension/4061/custom-vpn-toggler/
# 3. Set the script path to point to this script
View keybase.md

Keybase proof

I hereby claim:

  • I am johndevs on github.
  • I am johndevs (https://keybase.io/johndevs) on keybase.
  • I have a public key ASAh6m8x22AwLjjs9v4GBDXwhHKbFPpnLF5Bs01pVkePHQo

To claim this, I am signing this object:

@johndevs
johndevs / h2tocsv.java
Created Jan 19, 2021
H2 to CSV export
View h2tocsv.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//
// This is a JBang script. You need JBang to run this script.
//
// To learn more go to https://www.jbang.dev and install JBang.
//
// Run this script:
//
// ./h2tocsv -d <database.mv.db> -t <table> [-f <output file>] [-u db user] [-p db password]
//
@johndevs
johndevs / get-all-files.gql
Last active Mar 19, 2022
Github GraphQL - Get all file contents in repository
View get-all-files.gql
# Provide $query as a variable.
# The query is the same as you would enter into the search field e.g. "org:johndevs in:name feedreader"
query GetFilesQuery($branch: GitObjectID, $query: String!) {
search(first: 1, type: REPOSITORY, query: $query) {
edges {
node {
... on Repository {
object(expression: "master:", oid: $branch) {
... on Tree {
@johndevs
johndevs / maven-reports.groovy
Created Feb 19, 2018
Maven dependency report
View maven-reports.groovy
#!/usr/bin/groovy
import groovy.xml.MarkupBuilder
def lines = System.in.newReader().readLines()
// Only get INFO lines and the module header
.grep { String line -> line.startsWith('[INFO] ') || line.contains('Building ')}
// Remove the INFO tag
.collect { String line -> (line.split(' ') - '[INFO]').join(' ') }
lines = lines
@johndevs
johndevs / plugin.xml
Last active Dec 9, 2016
Hide plugin preference page depending on if plugin is installed (why doesn't this work?)
View plugin.xml
<extension point="org.eclipse.ui.propertyPages">
<page id="com.example.ProjectPreferencesPage"
class="com.example.MyProjectPreferencePage"
category="my-category"
name="Exaple">
<hiddenWhen>
<adapt type="org.eclipse.core.runtime.Platform">
<with variable="platform">
<test property="org.eclipse.core.runtime.isBundleInstalled" args="some.other.plugin"/>
</with>
@johndevs
johndevs / build.gradle
Last active Apr 12, 2017
Sample build.gradle template for Gradle Vaadin Plugin projects
View build.gradle
/**
* Applies the latest version of the Vaadin plugin to the project. If a specific
* version of the plugin is wanted, append "?version=0.7" to the url.
*/
apply from: 'http://plugins.jasoft.fi/vaadin.plugin'
/**
* The vaadin extension configures different aspects of how the vaadin plugin behaves
* in the project.
*/