Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
> 突然の死 <

SATOH Fumiyasu (TSUCHIDA Fumiyasu) fumiyas

💭
> 突然の死 <
View GitHub Profile
@fumiyas
fumiyas / centos-vault-repos.bash
Created Mar 18, 2022
CentOS: Replace obsolete CentOS repos with CentOS Vault mirrored in Japan
View centos-vault-repos.bash
##
## CentOS: Replace obsolete CentOS repos with CentOS Vault mirrored in Japan
## Copyright (c) 2022 SATOH Fumiyasu @ OSSTech Corp., Japan
##
## License: GNU General Public License version 3
##
set -u
set -e
umask 0022
View vpnc-script-hack-to-disable-defaultroute-and-resolvconf.patch
--- /usr/share/vpnc-scripts/vpnc-script 2021-08-19 01:47:24.000000000 +0900
+++ /home/fumiyas/bin/vpnc-script 2022-02-03 18:01:06.473080699 +0900
@@ -147,7 +147,10 @@
RESOLVEDENABLED=0
fi
-if [ -r /etc/openwrt_release ] && [ -n "$OPENWRT_INTERFACE" ]; then
+if :; then
+ MODIFYRESOLVCONF=echo
+ RESTORERESOLVCONF=echo
@fumiyas
fumiyas / run_and_get_rc.sh
Last active Dec 15, 2021
Shell: Get a return code (exit code) from a command on set -e
View run_and_get_rc.sh
#!/bin/sh
run_and_get_rc() {
local _rc_vname="$1"; shift
local _rc
local _shopts="$-"
if [ "${_rc_vname#*[!a-z_]}" != "$_rc_vname" ]; then
echo "run_and_get_rc: Invaid return variable name: $_rc_vname" 1>&2
exit 1
@fumiyas
fumiyas / httpd.conf
Last active Dec 15, 2021
Apache HTTPD: Default virtualhost definition to deny access to an unexpected server name, but ACME
View httpd.conf
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 127.0.0.1:80>
<IfModule status_module>
<Location /server-status>
Require ip 127.0.0.1 ::1
SetHandler server-status
View diff-highlight.sh
#!/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 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