Skip to content

Instantly share code, notes, and snippets.

View fumiyas's full-sized avatar
💭
> 突然の死 <

SATOH Fumiyasu fumiyas

💭
> 突然の死 <
View GitHub Profile
#!/bin/sh
##
## ~/bin/diff-highlight
##
set -u
if [ -n "${BASH+set}" ]; then
shopt -s lastpipe 2>/dev/null ## Bash 4.2+ for `exec ... |exec ...`
fi
@fumiyas
fumiyas / update-ca-trust-hook.spec
Last active September 16, 2021 00:00
RHEL: Hack: Run commands after update-ca-trust(8)
## 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 March 24, 2021 08:17
Proxy server to connect over SSH
## 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-...
#!/bin/sh
##
## Pass LSV (Line-separated values) to a command
##
LF='
'
samplecmd() {
for x; do
#!/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 November 27, 2019 08:50
sssd.conf for LDAP backend
dpkg-reconfigure libpam-runtime
@fumiyas
fumiyas / httpd.serve-acme-and-block-ambiguous-servername.conf
Last active September 26, 2019 20:38
Apache HTTPD: Serve ACME challenge and block ambiguous server names
## 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 October 15, 2018 17:33
Mailman mm_cfg.py: Workaround for a bug of Python 2 email module
## 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?=
## ```
#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 September 2, 2018 13:21
macOS getxattr(2) is broken on SMB shares
/*
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>