Skip to content

Instantly share code, notes, and snippets.

View jaxkodex's full-sized avatar

Jorge Vilca jaxkodex

View GitHub Profile
@jaxkodex
jaxkodex / compose.yaml
Created May 1, 2025 21:00
TrueNAS Scale configuration for Tailscale & Traefik
services:
tailscale:
cap_add:
- NET_ADMIN
- SYS_MODULE
container_name: tailscale
environment:
- TS_STATE_DIR=/var/lib/tailscale
- TS_AUTHKEY=tskey-auth-***
- TS_SERVE_PORT=80,443,8080
urlShortenerBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref SiteName
PublicAccessBlockConfiguration:
BlockPublicAcls: 'true'
BlockPublicPolicy: 'false'
IgnorePublicAcls: 'true'
RestrictPublicBuckets: 'false'
WebsiteConfiguration:
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const webpack = require('webpack');
module.exports = {
mode: process.env.WEBPACK_SERVE ? 'development' : 'production',
@jaxkodex
jaxkodex / MockExample.java
Last active October 5, 2017 15:17 — forked from tolbertam/MockExample.java
Session Mock Example
import com.datastax.driver.core.*;
import org.mockito.Mockito;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
/**
* Created by atolbert on 1/26/15.
*/
@jaxkodex
jaxkodex / SpringPropertiesConfig.java
Created February 9, 2017 23:23 — forked from jeffsheets/SpringPropertiesConfig.java
Spring 4 Properties Java Configuration with Database-backed Properties along with File properties too
/**
* Example of Spring 4 Properties Java Configuration,
* with a Database Properties table to store most values
* and a small application.properties file too.
* The Database table will take precedence over the properties file with this setup
*/
@Configuration
@PropertySource(value = { "classpath:application.properties" }, ignoreResourceNotFound=true)
public class SpringPropertiesConfig {
private static final Logger log = LoggerFactory.getLogger(SpringPropertiesConfig.class);
@jaxkodex
jaxkodex / MainJose4jTest.java
Created October 13, 2015 22:27
Jose4j Test - JSON Web Tokens
package org.test.jose4jtest;
import java.io.UnsupportedEncodingException;
import java.security.Key;
import org.jose4j.jws.AlgorithmIdentifiers;
import org.jose4j.jws.JsonWebSignature;
import org.jose4j.jwt.JwtClaims;
import org.jose4j.jwt.MalformedClaimException;
import org.jose4j.jwt.consumer.InvalidJwtException;
import org.jose4j.jwt.consumer.JwtConsumer;
@jaxkodex
jaxkodex / Main.java
Created September 30, 2015 03:20
Image loader
package org.example.filereader;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
# This file must contain only ISO 8859-1 characters.
# See http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html#load(java.io.InputStream)
#
# Property values can:
# - reference an environment variable, for example sonar.jdbc.url= ${env:SONAR_JDBC_URL}
# - be encrypted. See http://redirect.sonarsource.com/doc/settings-encryption.html
#--------------------------------------------------------------------------------------------------
# DATABASE
@jaxkodex
jaxkodex / AES.java
Created January 13, 2015 01:20
Not mine
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.aes;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
@jaxkodex
jaxkodex / DesWrapper,java
Created January 6, 2015 16:48
DES Example
package org.test.java.des;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.InvalidKeyException;