This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function bw_unlock() { | |
| if ! bw unlock --check; | |
| then | |
| export BW_SESSION="$(bw unlock --raw)" | |
| fi | |
| } | |
| function tsh_login() { | |
| bw_unlock | |
| password=$(bw get password <teleport-vault-name>) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import datadog.trace.api.DDTags | |
| import io.opentracing.Span | |
| import io.opentracing.Tracer | |
| import io.opentracing.log.Fields | |
| import io.opentracing.tag.Tags | |
| import io.opentracing.util.GlobalTracer | |
| suspend fun <T : Any, O> T.coRunTraced( | |
| methodName: String, | |
| block: suspend T.(Span) -> O, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.emotimer.presentation.handler | |
| import kotlinx.coroutines.flow.flow | |
| import kotlinx.coroutines.reactive.asPublisher | |
| import kotlinx.coroutines.reactor.awaitSingle | |
| import org.dhatim.fastexcel.Workbook | |
| import org.reactivestreams.Publisher | |
| import org.springframework.core.io.buffer.DataBuffer | |
| import org.springframework.core.io.buffer.DefaultDataBufferFactory | |
| import org.springframework.http.ContentDisposition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright 2019 the original author or authors. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * https://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TokenUtil | |
| { | |
| private const string Alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
| private static readonly Random Random = new Random(); | |
| /// <summary> | |
| /// ๋๋ค ํ ํฐ ์์ฑ๊ธฐ, ์์ ์๊ฐ์ ์์กด๋จ | |
| /// NOTE : ๊ฐ๋ ฅํ ๋๋ค ์คํธ๋ง ์์ฑ๊ธฐ๊ฐ ํ์ํ๋ค๋ฉด | |
| /// https://stackoverflow.com/questions/32932679/using-rngcryptoserviceprovider-to-generate-random-string ์ฐธ๊ณ | |
| /// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CryptoUtil | |
| { | |
| public static byte[] EncryptAes256(byte[] bytes, byte[] key) | |
| { | |
| using var aes = new RijndaelManaged | |
| { | |
| Key = CreateDeriveBytes(key, 32), | |
| }; | |
| aes.GenerateIV(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CryptoUtil | |
| { | |
| public static byte[] EncryptAes256(byte[] bytes, byte[] key) | |
| { | |
| using var aes = new RijndaelManaged | |
| { | |
| Key = CreateDeriveBytes(key, 32), | |
| }; | |
| aes.GenerateIV(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | awk '{print $2}' | grep ^/aws/codebuild/Kizuna | while read x ; do MSYS2_ARG_CONV_EXCL=\* aws logs delete-log-group --log-group-name $x; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Microsoft.Extensions.Diagnostics.HealthChecks; | |
| using Microsoft.Extensions.Logging; | |
| namespace Common.Api.HealthCheck | |
| { | |
| public class DatabaseHealthCheck<TDbContext> : IHealthCheck where TDbContext : DbContext | |
| { | |
| private readonly ILogger _logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class Base64Helper | |
| { | |
| /// <summary> | |
| /// Convert to url safe base 64 | |
| /// </summary> | |
| /// <param name="base64">base64 string</param> | |
| /// <returns></returns> | |
| public static string ToSafeBase64(string base64) | |
| { | |
| return base64 |
NewerOlder