Skip to content

Instantly share code, notes, and snippets.

@AveYo
AveYo / .Files.bat
Last active October 13, 2024 00:43
Files.html listing from directory context-menu ( or simpler, but less fancy Files.xml )
;@echo off &title Files.html listing from directory context-menu by AveYo v1.0
;if not exist "%~1" ( goto :setup ) else pushd "%~1\.." &echo Listing "%~1" - please wait... &set "fn=%~nx1 Files.html"
;del /f/q "%fn%" >nul 2>nul &cd.>"%fn%" 2>nul
;if exist "%fn%" ( set "files=%CD%\%fn%" ) else set "files=%USERPROFILE%\Desktop\%fn%"
;pushd "%~1"
;set "ampersand=&" &set "escape=&"
;> "%files%" findstr -bv ; "%~f0"
;>>"%files%" echo ^<p^>%DATE%, %TIME%^</p^>^<div class="filetree"^>
;>>"%files%" <nul set/p="<ul class="main-tree"><li class="tree-title">%~1</li>"
;>>"%files%" echo.
create table "Tickers_Data"
(
ticker integer not null
constraint tickers_data_ticker_foreign
references "Tickers",
time date not null,
low double precision not null,
high double precision not null,
open double precision not null,
close double precision not null,
@litvil
litvil / CamelKafkaAvroDeserializer.java
Created June 8, 2018 16:59
Camel Kafka Avro serializer and deserializer
package com.company.mapping;
import io.confluent.common.config.ConfigException;
import io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient;
import io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer;
import io.confluent.kafka.serializers.KafkaAvroDeserializerConfig;
import org.apache.kafka.common.serialization.Deserializer;
import java.util.Collections;
import java.util.List;
@jeffjohnson9046
jeffjohnson9046 / spring-cloud-config-decrypt-curl.sh
Last active August 5, 2019 23:38
Use the Spring Cloud Config service to encrypt/decrypt an encrypted value
# Encrypt
curl -sbiL -X POST http://localhost:8888/encrypt -d '[the value you want to encrypt]'
# Decrypt
curl -sbiL -X POST http://localhost:8888/decrypt -d '[the encrypted value, without the "{cipher}" prefix]'
@Aghassi
Aghassi / docker-compose.yml
Last active July 18, 2024 17:29
LinuxServer Docker Compose: Plex, Sonarr, Radarr, NZBGet, Let's Encrypt, Time Machine
version: '2'
services:
plex:
image: linuxserver/plex
container_name: plex
volumes:
- /path/to/plex/config:/config
- /path/to/plex/Movies:/data/movies
- /path/to/plex/Shows:/data/tvshows
- /path/to/plex/transcode:/data/transcode
FROM alpine:3.7
RUN echo 'http://dl-4.alpinelinux.org/alpine/edge/community/' >> /etc/apk/repositories
ENV PYTHON_VERSION=2.7.14-r2
ENV PY_PIP_VERSION=9.0.1-r1
ENV SUPERVISOR_VERSION=3.3.1
ENV NGINX_VERSION=1.12.2-r3
RUN mkdir /www && mkdir /www/myapp/
@ValentinTrinque
ValentinTrinque / GenericRecordFixtureFactory.java
Created January 23, 2018 17:27
Generate GenericRecord using Avro
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.reflect.ReflectData;
import java.util.Arrays;
public class GenericRecordFixtureFactory {
public static GenericRecord createFromEvent(String siteId, String visitorId, String timestampMs) {
EventMock eventMock = new EventMock();
#!/bin/bash
# Taken from http://rustyautopsy.github.io/rabbitholes/2014/10/21/vmcreate/
# Original author: Travis Dolan
DEFAULT_DISK_SIZE=32
DEFAULT_MEMORY=2048
DEFAULT_SOCKETS=1
DEFAULT_CORES=2
DEFAULT_ISO='ubuntu-14.04-server-amd64.iso'
@SeanSobey
SeanSobey / portainer.md
Last active June 12, 2024 07:40
Portainer Setup on Windows 10

Portainer on Windows 10

Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.

Using host.docker.internal

This setup will let you run Portainer on windows by using the host.docker.internal endpoint (docker.for.win.localhost is depricated since docker version 3.2.1, but older versions may use this instead).

Please note:

@jeffjohnson9046
jeffjohnson9046 / curl-cloud-config-props.sh
Last active May 26, 2022 17:35
use curl to check out a Spring Boot applicaion's configuration properties from a Spring Cloud Configuration service
# Occasionally I want to see the application properties that are pulled down from the Spring Cloud Config service that provides
# content to our Spring Boot apps. Since I seem to have to re-discover this every time, I figured I'd write it down to help me
# remember.
#
# Additional docs can be found here: https://cloud.spring.io/spring-cloud-config/single/spring-cloud-config.html
# To see the output in YML format
curl -u {the user name}:{the user password} http://{the domain:port}/{the application name}-{the spring profile name}.yml
# For example: