- 既存のKubernetesクラスタにworkerノードとして追加する
- 今回はk3sを使用しているものとする
- ISCSIを使えること (CSIとしてlonghornを想定)
- 用途として録画鯖を想定 = ffmpegが必要
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 debian:bookworm-slim | |
WORKDIR /opt | |
# Install dependencies | |
RUN apt-get update \ | |
&& apt-get install -y curl npm python3 unzip \ | |
&& curl -sL https://deb.nodesource.com/setup_20.x | bash - \ | |
&& apt-get install -y nodejs | |
# Install AWS CLI | |
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ |
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 | |
CONFIG_FILE=$1 | |
MODULE_NAME=$2 | |
if grep -q -e "$MODULE_NAME is not set" $CONFIG_FILE; then | |
sed "s/# $MODULE_NAME is not set/$MODULE_NAME=y/g" $CONFIG_FILE | |
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 | |
set -e | |
ANSIBLE_USER=${ANSIBLE_USER:-ansible} | |
if [[ -z "$PUBLIC_KEY" ]]; then | |
[[ -z "$GH_USERNAME" ]] && echo "Please set GH_USERNAME" && exit 1 | |
PUBLIC_KEY="$(curl -sfL https://github.com/$GH_USERNAME.keys)" | |
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 | |
GRUB_FILE=/etc/default/grub | |
GRUB_TMP_FILE=/tmp/grub.new | |
SWAP_DEVICE="$(blkid --match-token TYPE=swap --output device)" | |
if [[ -z "$SWAP_DEVICE" ]]; then | |
echo "Cannot find swap partition" | |
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 | |
# vi: ts=2 sw=2 | |
set -e | |
IFSTAT="${IFSTAT:-ifstat}" | |
IFSTAT_INTERVAL="${IFSTAT_INTERVAL:-1}" | |
$IFSTAT -t $IFSTAT_INTERVAL | awk ' | |
BEGIN { | |
scale["K"] = 1024 |
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
help: ## show help | |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ | |
| sort \ | |
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
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 | |
target="$1" | |
ssh -t $target -o StrictHostKeyChecking=no <<- 'EOS' | |
cd /tmp | |
curl -o geekbench.tar.gz http://cdn.geekbench.com/Geekbench-5.1.0-Linux.tar.gz | |
tar zxvf geekbench.tar.gz | |
cd $(find . -maxdepth 1 -name 'Geekbench*' -type d | head -n1) | |
./geekbench5 | |
EOS |
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
var DeferredLoader = (function() { | |
var that = {}; | |
var Slave = function($e) { | |
var resolve = function() { | |
$.ajax({ | |
type: 'GET', | |
url: $e.data('url') | |
}).done(function(d) { | |
$e.empty(); |
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
// PHP5.3以上で疑似メソッドチェーンを提供するFunctional Builderパターン | |
// 内部の高階関数f_chainとf_frontが中核 | |
// $node = array($this, '__buildNode'); | |
// $page = $node('page', array( | |
// array('set_attr', array('format' => 'title')), | |
// array('append', $node('text', array( | |
// array('data', 'text', 'This is Title'), | |
// ))), | |
// array('build') | |
// )); |
NewerOlder