Skip to content

Instantly share code, notes, and snippets.

View rhzs's full-sized avatar
🏠
Working from home

Ryuici rhzs

🏠
Working from home
View GitHub Profile
@rhzs
rhzs / convey_tests.yaml
Created April 7, 2024 07:51 — forked from bparli/convey_tests.yaml
Cloudformation template for Convey Test/Benchmarks
AWSTemplateFormatVersion: '2010-09-09'
Description: Convey Test/Benchmark Environment
Parameters:
AmiId:
Type: String
Default: 'ami-03d5c68bab01f3496'
@rhzs
rhzs / busted-output.txt
Created July 26, 2023 20:54 — forked from suprememoocow/busted-output.txt
Testing Redis Lua Scripts
●●
2 successes / 0 failures / 0 errors / 0 pending : 0.008108 seconds
@rhzs
rhzs / s3.go
Created July 22, 2023 11:53
Golang S3 Download and Return as io.Reader
package aws
import (
"bytes"
"context"
"io"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
@rhzs
rhzs / salsa20_example.go
Created September 11, 2022 07:59 — forked from bokwoon95/salsa20_example.go
golang x/crypto/salsa20 example
// https://play.golang.org/p/UPn9o_AMpmr
package main
import (
"fmt"
"golang.org/x/crypto/salsa20"
)
var key = [32]byte{}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rhzs
rhzs / alpine_dns_issue.md
Last active November 18, 2021 14:32
Docker Alpine DNS Issue and Solution: Alpine 3.14 and Docker Desktop 4.6.0 (Mac OS 11.3.1 / BigSur)

Issue

After installing apk add curl and apk add g++. There have been broken with resolving DNS name when resolving DNS like github.com. This prevents us to download necessary packages.

Solution

  1. Run docker exec -it container_id /bin/bash
  2. Edit vi /etc/resolv.conf and add nameserver 8.8.8.8

Ack

@rhzs
rhzs / rm_mysql.md
Created October 25, 2020 16:08 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

[package]
name = "http"
description = "HTTP server"
version = "0.0.1"
license = "MIT"
authors = ["Singh <singh@google.com>"]
edition = "2018"
[[bin]]
name = "http"
[package]
xxxx
[dependencies]
actix = "0.10.0-alpha.3"
actix-cors = "0.3.0-alpha.1"
actix-http = "2.0.0-beta.3"
actix-rt = "1"
actix-service = "1.0.6"
actix-web = { version = "3.0.0-beta.3", features = ["rustls"] }
@rhzs
rhzs / lib.rs
Last active September 6, 2020 11:03
Actix User Middleware with lifetime
use actix_http::Error;
use actix_service::ServiceFactory;
use actix_web::{dev, web, App};
use sqlx::{AnyPool};
pub fn create_app(
data: &Data,
) -> App<
impl ServiceFactory<