Skip to content

Instantly share code, notes, and snippets.

View leolin310148's full-sized avatar

Leo Lin leolin310148

View GitHub Profile
@leolin310148
leolin310148 / java_download.sh
Created August 29, 2024 04:00 — forked from wavezhang/java_download.sh
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@leolin310148
leolin310148 / foo.kt
Created March 22, 2023 07:22
kotlin operation function return self can invoke forever
enum class Foo {
HELLO,
WORLD,
//
;
var i = 0
}
@leolin310148
leolin310148 / gist:f1770ea02592e0111470b62ad172ccd0
Created March 31, 2020 04:40
AWS RDS reset master password
aws rds modify-db-instance --db-instance-identifier ${db-identifier} --master-user-password ${pwd}
find . -name '*.txt' | xargs wc -l
static {
HttpsURLConnection.setDefaultHostnameVerifier((s, sslSession) -> true);
TrustManager[] trustManagers = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
statsd:
image: hopsoft/graphite-statsd
ports:
- 8080:80
- 2003-2004:2003-2004
- 2023-2024:2023-2024
- 8125:8125/udp
- 8126:8126
@leolin310148
leolin310148 / solve.md
Last active November 22, 2019 12:46
solve "error initializing graphdriver: loopback attach failed" for docker-in-docker

Create loopback.sh in tmp

#!/bin/bash
ensure_loop(){
  num="$1"
  dev="/dev/loop$num"
  if test -b "$dev"; then
    echo "$dev is a usable loop device."
 return 0
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.16/vue.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div id="vue">
StockPrices = new Mongo.Collection("StockPrices")
if (Meteor.isClient) {
Template.body.helpers({
stockPrices: function () {
return StockPrices.find({}, {sort: {tlong: -1}});
}
});
@leolin310148
leolin310148 / ParseJsonToXml.groovy
Created June 14, 2015 09:49
Parse json to xml using groovy
import groovy.json.JsonSlurper
import groovy.xml.MarkupBuilder
def jsonString = "{" +
" \"result\": [" +
" {" +
" \"Name\": \"John\"," +
" \"Department\": \"001\"" +
" }," +
" {" +