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 | |
} |
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` |
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 |
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 |
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 |
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 |
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/,$//" |
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 |
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
@ECHO OFF | |
SETLOCAL | |
SET CURRENT_DIR=%CD% | |
PUSHD "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build" | |
CMD /K "CALL VCVARS64.BAT & PROMPT $E[1;35m$CMSVC$F %PROMPT% & CD %CURRENT_DIR%" | |
POPD | |
ENDLOCAL | |
EXIT /B 0 |
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
b2sum=coreutils b2sum $* | |
b3sum=coreutils b3sum $* | |
base32=coreutils base32 $* | |
base64=coreutils base64 $* | |
basename=coreutils basename $* | |
basenc=coreutils basenc $* | |
cat=coreutils cat $* | |
cksum=coreutils cksum $* | |
comm=coreutils comm $* | |
cp=coreutils cp $* |