Skip to content

Instantly share code, notes, and snippets.

View pandanote-info's full-sized avatar

pandanote-info pandanote-info

View GitHub Profile
@pandanote-info
pandanote-info / freq2matrix.py.example
Created January 7, 2022 07:45
転置インデックスもどきのデータをベクトル化するためのPython3のプログラム片。
with open(inputfile, encoding='utf-8') as fh:
freqlist = json.load(fh)
words = []
articleids = []
for k,v in freqlist.items():
words.append(k)
for vv in v:
a,f = vv.split(",")
@pandanote-info
pandanote-info / startipfs.sh
Last active December 6, 2021 12:39
IPFS daemonの起動・終了を実行するためのshell script。
#!/bin/bash
#
# See https://pandanote.info/?p=8205 for details.
#
MODE="start"
if [ -n "$1" ]; then
MODE="stop"
fi
@pandanote-info
pandanote-info / Excel2SQLite3_Worksheet_BeforeRightClick.vba
Last active November 10, 2021 14:33
ExcelのシートからSQLite3のCREATE TABLE句が記述されたファイルを生成するためのExcelのアドインのThisWorkbookに記述するコード。
Option Explicit
Public WithEvents CreateTableStatementForSQLite3 As Application
Private Sub Workbook_Open()
Set CreateTableStatementForSQLite3 = Application
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set CreateTableStatementForSQLite3 = Nothing
@pandanote-info
pandanote-info / Excel2SQLite3_Module.vba
Last active November 4, 2021 08:08
ExcelのシートからSQLite3のCREATE TABLE句が記述されたファイルを生成するためのExcelのアドインの標準モジュールに記述するコード。
' See https://pandanote.info/?p=8075 for details.
'SQLのCreate文を作る。
Option Explicit
Sub Create_CreateClause()
Dim columnname() As Variant
columnname = Array()
Dim rownum As Integer
rownum = Range(Selection.Address).Row
Dim rightMost As Integer
@pandanote-info
pandanote-info / partial_torus_r0.py
Created April 24, 2021 11:24
Blenderでトーラスを切断したような立体をモデリングするためのPython3のプログラム。
#!/usr/bin/env python3
#
# See https://pandanote.info/?p=7456
#
import bpy
import bmesh
import math
@pandanote-info
pandanote-info / growi
Last active March 26, 2021 14:08
GROWIの設定用ファイル(Fedora 31用)。/etc/sysconfigの下に置いて使用する。
PORT=3000
MODE_ENV=production
PASSWORD_SEED="openssl rand -base64 128 | head -1`"
MONGO_URI="mongodb://localhost:27017/growi"
FILE_UPLOAD=local
MATHJAX=1
@pandanote-info
pandanote-info / env.prod.js
Last active March 26, 2021 14:05
リソースが少ないサーバのためのenv.prod.jsの設定例(Fedora 31用)。
module.exports = {
NODE_ENV: 'production',
// FORMAT_NODE_LOG: false,
NODE_OPTIONS: '--max_old_space_size=768',
MATHJAX: 1
};
@pandanote-info
pandanote-info / directproducttest2.json
Created March 5, 2021 13:55
直積集合を作成するための集合を定義したJSONファイルの例。
{
"key1": ["a1","a2","a3"],
"key2": ["b1","b2","b3","b4"],
"key3": ["c1","c2","c3","c4","c5"],
"key4": ["d1","d2","d3","d4","d5","d6"],
"key5": ["e1","e2","e3"],
"key6": ["f1","f2","f3"],
"key7": ["a1","a2","a3"],
"key8": ["b1","b2","b3","b4"],
"key9": ["c1","c2","c3","c4","c5"],
@pandanote-info
pandanote-info / letsencrypt.sh
Last active February 19, 2021 13:34
Let's encryptから取得した証明書を更新するためのコマンドを証明書が更新可能なタイミングでのみ更新するためのシェルスクリプト。
#!/bin/sh
#
# See https://pandanote.info/?p=3842 for details.
#
PATH=/usr/bin:/bin:/usr/sbin
DRY_RUN=""
LASTCHECK_DIR=/var/run/letsencrypt
LASTCHECK_FILE=${LASTCHECK_DIR}/lastcheck.txt
LOG_DIR=/var/log/letsencrypt
@pandanote-info
pandanote-info / letsencrypt.cron
Last active February 19, 2021 13:30
Let's encryptから取得した証明書を更新するコマンドを起動するためのcronの設定ファイル。
28 23 * * 6 root /var/adm/bin/letsencrypt.sh <domain name(comma-separated)> 2>&1 1>/dev/null