This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SSH_CONFIG_PATH="${HOME}/.ssh/config" | |
is_ssh_config_exist() { | |
if [[ -f "$SSH_CONFIG_PATH" ]]; then | |
return 0 | |
else | |
return 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
EXCLUDE_DIRS="--exclude={opt,proc,dev,boot,lost+found}" | |
usage() { | |
prog_name="$(basename "$0")" | |
cat << EOF | |
Usage: $prog_name | |
Require root privilege |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set ft=ruby | |
VAGRANTFILE_API_VERSION = "2" | |
$script = <<EOT | |
sudo cp -p /usr/share/zoneinfo/Asia/Tokyo /etc/localtime | |
sudo yum -y update | |
EOT | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM base | |
RUN apt-get install -y openssh-server | |
RUN mkdir -p /var/run/sshd | |
RUN useradd -m knakayama | |
RUN mkdir -p /home/knakayama/.ssh && \ | |
chown knakayama /home/knakayama/.ssh && \ | |
chmod 700 /home/knakayama/.ssh | |
ADD ./authorized_keys /home/knakayama/.ssh/authorized_keys | |
RUN chown knakayama /home/knakayama/.ssh/authorized_keys && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -ex | |
if ! lsb_release --id --short | grep -qF 'Ubuntu'; then | |
echo "Ubuntu only" | |
exit 1 | |
fi | |
if ! lsb_release --codename --short | grep -qF 'precise'; then | |
echo "12.04 precise only" | |
exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -ex | |
for disk in $(sysctl -n kern.disks | sed 's/ cd[0-9]//' | awk '{num=split($0, a); for (i=num; i>0; i--) {print a[i]}}'); do | |
gpart destroy -F "$disk" | |
gpart create -s gpt "$disk" | |
gpart add -s 64k -t freebsd-boot "$disk" | |
gpart add -t freebsd-zfs "$disk" | |
gpart bootcode -b "/boot/pmbr" -p "/boot/gptzfsboot" -i 1 "$disk" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# not work | |
set -o xtrace | |
set -o errexit | |
{ | |
if [ ! -f "/etc/apt/sources.list.d/zfs-native-stable-trusty.list" ]; then | |
apt-add-repository -y ppa:zfs-native/stable | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>AdjustWindowForFontSizeChange</key> | |
<true/> | |
<key>AllowClipboardAccess</key> | |
<false/> | |
<key>AnimateDimming</key> | |
<false/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
export LANG=C | |
MACHINE="$(uname -n)" | |
COLUMN="bond" | |
COLOR="green" | |
BOND_CONF="/proc/net/bonding" | |
# check if bond is normal | |
is_bond_normal() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Naur procmail-3.22-getline/src/fields.c procmail-3.22/src/fields.c | |
--- procmail-3.22-getline/src/fields.c 2015-06-13 14:43:11.000000000 +0900 | |
+++ procmail-3.22/src/fields.c 2015-06-13 14:00:14.000000000 +0900 | |
@@ -110,16 +110,16 @@ | |
/* try and append one valid field to rdheader from stdin */ | |
int readhead P((void)) | |
{ int idlen; | |
- getline(); | |
+ get_line(); | |
if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */ |
OlderNewer