Skip to content

Instantly share code, notes, and snippets.

@false-git
false-git / uuid_test.cc
Last active May 14, 2023 05:20
UUIDの衝突が起きるかテストするプログラム (バージョン2)
// c++ -std=c++20 -O2 uuid_test.cc
#include <chrono>
#include <iostream>
#include <thread>
#include <memory>
#include <set>
#include <vector>
#include <uuid/uuid.h>
struct Uuid {
@false-git
false-git / uuid_test.cc
Last active May 14, 2023 02:21
UUIDの衝突が起きるかテストするプログラム
// c++ -std=c++20 -O2 uuid_test.cc
#include <chrono>
#include <iostream>
#include <thread>
#include <mutex>
#include <set>
#include <vector>
#include <uuid/uuid.h>
struct Uuid {
@false-git
false-git / patch-freebsd.c
Created November 13, 2021 00:16
FreeBSD の zabbix54-agent で net.if.discovery に失敗する問題に対応するパッチ
--- src/libs/zbxsysinfo/freebsd/freebsd.c.orig 2021-11-13 09:05:42.172000000 +0900
+++ src/libs/zbxsysinfo/freebsd/freebsd.c 2021-11-13 09:05:57.725120000 +0900
@@ -41,7 +41,7 @@
{"net.if.out", CF_HAVEPARAMS, NET_IF_OUT, "lo0,bytes"},
{"net.if.total", CF_HAVEPARAMS, NET_IF_TOTAL, "lo0,bytes"},
{"net.if.collisions", CF_HAVEPARAMS, NET_IF_COLLISIONS, "lo0"},
- {"net.if.discovery", 0, NET_IF_DISCOVERY, "lo0"},
+ {"net.if.discovery", 0, NET_IF_DISCOVERY, NULL},
{"vm.memory.size", CF_HAVEPARAMS, VM_MEMORY_SIZE, "free"},
@false-git
false-git / userscript.js
Last active July 30, 2021 13:55
自衛隊東京ワクチン接種web予約 autofill
// ==UserScript==
// @name 自衛隊東京ワクチン接種web予約
// @version 1
// @grant none
// @include https://www.vaccine.mrso.jp/sdftokyo/VisitNumbers/visitnoAuth*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// ==/UserScript==
(function($){
$('#VisitnoAuthName').val("市区町村コード");
@false-git
false-git / .gitconfig
Last active August 5, 2019 22:55
git config
[alias]
st = status -sb
[push]
default = simple
[core]
quotepath = false
[pager]
log = diff-highlight | less
show = diff-highlight | less
diff = diff-highlight | less
#include <iostream>
class I {
private:
int value;
public:
I(int i): value(i) {}
I operator+(int i) const {
return I(value - i);
}
@false-git
false-git / parity.c
Created February 11, 2017 13:38
偶数パリティの計算
#include <stdio.h>
#include <stdint.h>
/*!
* \brief 7bitの数値を渡すと、偶数パリティを8bit目に入れる
* \param[in] val 7bitの数値
* \return 8bit目に偶数パリティを追加したもの
*/
uint32_t parity(uint32_t val) {
uint32_t orig = (val &= 0x7f);
#include <iostream>
class A {
public:
void method() {
std::cout << "A::method" << std::endl;
}
virtual void vmethod() {
std::cout << "A::vmethod" << std::endl;
}
@false-git
false-git / quazip.patch
Last active March 17, 2016 08:52
quazip(http://quazip.sourceforge.net/) を Mac OS Xでビルドするためのパッチ
*** quazip/quazip.pro.orig 2015-03-12 13:50:17.000000000 +0900
--- quazip/quazip.pro 2015-03-13 13:19:12.000000000 +0900
***************
*** 44,49 ****
--- 44,54 ----
}
+ macx {
+ QMAKE_LIBS += -lz
@false-git
false-git / org.samba.smbd.plist
Last active January 2, 2016 18:59
smbdをlaunchdから起動するためのplistファイル。 /Library/LaunchDaemons/ に置き、以下のコマンドで有効化 # launchctl load -w /Library/LaunchDaemons/org.samba.smbd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.samba.smbd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/smbd</string>
<string>-F</string>