Skip to content

Instantly share code, notes, and snippets.

View vrudikov's full-sized avatar

Valentin vrudikov

  • Blackhorse Inc
  • Wastelands
View GitHub Profile
@vrudikov
vrudikov / 00README.md
Created March 9, 2021 20:26 — forked from envieid0c/00README.md
StrongSwan IKEv2 for macOS, iOS 10, Windows 10 and BlackBerry 10 With Local DNS Cache (Unbound), Dnscrypt-proxy + (Cloudflare DoH) for IPv4/6

StrongSwan IKEv2 for macOS, iOS 11, Windows 10 and BlackBerry 10 With Local DNS Cache (Unbound), Dnscrypt-proxy + (Cloudflare DoH) for IPv4/6

This setup is for remote users to connect into an office/home LAN using a VPN (ipsec). This is based on (but not the same as) the strongSwan documentation and this guide: https://raymii.org/s/tutorials/IPSEC_vpn_with_Ubuntu_16.04.html

  • StrongSwan 5.6.2
  • Dnscrypt-proxy 2.0.12
  • Unbound 1.7.1

Set up DNS service Set up a network interface for DNS listening

@vrudikov
vrudikov / UserRestControllerTest.java
Created November 28, 2018 15:25 — forked from ekswai/UserRestControllerTest.java
spring oauth2 rest template with client credentials grant sample
import org.junit.Test;
import org.junit.runner.RunWith;
import org.master.Application;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;
@vrudikov
vrudikov / instructions.txt
Created July 5, 2018 20:14 — forked from nathanborror/instructions.txt
Example Kubernetes setup with Postgres and two Services for serving an API and a static site using Ingress. Also have a CronJob example for kicks.
*** Cluster Setup for Google Container Engine ***
0/ Install and configure local gcloud and kubectl: https://cloud.google.com/sdk/docs/
> gcloud components install kubectl
1/ Configure Google Cloud account:
> gcloud config set account YOUR_EMAIL_ADDRESS
> gcloud config set project YOUR_PROJECT_ID
> gcloud config set compute/zone us-west1-a
> gcloud config set container/cluster example
@vrudikov
vrudikov / BasicJacksonCodec.java
Created June 21, 2018 21:20 — forked from ersiner/BasicJacksonCodec.java
Basic Jackson Codec for Netty
import com.fasterxml.jackson.databind.ObjectMapper;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageCodec;
import java.util.List;
public class BasicJacksonCodec<T> extends ByteToMessageCodec<T> {
@vrudikov
vrudikov / GmailHelper.java
Created January 9, 2018 15:02 — forked from nutanc/GmailHelper.java
Helper class for Gmail API to send and receive mails
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.auth.oauth2.TokenResponse;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.auth.oauth2.GoogleTokenResponse;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpTransport;
@vrudikov
vrudikov / Application.java
Created October 10, 2017 11:16 — forked from serac/Application.java
Configuring RestTemplate for Client TLS in a Spring Boot Application
/*
* See LICENSE for licensing and NOTICE for copyright.
*/
package edu.vt.middleware.app;
import java.io.File;
import java.security.*;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/pem.h>
#include <openssl/cms.h>
#include <openssl/err.h>
#include "gost_lcl.h"
/* Convert little-endian byte array into bignum */
@vrudikov
vrudikov / gist:b551127281b2f817bbae3690a15c5960
Created August 7, 2017 13:44 — forked from asilchev/gist:3742724
Пример подписывания SOAP
package ru.cti.crypto;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.security.Key;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.Provider;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
@vrudikov
vrudikov / MockSMTPRule.java
Created May 12, 2017 19:30 — forked from jcsirot/MockSMTPRule.java
SMTP server mock as a JUnit TestRule
package com.chelonix.selenium;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.dumbster.smtp.SimpleSmtpServer;
import com.dumbster.smtp.SmtpMessage;
import com.google.common.collect.Lists;
import org.junit.rules.ExternalResource;
@vrudikov
vrudikov / changelog.xml
Created May 3, 2017 21:05 — forked from jonniesweb/changelog.xml
Liquibase configuration for setting the MySql engine and charset for each table
<changeSet>
<createTable>
...
</createTable>
<!-- Place this <modifySql> block at the bottom of each table definition. Search and replace works really well. -->
<modifySql dbms="mysql">
<append value="ENGINE=INNODB DEFAULT CHARSET=UTF8"/>
</modifySql>
</changeSet>