Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
> 突然の死 <

TSUCHIDA (SATOH) Fumiyasu fumiyas

💭
> 突然の死 <
View GitHub Profile
@fumiyas
fumiyas / update-ca-trust-hook.spec
Last active Sep 16, 2021
RHEL: Hack: Run commands after update-ca-trust(8)
View update-ca-trust-hook.spec
## OSSTech update-ca-trust-hook
## ======================================================================
%{?vendor_package}
%global rel 152
#%%global rel_extra experimental
%global dist_name update-ca-trust-hook
%global dist_ver_base 1.0
@fumiyas
fumiyas / authorized_keys
Last active Mar 24, 2021
Proxy server to connect over SSH
View authorized_keys
## Allow the key to execute the specific socat command-line only
restrict,command="exec socat -lh -d STDIO TCP-CONNECT:10.0.0.1:389" ssh-...
View pass-lsv-to-a-command.sh
#!/bin/sh
##
## Pass LSV (Line-separated values) to a command
##
LF='
'
samplecmd() {
for x; do
View gpg1-build-for-windows-on-linux-mingw.sh
#!/bin/sh
set -e
#h=x86_64-w64-mingw32
h=i686-w64-mingw32
./configure \
--host=$h \
--prefix=/usr/local/gpg \
@fumiyas
fumiyas / pam-config-debian.sh
Last active Nov 27, 2019
sssd.conf for LDAP backend
View pam-config-debian.sh
dpkg-reconfigure libpam-runtime
@fumiyas
fumiyas / httpd.serve-acme-and-block-ambiguous-servername.conf
Last active Sep 26, 2019
Apache HTTPD: Serve ACME challenge and block ambiguous server names
View httpd.serve-acme-and-block-ambiguous-servername.conf
## Apache virtual servers definition to block ambiguous server names
## Put the snippet below to your Apache config file as the first <VirtualHost>
Alias /.well-known/acme-challenge/ /var/www/acme/.well-known/acme-challenge/
<Directory /var/www/acme/.well-known/acme-challenge>
Require all granted
</Directory>
<VirtualHost *:80>
RedirectMatch 503 "^/(?!\.well-known/|server-status$|server-info$)"
@fumiyas
fumiyas / mm_cfg.py
Last active Oct 15, 2018
Mailman mm_cfg.py: Workaround for a bug of Python 2 email module
View mm_cfg.py
## Workaround for the following bug of Python 2 email module:
##
## ```console
## $ (
## echo 'from email.header import Header'
## echo 'print Header("X: =?ISO-2022-JP?Q?=1B$B%;%s=1B(B?=",maxlinelen=20)')
## ) |python2
## X: =?ISO-2022-JP?Q?=1B$B%;
## %s=1B(B?=
## ```
View .mlterm-main
#termtype = mlterm-256color
use_transbg = false
fontsize = 20
use_cp932_ucs_for_xft=false
#not_use_unicode_font= true
ENCODING = UTF-8
use_anti_alias = true
use_variable_column_width = false
col_size_of_width_a = 2
brightness = 100
@fumiyas
fumiyas / getxattr.c
Last active Sep 2, 2018
macOS getxattr(2) is broken on SMB shares
View getxattr.c
/*
macOS getxattr(2) is broken on SMB shares:
* Cannot read xattr larger than 1048576 bytes.
* Fails by ERANGE (Result too large) if 'size' argument is smaller than
entire xattr size.
*/
#include <stdio.h>
#include <stdlib.h>
@fumiyas
fumiyas / finder-cp.bash
Last active May 10, 2018
Copy and remove a file or directory by macOS Finder application
View finder-cp.bash
#!/bin/bash
##
## Copy a file or directory by macOS Finder application
## Copyright (c) 2018 SATOH Fumiyasu @ OSS Technology Corp., Japan
##
## License: GNU General Public License version 3
##
set -u