Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexey lanceon

View GitHub Profile
@lanceon
lanceon / KeycloakAdminClientExample.java
Created Aug 10, 2021 — forked from thomasdarimont/KeycloakAdminClientExample.java
Using Keycloak Admin Client to create user with roles (Realm and Client level)
View KeycloakAdminClientExample.java
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@lanceon
lanceon / modern_js.md
Created Apr 23, 2021 — forked from gaearon/modern_js.md
Modern JavaScript in React Documentation
View modern_js.md

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@lanceon
lanceon / README.md
Created May 26, 2020 — forked from zoilomora/README.md
How to disable systemd-resolved in Ubuntu
View README.md

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

View README.md

To achieve this you can setup DNS Proxy Mode using the host's resolver with the following command: VBoxManage modifyvm "VM name" --natdnshostresolver1 on

As the result, guest OS DNS requests will be intercepted and resolved using host DNS API, rather than having guest OS connect to external DNS servers as with --netdnsproxy1 on.

You can get the name of the VM by running VBoxManage list runningvms.

@lanceon
lanceon / nginx-tls.conf
Created Aug 11, 2018 — forked from gavinhungry/nginx-tls.conf
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
View nginx-tls.conf
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are omitted here.
#
# Example: https://www.ssllabs.com/ssltest/analyze.html?d=gavinhungry.io
#
@lanceon
lanceon / http-benchmark.md
Created Mar 28, 2018 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
View http-benchmark.md
@lanceon
lanceon / TestMultipartFileUpload.scala
Created Feb 9, 2018 — forked from jrudolph/TestMultipartFileUpload.scala
akka-http Multipart file-upload client + server example
View TestMultipartFileUpload.scala
package akka.http.scaladsl
import java.io.File
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.util.ByteString
import scala.concurrent.duration._
import akka.actor.ActorSystem
View git-tag-delete-local-and-remote.sh
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@lanceon
lanceon / js-error-logging-services.md
Created Nov 10, 2017 — forked from cheeaun/js-error-logging-services.md
JavaScript error logging services
View js-error-logging-services.md