View generate-iscsi-initiatorname
This file contains 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 | |
set -eu | |
INAME=/etc/iscsi/initiatorname.iscsi | |
InitiatorName="" | |
if [ -e ${INAME} ]; then | |
. ${INAME} | |
if [ "$InitiatorName" != "" ]; then | |
# nothing to do. | |
exit 0 |
View simlic.cmd
This file contains 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
@sed -n "s/.*\([A-Z]\{18\}AAAAAAAAAA\).*$/\1/p" %1 | sed -z "s/\n/,/g" | sed -e "s/,$//" |
View launch-ssh-agent.fish
This file contains 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
# | |
# launch-ssh-agenet | |
# | |
function __lsa_get-sshenv | |
if set -q SSHENV | |
echo $SSHENV | |
else | |
echo $HOME/.ssh/.sshenv | |
end | |
end |
View tuned-disable-thp.bash
This file contains 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
{ | |
CUSTOM_TUNED="disable-thp" | |
PROFILE_DIR="/etc/tuned/$CUSTOM_TUNED" | |
TUNED_CONF="$PROFILE_DIR/tuned.conf" | |
ACTIVE_PROFILE=`tuned-adm active | cut -d " " -f 4` | |
sudo mkdir -p "$PROFILE_DIR" | |
cat <<EOF | sudo tee "$TUNED_CONF" | |
[main] | |
include= $ACTIVE_PROFILE |
View .vimrc
This file contains 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
au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent | |
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab | |
set fenc=utf-8 | |
set showcmd | |
set number | |
set cursorline | |
set smartindent | |
set showmatch | |
set ignorecase |
View remove-usb-hdd.bash
This file contains 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 | |
/usr/bin/udisksctl power-off -b $1 |
View remove-all-containers.sh
This file contains 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 | |
docker rm `docker ps -a | awk '{print($1)}' | grep -v CONTAINER` |
View addpath.sh
This file contains 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
# | |
# add path if the path is not exist. | |
# | |
function addpath() { | |
if echo ":$PATH:" | fgrep -q -s -v ":$1:" && [ -d "$1" ] ; then | |
PATH="$1:$PATH" | |
fi | |
} |