Skip to content

Instantly share code, notes, and snippets.

View DaikiSuganuma's full-sized avatar

SUGANUMA Daiki DaikiSuganuma

View GitHub Profile
@DaikiSuganuma
DaikiSuganuma / Index.html
Last active December 25, 2025 04:59
[セミナー時にリアルタイムでコメントを見える化するシステムをAIで作る](https://blog.dksg.jp/2025/12/ai.html)
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<style>
/* 全体の基本スタイル */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
margin: 0;
padding: 0;
@DaikiSuganuma
DaikiSuganuma / step-cert.sh
Last active December 25, 2025 05:00
[CentOS Stream 10にstep-cliをインストールして別サーバーのstep-caで署名](https://blog.dksg.jp/2025/10/centos-stream-10step-clistep-ca.html)
#!/bin/bash
#================================================================================
#
# Step CA 証明書 発行・更新スクリプト
#
# 概要:
# Step CAサーバーから証明書を新規発行、または既存の証明書を更新します。
# 引数の数によって動作を切り替えます。
#
@DaikiSuganuma
DaikiSuganuma / get_collectd_data.sh
Created September 2, 2025 23:47
collectd/rrdtoolデータ取得。Generated by Gemini 2.5 Pro.
#!/bin/sh
# ==============================================================================
# collectd/rrdtoolデータ取得・整形スクリプト (FreeBSD向け修正版)
#
# 指定した期間のシステムリソース(メモリ、CPU、負荷、ネットワーク)の
# データをcollectdのRRDファイルから抽出し、人間が読みやすい形式で表示します。
# ==============================================================================
# --- 設定項目 ---
@DaikiSuganuma
DaikiSuganuma / collectd.conf
Last active September 1, 2025 01:29
環境: FreeBSD 14.3-RELEASE-p2, Generated by Gemini 2.5 Pro
# /usr/local/etc/collectd.conf
# collectdデーモン設定ファイル
#
# この設定ファイルは、collectd5-5.12.0_23のRRDTOOLオプションのみを有効にしたビルドに基づいています。
#
# collectdの詳細な情報については、公式ドキュメントを参照してください:
# https://collectd.org/documentation.shtml
# ----------------------------------------------------------------------------
# グローバル設定 (Global Settings)
@DaikiSuganuma
DaikiSuganuma / check_mmdb_meta.py
Last active August 31, 2025 23:31
Check metadata of mmdb file. Generate by Gemini 2.5 Pro
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ==============================================================================
# GeoIPデータベース(.mmdb)のメタデータ表示スクリプト
#
# [機能]
# 指定されたGeoLite2-Country.mmdbファイルのメタデータを読み込み、
# 人間が読みやすい形式でターミナルに表示します。
#
@DaikiSuganuma
DaikiSuganuma / update_geoip_rules.sh
Last active August 3, 2025 23:47
日本国以外からのPOSTを拒否するNginx設定をGeoIPで自動化: https://blog.dksg.jp/2025/08/postnginxgeoip.html
#!/bin/sh
# =================================================================
# MaxMind GeoLite2 DBから特定の国のIPリストを抽出し、
# nginxの allow ルールファイルを生成するスクリプト (Python 3.11 対応版)
#
# 依存関係: pkg install py311-maxminddb
# =================================================================
# --- 設定 (ご利用の環境に合わせて変更してください) ---
@DaikiSuganuma
DaikiSuganuma / smb.conf
Last active March 6, 2019 18:16
my samba config file for centos7
# This is the main Samba configuration file. For detailed information about the
# options listed here, refer to the smb.conf(5) manual page. Samba has a huge
# number of configurable options, most of which are not shown in this example.
#
# The Official Samba 3.2.x HOWTO and Reference Guide contains step-by-step
# guides for installing, configuring, and using Samba:
# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# The Samba-3 by Example guide has working examples for smb.conf. This guide is
# generated daily: http://www.samba.org/samba/docs/Samba-Guide.pdf
@DaikiSuganuma
DaikiSuganuma / conf.d|01_hoge.conf
Last active January 27, 2024 00:25
Nginx Configuration Files for WordPress. Nginx is installed by YUM. @see:https://codex.wordpress.org/Nginx
server {
listen 80;
listen [::]:80;
server_name dev.hoge.jp;
return 301 https://dev.hoge.jp$request_uri;
#root /home/httpd/hoge/wordpress;
# WordPress Setting
#include conf.d/global/wordpress_restrictions.conf;
@DaikiSuganuma
DaikiSuganuma / 0_reuse_code.js
Last active August 29, 2015 14:20
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
function cleanUp() {
//
// Settings
//
// Enter # of days before messages are moved to trash
var days = 7;
// List of labels which you want to remove
var filters = [];
filters.push('label:notification-mailmagazine');