Skip to content

Instantly share code, notes, and snippets.

@coreequip
coreequip / GrayLogHandler.groovy
Last active July 15, 2019 08:09
Groovy Util.Logging Graylog Handler
package com.acme.logging
import groovy.json.JsonOutput
import java.nio.charset.StandardCharsets
import java.util.logging.Handler
import java.util.logging.Level
import java.util.logging.LogRecord
class GrayLogHandler extends Handler {
@coreequip
coreequip / short-ali.userscript.js
Last active August 29, 2022 17:32 — forked from eremin/ageShot.js
Aliexpress/eBay/Gearbest URL Shortener
// ==UserScript==
// @name Aliexpress/eBay/Gearbest/Amazon URL Shortener
// @namespace http://tampermonkey.net/
// @version 0.5
// @author hedgehog, core.equip
// @match https://*.aliexpress.com/item/*
// @match https://*.ebay.de/itm/*
// @match https://*.ebay.com/itm/*
// @match https://*.gearbest.com/*
// @match https://*.amazon.de/*
@coreequip
coreequip / Upgrade Ubuntu for LXSS.md
Last active May 3, 2017 11:57
Bash for Windows (LXSS Linux Subsystem)

Upgrade Ubuntu for LXSS

  • sudo nano /etc/update-manager/release-upgrades
    Change Promt to Prompt=normal
  • sudo do-release-upgrade -f DistUpgradeViewNonInteractive -d
    Because "screen" is broken.
  • If it hangs (it will), press Ctrl-C, then:
    sudo dpkg --configure -a
  • Then
    sudo apt update
@coreequip
coreequip / cybersale-pushbullet.gs
Created October 13, 2016 12:12
Cyberport Cybersale PushBullet PushOver Google Script 😎
function fetchSale() {
var xml = UrlFetchApp.fetch('https://www.cyberport.de/feed.php?ft=NEWS&ff=rss').getContentText();
var root = XmlService.parse(xml).getRootElement();
var entries = root.getChild('channel').getChildren('item');
var res = '';
entries.forEach(function(el){
if (el.getChild('link').getText() != 'https://www.cyberport.de/cybersale') return;
var diff = (new Date()).getTime() - (new Date(el.getChild('pubDate').getText())).getTime()
if (diff > 864e5) return;
@coreequip
coreequip / rot13.js
Created September 27, 2016 08:19
ROT13 JavaScript One-Liner
// var s = 'text';
s.replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});
// "grkg"
@coreequip
coreequip / version.groovy
Last active January 17, 2018 14:13
Read version from MANIFEST.MF in groovy
// Reads the "Implementation-Version" from META-INF/MANIFEST.MF
def version = getClass().package?.implementationVersion == null ? '0.DEV' : getClass().package?.implementationVersion
@coreequip
coreequip / internetbs-topdns-dyndns.md
Created May 12, 2015 08:15
InternetBS / TopDNS DynDNS API Description

InternetBS / TopDNS DynDNS API Description

If you are using Linux, it is possible to use wget to update the IP. Here is a sample URL:

https://dyndns.topdns.com/update?hostname=www.example.com&username=myusername&password=mypassword

The above one will detect your IP automatically and perform the update. If you want to update with a custom IP address you can use:

https://dyndns.topdns.com/update?hostname=www.example.com&username=myusername&password=mypassword&myip=192.168.0.1
@coreequip
coreequip / replace-prototype.js
Created March 12, 2015 11:38
A String.replacePlaceholder- function - Call: 'Text {place} and {holder}'.replacePlaceholder({ 'place': 'foo', 'holder': 'bar' })
String.prototype.replacePlaceholder=function(A){return this.replace(/\{(\w+)}/g,function(B,C){return A[C]})};
(function( $ ) {
$.fn.readOnlySuffix = function(suffix) {
return this.each(function() {
var $this = $(this),
suffixLength = suffix.length,
oldValue = suffix,
mouseIsDown = false;
// Must be a text input or text area
if (!($this.is(":text") || $this.tagName.toLowerCase() == "textarea")){
@coreequip
coreequip / printf.js
Created September 3, 2014 13:22
A String.format - function, Call: String.format('Text {0} und {1}', 'asdf', 'asdf');
String.prototype.format = function (B){var A=Array.prototype.slice.call(arguments,1);return B.replace(/\{(\d+)\}/g,function(C,D){return A[D]})}