Skip to content

Instantly share code, notes, and snippets.

View zacker330's full-sized avatar
🌧️

Jack Zhai zacker330

🌧️
View GitHub Profile
@zacker330
zacker330 / promtail_docker_logs.md
Created December 15, 2023 12:12 — forked from ruanbekker/promtail_docker_logs.md
Docker Container Logging using Promtail
@zacker330
zacker330 / electron-sqlite3.md
Created April 1, 2019 03:18 — forked from jonataswalker/electron-sqlite3.md
Electron SQLite3 Integration

Electron SQLite3 Integration

When trying to use the node-sqlite3 module in Electron I got the error:

Error: Cannot find module '/path/to/my/application/node_modules/sqlite3/lib/binding/electron-v1.4-linux-x64/node_sqlite3.node'

Using Ubuntu 16.04 with Node 7.1.0 and Electron 1.4.12.

I read the following:

@zacker330
zacker330 / .git-commit-template.txt
Created March 25, 2019 00:15 — forked from jmaxhu/.git-commit-template.txt
一份建议的git commit模板
# <类型>: (类型的值见下面描述) <主题> (最多50个字)
# 解释为什么要做这些改动
# |<---- 请限制每行最多72个字 ---->|
# 提供相关文章和其它资源的链接和关键字
# 例如: Github issue #23
# --- 提交 结束 ---
# 类型值包含
@zacker330
zacker330 / gist:de85eb0ac2b16db39e22b7ce620e88d2
Created January 3, 2019 12:02 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@zacker330
zacker330 / nginx.conf
Created September 13, 2017 09:03 — forked from morhekil/nginx.conf
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '
@zacker330
zacker330 / gist:93b7ad8a253c609b5e5b075ba3e123d3
Created January 14, 2017 04:53 — forked from reiz/gist:6203767
Creating a MavenProject from an ArtifactInfo inside a maven plugin.
protected MavenProject buildProjectModel(ArtifactInfo artifactInfo) throws Exception {
try {
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setLocalRepository( localRepository );
configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
configuration.setProcessPlugins( false );
configuration.setRepositoryMerging( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT );
Properties properties = new Properties( );
for ( String key : session.getSystemProperties( ).keySet() ){
properties.put( key, session.getSystemProperties().get(key) );
@zacker330
zacker330 / README.md
Created February 9, 2016 23:55 — forked from chuckg/README.md
Bootstrap an image for use as a Vagrant base box

Requirements

Prepare virtual machine

@zacker330
zacker330 / 0_reuse_code.js
Created July 7, 2014 06:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zacker330
zacker330 / README.md
Created October 13, 2013 01:49 — forked from nikcub/README.md