Skip to content

Instantly share code, notes, and snippets.

@nxzz
nxzz / led_control.sh
Created February 28, 2026 01:10
Wedge100BF-32X LED control
#!/bin/bash
# led_control.sh - Wedge100BF-32X LED control based on SONiC port state
# Runs on HOST, executes bfshell via docker exec into syncd container
#
# Usage:
# ./led_control.sh # one-shot update
# ./led_control.sh --watch # continuous monitoring (every 5 seconds)
# ./led_control.sh --off # all LEDs off
#
# LED color codes:
@nxzz
nxzz / main.md
Last active March 27, 2020 17:19
Node Exporter 導入メモ
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
tar zxvf node_exporter-0.18.1.linux-amd64.tar.gz 
cp node_exporter-0.18.1.linux-amd64/node_exporter /usr/local/bin/node_exporter
vim /etc/systemd/system/node_exporter.service 
systemctl daemon-reload
systemctl start node_exporter.service
systemctl enable node_exporter.service
# remove KnoenHosts
term_.command.removeAllKnownHosts();
@nxzz
nxzz / index.js
Created July 16, 2019 00:49
DB演習 ORM課題1
const Sequelize = require('sequelize');
const sequelize = new Sequelize(
'database', '', '', {
dialect: 'sqlite',
storage: __dirname + '/main.sqlite3',
}
);
const Product = sequelize.define('products',
{
@nxzz
nxzz / merge.md
Last active June 19, 2019 11:46 — forked from jt/merge.md
Merge a forked gist

If someone forks a gist and you'd like to merge their changes. Do this:

  1. clone your repo, I use the name of the gist

     git clone git@gist.github.com:1166108.git
    
  2. add a remote for the forked gist, I'm using the name of my fellow developer

     git remote add aaron git@gist.github.com:83e037bb8af86fe476d11c8201737ccf.git
    
// Wire - Version: Latest
#include <Wire.h>
// 各DACのアドレス
#define AK449X2_J12L_U2_ADDR (0x10) // CAD1 0 CAD2 0 J12 = 2-3 U2
#define AK449X2_J12L_U1_ADDR (0x11) // CAD1 0 CAD2 1 J12 = 2-3 U1
#define AK449X2_J12H_U2_ADDR (0x12) // CAD1 1 CAD2 0 J12 = 1-2 U2
#define AK449X2_J12H_U1_ADDR (0x13) // CAD1 1 CAD2 1 J12 = 1-2 U1
// ボリューム
@nxzz
nxzz / 0-install.md
Last active April 20, 2019 11:03 — forked from takehironet/0-install.md
Kagoya の OpenVZ Ubuntu 14.04 に Asterisk 16 をインストール

構成

Kagoya の OpenVZ Ubuntu 14.04 に Asterisk 16 をインストールする。

インストール

Asterisk 16を展開

$ wget https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-16.3.0.tar.gz
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <time.h>
#include <PubSubClient.h>
// WiFi
#define STASSID "wlanAP"
#define STAPSK "wlanPSK"
// MQTT
// Wire - Version: Latest
#include <Wire.h>
// 各DACのアドレス
#define AK449X2_J12L_U2_ADDR (0x10) // CAD1 0 CAD2 0 J12 = 2-3 U2
#define AK449X2_J12L_U1_ADDR (0x11) // CAD1 0 CAD2 1 J12 = 2-3 U1
#define AK449X2_J12H_U2_ADDR (0x12) // CAD1 1 CAD2 0 J12 = 1-2 U2
#define AK449X2_J12H_U1_ADDR (0x13) // CAD1 1 CAD2 1 J12 = 1-2 U1
// 切り替え検出に使うDDCのピン
00H 10001111 32bit i2s, RST Disable,MCLK Auto Set
01H 00100010 Default
02H 00000000 Default (MonoMode L 00001000 R 00001010)
03H 11111111 Default Lch 0dB
04H 11111111 Default Rch 0dB
05H 00000000 Default
06H 00000000 Default
07H 00000001 Default
08H 00000000 Default
09H 00000000 Default