mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(snippets): review recently used commands
This commit is contained in:
27
snippets/cloud-init.sh
Normal file
27
snippets/cloud-init.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##
|
||||
# Re-run everything.
|
||||
##
|
||||
|
||||
# 1. Clean the existing configuration.
|
||||
sudo cloud-init clean --logs
|
||||
|
||||
# 2. Detect local data sources.
|
||||
sudo cloud-init init --local
|
||||
|
||||
# 3. Detect any data source requiring the network and run the 'initialization' modules.
|
||||
sudo cloud-init init
|
||||
|
||||
# 4. Run the 'configuration' modules.
|
||||
sudo cloud-init modules --mode='config'
|
||||
|
||||
# 5. Run the 'final' modules.
|
||||
sudo cloud-init modules -m 'final'
|
||||
|
||||
# All together now!
|
||||
sudo cloud-init clean --logs
|
||||
sudo cloud-init init --local
|
||||
sudo cloud-init init
|
||||
sudo cloud-init modules --mode='config'
|
||||
sudo cloud-init modules -m 'final'
|
||||
18
snippets/git.change-the-default-branch-from-master-to-main.sh → snippets/git.sh
Executable file → Normal file
18
snippets/git.change-the-default-branch-from-master-to-main.sh → snippets/git.sh
Executable file → Normal file
@@ -1,7 +1,19 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# sources:
|
||||
# - https://stevenmortimer.com/5-steps-to-change-github-default-branch-from-master-to-main/
|
||||
##
|
||||
# Remove files from the latest commit.
|
||||
# The easiest way is to use `git gui`: 'Commit' => 'Amend Last Commit' => uncheck the files => 'Commit'.
|
||||
##
|
||||
|
||||
git reset --soft HEAD~1 # or `git reset --soft HEAD^`
|
||||
git restore --staged '.lefthook-local.yml' # or `git reset HEAD '.lefthook-local.yml'`
|
||||
git commit -c ORIG_HEAD
|
||||
|
||||
|
||||
##
|
||||
# Change the default branch from 'master' to 'main'.
|
||||
# Source: https://stevenmortimer.com/5-steps-to-change-github-default-branch-from-master-to-main/
|
||||
##
|
||||
|
||||
# create main branch locally, taking the history from master
|
||||
git branch --move 'master' 'main'
|
||||
@@ -84,12 +84,11 @@ gitlab-rails runner '
|
||||
|
||||
# Package upgrade
|
||||
sudo yum check-update
|
||||
sudo yum info 'gitlab-ee' # informational
|
||||
sudo rpm -qa | grep 'gitlab-ee' # informational
|
||||
sudo yum info 'gitlab-ee' # informational
|
||||
sudo rpm -qa | grep 'gitlab-ee' # informational
|
||||
sudo yum --showduplicates list available 'gitlab-ee'
|
||||
sudo gitlab-backup create # not strictly necessary: the upgrade will create a partial one
|
||||
tmux new-session -A -s 'gitlab-upgrade' "sudo yum update 'gitlab-ee'"
|
||||
tmux new-session -A -s 'gitlab-upgrade' "sudo yum update 'gitlab-ee-16.11.3'"
|
||||
sudo gitlab-backup create # not strictly necessary: the upgrade will create a partial one
|
||||
tmux new-session -A -s 'gitlab-upgrade' "sudo yum update 'gitlab-ee'" # 'gitlab-ee-16.11.3' if version-specific
|
||||
sudo gitlab-rake 'gitlab:check'
|
||||
|
||||
# Password reset
|
||||
|
||||
Reference in New Issue
Block a user