Skip to content

Instantly share code, notes, and snippets.

View l2dy's full-sized avatar

Zero King l2dy

View GitHub Profile
@l2dy
l2dy / colors.py
Created February 22, 2024 12:48 — forked from lilydjwg/colors.py
colors.py: show all kinds of terminal colors at a glance
#!/usr/bin/python3
from functools import partial
def colors16():
for bold in [0, 1]:
for i in range(30, 38):
for j in range(40, 48):
print(f'\x1b[{bold};{i};{j}m {bold};{i};{j} |\x1b[0m', end='')
print()
@l2dy
l2dy / nat.md
Last active May 26, 2021 12:47
OpenSIPS in the Cloud with NAT Support
  1. Install and start rtpproxy, configure firewall to allow UDP ports used.
  2. make menuconfig.
  3. Generate OpenSIPS Script -> Residential Script -> Configure.
  4. Select ENABLE_TLS, USE_AUTH, USE_DIALOG and USE_NAT.
  5. Go back, Generate & Save Residential Script.
  6. Copy etc/opensips_residential_*.cfg to /etc/opensips/opensips.cfg.
  7. Customize opensips.cfg and SIP_DOMAIN, DBENGINE, etc. in opensipsctlrc.
  8. opensipsdbctl create.
  9. systemctl enable opensips.service && systemctl start opensips.service.
  10. opensipsctl add <USER> <PASSWORD>.
@l2dy
l2dy / rkc.js
Last active March 3, 2020 02:49
Replace word with new word of the same length preserving case
#!/usr/bin/env node
const fs = require('fs');
// https://stackoverflow.com/a/17265031
function matchCase(target, pattern) {
var result = '';
for (var i = 0; i < target.length; i++) {
var c = target.charAt(i);

Additional NGINX Metrics

NGINX Amplify Agent can collect a number of additional useful metrics described below. To enable these metrics, please make the following configuration changes. More predefined graphs will be added to the Graphs page if the agent finds additional metrics. With the required log format configuration, you'll be able to build more specific custom graphs.

  • The access.log log format should include an extended set of NGINX variables. Please add a new log format or modify the existing one — and use it with the access_log directives in your NGINX configuration.
log_format  main_ext  '$remote_addr - $remote_user [$time_local] "$request" '
@l2dy
l2dy / nowplaying.js
Created December 26, 2018 15:03 — forked from xreiju/nowplaying.js
osascript -l JavaScript nowplaying.js
const iTunes = Application('iTunes')
const app = Application.currentApplication()
app.includeStandardAdditions = true
const hookURL = 'https://misskey-hook.firebaseapp.comで取得して'
function getTrack(iTunes) {
return iTunes.currentTrack()
}
function getTrackData(iTunes) {
Flag Meaning
C Accepts compressed messages
M Will forward messages to another mix when used as final hop
| final hop |
title datePublished dateModified
Shutdown Causes
2015-07-10
2017-05-11

Shutdown Causes

In your console, you may see messages such as "Previous Shutdown Cause:" followed by a number. The number is a code representing the cause of the

title description ms.prod ms.mktglfcycl ms.sitesec author ms.localizationpriority ms.date
Group Policy settings that apply only to Windows 10 Enterprise and Education Editions (Windows 10)
Use this topic to learn about Group Policy settings that apply only to Windows 10 Enterprise and Windows 10 Education.
w10
manage
library
brianlic-msft
medium
10/13/2017
@startuml
' https://qiita.com/Tachy_Pochy/items/752ef6e3d38e970378f0
/'
図の中で目立たせたいエンティティに着色するための
色の名前(定数)を定義します。
'/
!define MAIN_ENTITY #E2EFDA-C6E0B4
!define MAIN_ENTITY_2 #FCE4D6-F8CBAD
git whatchanged --author=l2dy --diff-filter=A --no-commit-id --name-only | grep -F Portfile