Skip to content

Instantly share code, notes, and snippets.

View saragluna's full-sized avatar

Xiaolu Dai saragluna

  • Shanghai
View GitHub Profile
@saragluna
saragluna / wsl2-with-1password-info.md
Created October 7, 2023 08:15 — forked from WillianTomaz/wsl2-with-1password-info.md
Instructions for using 1Password SSH Agent with WSL2 (on Windows 11)

Saturday, April 22, 2023

How to Use 1Password SSH Agent with WSL2 (on Windows 11)

  • Note:

    • Always look for the official documentation, this tutorial may not suit you as there are new updates to the installation process.
    • References are at the end of the document.
  • Was used:

    • Windows 11 (x64)
    • WSL 2 (Ubuntu 22.04.2 LTS)
@saragluna
saragluna / README.md
Created October 7, 2023 07:40 — forked from QNimbus/README.md
SSH Agent forwarding WSL2

SSH Agent forwarding in WSL2

Download npiperelay

To communicate between WSL and the 1Password SSH agent, we'd need to use npiperelay. This tool allows WSL to communicate with Windows' named pipes.

To install it, we need to open the GitHub repository and download the latest release. At the time of writing this post the latest release is v0.1.0 from July 2, 2020.

Unzip it and paste the npiperelay.exe file in any folder that's configured in your system's PATH. For example %USERPROFILE%/.wsl/mpiperelay.exe and then add %USERPROFILE%/.wsl to your PATH.

@saragluna
saragluna / complete_list_of_configuration_properties.yml
Created January 18, 2022 12:46
Spring Cloud Azure 4.0 configuration properties
# This is the yaml file to try with all Spring Cloud Azure properties
spring:
cloud:
azure:
client:
application-id: abc
amqp:
transport-type: amqp
http:
connect-timeout: 2s
@saragluna
saragluna / spring_cloud_azure_autoconfiguration_champion_scenarios.md
Last active August 10, 2023 09:40
Spring Cloud Azure autoconfiguration champion scenarios
@saragluna
saragluna / SpringResourceManagerUsages.java
Last active December 17, 2021 15:32
The Spring Cloud Azure Resource Manager is an abstract layer for azure-resource-manager. It can read metadata from ARM as well as create resources.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
/**
* The Spring Cloud Azure Resource Manager is an abstract layer for azure-resource-manager. It can read metadata from ARM
* as well as create resources.
*/
public class SpringResourceManagerUsages {
@saragluna
saragluna / SpringServiceUsages.java
Last active December 17, 2021 15:01
Spring Cloud Azure Service module is an extra abstraction layer for putting all Azure Service client builder factories. This is because we may want to use *ClientBuilderFactory in all Spring Cloud Azure modules, for example, spring-messaging-azure-servicebus and spring-cloud-azure-autoconfigure will both use the ServiceBusClientBuilderFactory.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
/**
* Spring Cloud Azure Service module is an extra abstraction layer for putting all Azure Service client builder
* factories. Since we want to use *ClientBuilderFactory in all Spring Cloud Azure modules, for example,
* spring-messaging-azure-servicebus and spring-cloud-azure-autoconfigure will both use the
* {@link ServiceBusClientBuilderFactory}, so we put all the factories for
* service client builder in this module.
@saragluna
saragluna / SpringCoreUsages.java
Last active December 17, 2021 14:39
This the gist to demo how to use spring-cloud-azure-core module. The spring-cloud-azure-core module is the core module of all Spring Cloud Azure libraries. It tries to unify the build process of Azure Service client builders.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
/**
* The spring-cloud-azure-core module is the core module of all Spring Cloud Azure libraries. It tries to unify the
* build process of Azure Service client builders.
*/
public class SpringCoreUsages {
//============================
@saragluna
saragluna / springel_classloader.md
Last active August 25, 2018 10:59
SpringEL evaluation fail the third time

SpringEl fail the third time

The First Look

Our project use springel to evaluate expressions and one strange error happens. It seems like that the first two evaluations are always successful, however when it comes to the third time the evaluation begins to fail. After tracing down the source code we find the reason.

/**
 * Compile the expression if it has been evaluated more than the threshold number
 * of times to trigger compilation.