Skip to content

Instantly share code, notes, and snippets.

View CraKeyBoy's full-sized avatar
💭
I may be slow to respond.

CraKeyBoy CraKeyBoy

💭
I may be slow to respond.
View GitHub Profile
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@CraKeyBoy
CraKeyBoy / encryption.java
Created December 24, 2018 06:16 — forked from itarato/encryption.java
Java AES CBC encryption example
package com.company;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.security.SecureRandom;
public class Main {
@CraKeyBoy
CraKeyBoy / A_Logstash.conf
Created December 28, 2018 03:19 — forked from smougenot/A_Logstash.conf
Logstash Multiline Filter for Java Stacktrace (tested on field)
# stacktrace java as one message
multiline {
#type => "all" # no type means for all inputs
pattern => "(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)"
what => "previous"
}
@CraKeyBoy
CraKeyBoy / content.md
Created December 28, 2018 06:54 — forked from baymaxium/content.md
Splunk和ElasticSearch深度对比解析

原文:运维帮

随着Splunk越来越被大家熟知和认可,现在市面上也不断涌各种同类产品,作为大数据搜索界的翘楚Splunk和ElasticSearch,绝对值得我们去学习,探索和使用,因此为了造福Splunk的铁粉和新粉们,小编特邀了Splunk的资深架构师,江湖人称“陶指导”的陶刚为大家就架构,功能,产品线,概念等方面将Splunk和ElasticSearch做了一下全方位的对比,希望能够给大家在制定大数据搜索方案的时候有所帮助。

陶刚在Splunk上海担任资深架构师,负责数据采集和云平台产品的技术架构。 拥有丰富的企业级产品的开发经验,对数据科学,数据可视化和机器学习等领域有着浓厚的兴趣。同时是足球和炉石传说的狂热爱好者,也是大圣庞卡足球队的当家球霸和炉石传说俱乐部最受追捧的明星会长。

本文就架构,功能,产品线,概念等方面就ElasticSearch和Splunk做了一下全方位的对比,希望能够大家在制定大数据搜索方案的时候有所帮助。

@CraKeyBoy
CraKeyBoy / .curlrc
Created September 17, 2019 14:40 — forked from asmega/.curlrc
default proxy for curl in .curlrc
proxy=http://username:password@host:port

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
@CraKeyBoy
CraKeyBoy / PoolSizeCalculator.java
Created January 19, 2020 10:11
A class that calculates the optimal thread pool boundaries. It takes the desired target utilization and the desired work queue memory consumption as input and retuns thread count and work queue capacity.
/**
* A class that calculates the optimal thread pool boundaries. It takes the desired target utilization and the desired
* work queue memory consumption as input and retuns thread count and work queue capacity.
*
* @author Niklas Schlimm
*
*/
public abstract class PoolSizeCalculator {
/**
@CraKeyBoy
CraKeyBoy / README.md
Created May 8, 2020 15:24 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@CraKeyBoy
CraKeyBoy / Activate Office 2019 for macOS VoL.md
Created July 2, 2020 07:23 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@CraKeyBoy
CraKeyBoy / mac-cheatsheet.markdown
Created March 13, 2021 10:58 — forked from Muscliy/mac-cheatsheet.markdown
你每天都在使用的 Mac 键盘,其实还暗藏了这些秘密

这些技巧,能让工作效率更上一个台阶

键盘,可以算是最传统的输入设备之一。在计算机尚未诞生时,就已被广泛地用在打字机上。即使是在交互方式不断突破的今天,没人能够否认,传统的键盘依然处在人机交互的中心地位。我们使用电脑的绝大部分时间都是在敲击键盘中度过的,键盘使用的熟练度和舒适度直接影响着工作效率。因此,了解、熟练使用、甚至根据个体需求改造键盘,往往能够极大的提升工作效率。在本文中,笔者将将结合自己的使用经验,探讨一些能够提升 macOS 系统的键盘使用效率的方法与技巧。

被遗忘的 Control (⌃) 与 Option (⌥)

几乎所有对 macOS 系统有一定了解的用户都知道,macOS 的系统快捷键是以 Command (⌘) 为中心的。实际上,Control 键和 Option 键也暗藏不少秘密。

Control (⌃)