Skip to content

Instantly share code, notes, and snippets.

View DaikiSuganuma's full-sized avatar

SUGANUMA Daiki DaikiSuganuma

View GitHub Profile
#!/bin/sh
#
# Redmine Startup script for unicorn.
#
# chkconfig: - 86 15
# description: redmine on unicorn start/stop script.
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
# load rbenv
@DaikiSuganuma
DaikiSuganuma / Gruntfile.js
Last active August 29, 2015 14:01
Grunt Configuration with JSHint for Titanium Project. see http://se-suganuma.blogspot.jp/2014/05/macjshint-gruntjavascript.html
module.exports = function(grunt){
// Load plugins
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.initConfig({
options: {
livereload: true,
},
jshint: {
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');
@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
@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 / 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 / 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 / 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 / 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 / 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ファイルから抽出し、人間が読みやすい形式で表示します。
# ==============================================================================
# --- 設定項目 ---