Skip to content

Instantly share code, notes, and snippets.

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

SATOH Fumiyasu fumiyas

💭
> 突然の死 <
View GitHub Profile
#!/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 / dovecot-ldap.conf.ext
Created October 15, 2012 11:08
Dovecot: Example config for maildir++ quota and so on
uris = ldap://a.ldap.example.jp/ ldap://b.ldap.example.jp/
ldap_version = 3
base = ou=%d,dc=example,dc=jp
scope = subtree
auth_bind = yes
pass_filter = (uid=%n)
pass_attrs = mailQuota=userdb_quota_rule=*:bytes=%$
user_filter = (uid=%n)
@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 / u-nya.zshrc
Created May 2, 2012 12:33
端末ウィンドウタイトルと右プロンプトに這いよる混沌 (zsh, bash)
#!/bin/zsh
#!/bin/bash
##
## 端末ウィンドウタイトルと右プロンプトに這いよる混沌 (zsh)
## 端末ウィンドウタイトルに這いよる混沌 (bash)
## Written by SATOH Fumiyasu
## https://github.com/fumiyas
## https://twitter.com/#!/satoh_fumiyasu
##
## Inspired by:
@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>
@fumiyas
fumiyas / finder-cp.bash
Last active May 10, 2018 11:32
Copy and remove a file or directory by macOS Finder application
#!/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