Skip to content

Instantly share code, notes, and snippets.

@Makeshift
Makeshift / tutorial.md
Last active May 6, 2024 17:17
Tutorial for automatically syncing an Obsidian vault with Git on an Android device

How to sync Obsidian with Git on Android

Limitations

  • If Termux is closed in the background by Android, the cron service will stop updating your repository and you must open Termux again. Refer to instructions for your device model to disable the killing of certain background applications.
  • This may negatively affect your devices battery life. I'm not entirely sure yet.

Setup

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 13, 2024 14:01
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@mhzawadi
mhzawadi / logstash.conf
Last active June 12, 2020 19:17
Logstash Grok filters
filter {
if [type] == "apache_access" {
grok {
match => { "message" => "%{COMMONAPACHELOG}" }
}
date {
match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
}
}
@lusis
lusis / 01-relp-rsyslog.conf
Last active November 19, 2015 10:25
nginx logstash cipher logging
$ModLoad omrelp
$RepeatedMsgReduction off
$template ls_json,"{\"@version\":1,\"es_environment\":\"dmz\",\"@timestamp\":\"%timestamp:1:19:date-rfc3339%.%timestamp:1:3:date-subseconds%+00:00\",%HOSTNAME:::jsonf:source_host%,\"message\":\"%timestamp% %app-name%:%msg:::json%\",%syslogfacility-text:::jsonf:facility%,%syslogseverity-text:::jsonf:severity%,%app-name:::jsonf:program%,%procid:::jsonf:processid%}"
*.* :omrelp:X.X.X.X:21514;ls_json
##################### ElasticSearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# ElasticSearch comes with reasonable defaults for most settings,
{
"autocomplete_closures": true,
"autocomplete_builtins": true,
"autocomplete_suggest_imports": true,
"use_named_imports": true,
"fmt_cmd": ["goimports"],
"env":{
"GOROOT": "/Users/shao/Developer/go",
"GOPATH": "/Users/shao/Developer/workspace"
}
@xiocode
xiocode / gist:7596907
Last active December 29, 2015 01:59
elasticsearch settings
/etc/security/limits.conf:
* - nofile 65535
* - memlock unlimited
/etc/elasticsearch/elasticsearch.yml:
index.number_of_shards: 5
index.number_of_replicas: 0
bootstrap.mlockall: true
vi ~/.bashrc
@Yaffle
Yaffle / URLUtils.js
Last active September 5, 2022 02:19
parse URL + absolutize URL in javascript (URLUtils shim - http://url.spec.whatwg.org/#url)
/*jslint regexp: true, maxerr: 50, indent: 2 */
(function (global) {
"use strict";
function URLUtils(url, baseURL) {
var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
if (!m) {
throw new RangeError();
}
@rbranson
rbranson / crossdomain.conf
Created February 3, 2011 21:13
nginx Flash XML policy server
# Add this to your nginx.conf under http { }
server {
listen 843;
server_name localhost;
location / {
rewrite ^(.*)$ /crossdomain.xml;
}