Skip to content

Instantly share code, notes, and snippets.

@diablowu
diablowu / dish-grid-gen.py
Created May 28, 2024 08:12
generated a dish antenna model file (mmana-gal)
import numpy as np
import math
def generate_circle_points(diameter, num_points,z):
angles = np.linspace(0, 2 * np.pi, num_points, endpoint=False)
x_coords = diameter / 2 * np.cos(angles)
y_coords = diameter / 2 * np.sin(angles)
z_coords = np.full(num_points, z)
return x_coords, y_coords, z_coords
FROM alpine:3.12
WORKDIR /app/src
RUN echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.12/main" > /etc/apk/repositories \
&& echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.12/community" >> /etc/apk/repositories \
&& apk update && apk add git \
&& apk add build-base automake autoconf libxml2 fuse-dev curl-dev \
&& git clone https://github.com/s3fs-fuse/s3fs-fuse.git . \
&& ./autogen.sh && ./configure && make && make install
@diablowu
diablowu / 0000README.md
Created June 18, 2020 06:46 — forked from tobert/0000README.md
G1GC / CMS

G1GC v.s. CMS for Cassandra 2.0

Many people have asked me about using the G1 garbage collector with Cassandra. Since most of my customers are running 2.0 in production the test is with 2.0 for now. Once I script it up I'll re-run the numbers with 2.1.

I also need to re-test with Java 7 and the Oracle JDKs.

TL;DR

@diablowu
diablowu / jdk8-jvm.options
Created April 13, 2020 08:37
jdk8-jvm.options
-Xmx8G
-Xms8G
-Xmn2G
-Xss256k
-XX:MaxMetaspaceSize=256M
-XX:+HeapDumpOnOutOfMemoryError
-XX:+AlwaysPreTouch
-XX:+UseTLAB
-XX:+ResizeTLAB
-XX:+UseNUMA
@diablowu
diablowu / nginx.conf
Created May 29, 2019 05:40 — forked from fotock/nginx.conf
Nginx SSL 安全配置最佳实践.
# 生成 dhparam.pem 文件, 在命令行执行任一方法:
# 方法1: 很慢
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# 方法2: 较快
# 与方法1无明显区别. 2048位也足够用, 4096更强
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
@diablowu
diablowu / grunt-hugo-lunrjs.md
Created May 28, 2019 01:01 — forked from sebz/grunt-hugo-lunrjs.md
hugo + gruntjs + lunrjs = <3 search
@diablowu
diablowu / mirror.yml
Created November 14, 2018 02:52
glide mirror.yml
repos:
- original: https://golang.org/x/arch
repo: https://github.com/golang/arch
vcs: git
- original: https://golang.org/x/benchmarks
repo: https://github.com/golang/benchmarks
vcs: git
- original: https://golang.org/x/blog
repo: https://github.com/golang/blog
vcs: git
public class Parser {
public static void main(String[] args) throws IOException, ResourceException, ScriptException {
GroovyScriptEngine gse = new GroovyScriptEngine(new String[]{"E:/works/dsl/src"});
Binding b = new Binding();
Script script = gse.createScript("main.groovy",b);
script.evaluate("print 123");
script.run();
// gse.run("main.groovy",)
@diablowu
diablowu / readfile.js
Created June 16, 2016 15:42
read 3 file with callback , Promise and generator
'use strict'
var co = require('co')
var fs = require('fs')
var cofs = require('co-fs')
var r1 = exports.r1 = function(fileName){
fs.readFile(fileName, (err,data)=>{
fs.readFile(data.toString().trim(), (err,data)=>{
fs.readFile(data.toString().trim(),(err,data)=>{
@diablowu
diablowu / catalina.sh
Created April 29, 2016 06:54
catalina.sh
export JAVA_OPTS="-Xmx1g -Xms1g -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=256M $JAVA_OPTS"
export JAVA_OPTS="-XX:+AggressiveOpts -XX:+UseBiasedLocking $JAVA_OPTS"
export JAVA_OPTS="-XX:+UseConcMarkSweepGC -XX:+UseParNewGC $JAVA_OPTS"
export JAVA_OPTS="-XX:+UseFastAccessorMethods -XX:+CMSParallelRemarkEnabled $JAVA_OPTS"