Skip to content

Instantly share code, notes, and snippets.

@ytfei
ytfei / main.go
Last active May 18, 2022 05:50
如何使用mnemonic生成bip-39账号
package main
import (
"fmt"
"github.com/miguelmota/go-ethereum-hdwallet"
"github.com/tyler-smith/go-bip39"
"log"
)
func main() {
@ytfei
ytfei / start-test.sh
Created April 17, 2020 06:22
spring boot app 部署脚本
#!/bin/sh
# 测试环境使用的启动脚本
# 增加了 jacoco/remote debug,JVM 参数资源最小化
FILE_NAME=app.jar
cd `dirname $0`
LOG_FILE=./logs/run.out
if [ ! -f "$LOG_FILE" ]; then
touch $LOG_FILE
@ytfei
ytfei / iterm2-solarized.md
Created September 30, 2019 23:48 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ytfei
ytfei / gist:9eb31b21534dfd47a10ee94cb22c398e
Created July 20, 2018 08:05 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@ytfei
ytfei / gist:7b12b54d127b47a87d13
Last active September 5, 2022 14:38
Java Mail -- send mail through SMTP with GMail
/**
* Copied from stackoverflow. But I couldn't find the origin link anymore :(.
*/
public class MailSender {
/**
* Send email using GMail SMTP server.
*
* @param username GMail username
* @param password GMail password
* @param recipientEmail TO recipient
@ytfei
ytfei / sitemap.xml
Created January 30, 2014 02:18
generate jekyll sitemap without plugin
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>{{ site.url }}/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
@ytfei
ytfei / .gitignore
Last active December 22, 2015 10:39
AVL Tree Implementation.
*.gch
*.dot
*.out
core
*.swp
# config/initializers/will_paginate.rb
require 'will_paginate/view_helpers/link_renderer'
require 'will_paginate/view_helpers/action_view'
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= BootstrapLinkRenderer
super.try :html_safe
end
@ytfei
ytfei / Endpoint.scala
Created September 5, 2012 07:52
Endpoint
case class Endpoint(provisionId: String, brandId: String,
imei: String, locale: String, model: String, msisdn: String,
os: String, osVersion: String, vendor: String, version: String) {
private val PROVISIONING_ID = "PROVISIONING_ID"
private val BRAND_ID = "BRAND_ID"
private val IMEI = "IMEI"
private val LOCALE = "LOCALE"
private val MODEL = "MODEL"
private val MSISDN = "MSISDN"