切換root
sudo -i
將使用者加入 docker,並將/var/run/docker.sock權限設定為docker group
synogroup --add docker <your_username>
chown root:docker /var/run/docker.sock
切換root
sudo -i
將使用者加入 docker,並將/var/run/docker.sock權限設定為docker group
synogroup --add docker <your_username>
chown root:docker /var/run/docker.sock
git 分支, 合併, tag 之範例
# 建立 develop branch
git branch develop
git checkout develop
git branch
for t in {1..5};
do
TAG=v0.${t}
FEATURE=feature/${TAG}
# 建立 feature branch
git branch ${FEATURE}
git checkout ${FEATURE}
git branch
# commit 5個版本
for i in {1..5};
do
data=$(printf "${FEATURE}-%03d" $i)
echo $data >> history.txt
history=$(cat history.txt)
printf "# Test\n## Version\n${data}\n## History\n\`\`\`\n${history}\n\`\`\`\n" > readme.md
git add .
git commit -m "version: ${data}"
git push -u origin ${FEATURE}
done
git branch
# 切換develop
git checkout develop
git branch
# 合併
git merge --no-ff -m "合併(from ${FEATURE} to develop)" ${FEATURE}
git push -u origin develop
# 刪除分支
git branch -d ${FEATURE}
git push -u origin :${FEATURE}
git push -u origin develop
# 切換到master
git checkout master
git branch
# 合併
git merge --no-ff -m "合併(from 合併 to master)" develop
git push -u origin master
# 建立release
git tag ${TAG}
git tag -l
git push origin ${TAG}
done
gitlab-rails console
Ci::Runner.all.update_all(token_encrypted: nil)
並重啟gitlab
gitlab-rails dbconsole
gitlabhq_production=> UPDATE projects SET runners_token = null, runners_token_encrypted = null;
gitlabhq_production=> UPDATE namespaces SET runners_token = null, runners_token_encrypted = null;
gitlabhq_production=> UPDATE application_settings SET runners_registration_token_encrypted = null;
並重啟gitlab
yum update -y
rpm -q kernel
package-cleanup --oldkernels --count=1 -y
macos/ubuntu supported
rand_str=$(cat /dev/urandom | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 16)
echo $rand_str
macos unsupported
rand_str=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo $rand_str
設定test資料夾下的所有檔案權限
find test -type f -exec chmod 644 {} +
設定test資料夾下的所有資料夾權限
find test -type d -exec chmod 755 {} +
small size
gsettings set org.gnome.nautilus.icon-view default-zoom-level small
list all size
gsettings range org.gnome.nautilus.icon-view default-zoom-level
refer: https://unix.stackexchange.com/questions/250266/rhel-7-gnome-shell-decrease-desktop-icon-size
使用brew
brew install gnu-sed coreutils
echo "alias sed=\"`which gsed`\"" >> ~/.bash_profile
echo "alias readlink=greadlink" >> ~/.bash_profile
利用curl取得對外ip
curl http://ipecho.net/plain ; echo
使用如下指令,在fastestmirror.conf中,將.cn設定為exclude:
rm -r -f /var/cache/yum/timedhosts.txt
echo "exclude=.cn" >> /etc/yum/pluginconf.d/fastestmirror.conf