- Ubuntu公式からAMD64向けのイメージをダウンロード
- RufusでUSBメモリに焼く
- ノートPCにUSBメモリを挿す
- ノートPCを起動しF2を連打
- BIOSからUbuntuの入ったUSBを起動
- 普通にインストールする
Edgeのdebを落としてきてインストール
sudo apt install ./microsoft-edge-stable_139.0.3405.125-1_amd64.deb
アプリセンターからFirefoxを消す
VSCodeのdebを落としてきてインストール
sudo apt install ./code_1.103.2-1755709794_amd64.deb
普段使ってるマシンで拡張機能のインストールコマンドを生成
code --list-extensions | grep -E -v 'powershell|wsl' | perl -ne 'print "code --install-extension $_"'
結果をノートPC側に流す
code --install-extension 13xforever.language-x86-64-assembly
code --install-extension 42crunch.vscode-openapi
code --install-extension bmewburn.vscode-intelephense-client
code --install-extension dbaeumer.vscode-eslint
code --install-extension docker.docker
code --install-extension eamodio.gitlens
code --install-extension esbenp.prettier-vscode
code --install-extension golang.go
code --install-extension gruntfuggly.todo-tree
code --install-extension jebbs.plantuml
code --install-extension jock.svg
code --install-extension lokalise.i18n-ally
code --install-extension ms-azuretools.vscode-containers
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-ceintl.vscode-language-pack-ja
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-vscode-remote.remote-ssh
code --install-extension ms-vscode-remote.remote-ssh-edit
code --install-extension ms-vscode.remote-explorer
code --install-extension mushan.vscode-paste-image
code --install-extension redhat.vscode-commons
code --install-extension redhat.vscode-yaml
code --install-extension robberphex.php-debug
code --install-extension shd101wyy.markdown-preview-enhanced
code --install-extension swordev.phpstan
code --install-extension vscode-icons-team.vscode-icons
code --install-extension yzhang.markdown-all-in-one
{
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "zsh"
}
},
"terminal.integrated.allowChords": false,
"terminal.integrated.commandsToSkipShell": [
"-workbench.action.quickOpenView",
"-workbench.action.terminal.focusFind"
],
"workbench.startupEditor": "newUntitledFile",
"workbench.iconTheme": "vscode-icons",
"workbench.editor.decorations.badges": false,
"workbench.editor.decorations.colors": false,
"workbench.tree.enableStickyScroll": false,
"workbench.layoutControl.enabled": false,
"workbench.editor.empty.hint": "hidden",
"files.eol": "\n",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"scm.showIncomingChanges": "never",
"scm.showOutgoingChanges": "never",
"git.autorefresh": true,
"git.autoStash": true,
"git.suggestSmartCommit": false,
"git.mergeEditor": false,
"git.openRepositoryInParentFolders": "never",
"remote.autoForwardPortsSource": "hybrid",
"diffEditor.ignoreTrimWhitespace": true,
"diffEditor.renderGutterMenu": false,
"explorer.confirmDragAndDrop": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.stickyScroll.enabled": false,
"[markdown]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"php.validate.run": "onSave",
"vsicons.dontShowNewVersionMessage": true,
"pasteImage.path": "${currentFileDir}/${currentFileNameWithoutExt}.assets",
"todo-tree.filtering.excludeGlobs": ["**/node_modules/**/*"],
"todo-tree.highlights.customHighlight": {
"TODO": {
"foreground": "#f8ff96",
"type": "text-and-comment"
},
"FIXME": {
"foreground": "#ff9696",
"type": "text-and-comment"
}
},
"todo-tree.general.tags": ["TODO", "FIXME"],
"todo-tree.regex.regex": "(//|#|<!--|/\\*|^\\s*\\*)\\s*($TAGS)",
"gitlens.currentLine.format": "${author, }${date}${' via 'pullRequest}${ • message|50?}",
"gitlens.statusBar.format": "${author}, ${date}${' via 'pullRequest}",
"gitlens.statusBar.tooltipFormat": "${avatar} __${author}__, ${date}${' via 'pullRequest}\n\n${message}${\n\n---\n\nfootnotes}\n\n${commands}",
"gitlens.hovers.detailsMarkdownFormat": "${avatar} __${author}__, ${date}${' via 'pullRequest}\n\n${message}${\n\n---\n\nfootnotes}\n\n${commands}",
"gitlens.views.formats.stashes.description": "${date}",
"gitlens.views.formats.commits.description": "${author, }${date}",
"gitlens.defaultDateFormat": "YYYY-MM-DD",
"terminal.integrated.shellIntegration.decorationsEnabled": "never",
"security.workspace.trust.untrustedFiles": "open",
"explorer.copyRelativePathSeparator": "/",
"typescript.tsserver.log": "off",
"gitlens.ai.experimental.generateCommitMessage.enabled": false,
"redhat.telemetry.enabled": true,
"chat.commandCenter.enabled": false,
"gitlens.views.scm.grouped.views": {
"commits": true,
"branches": true,
"remotes": true,
"stashes": false,
"tags": true,
"worktrees": true,
"contributors": true,
"repositories": false,
"searchAndCompare": false,
"launchpad": false
},
"workbench.secondarySideBar.defaultVisibility": "hidden",
"docker.extension.enableComposeLanguageServer": false,
"workbench.localHistory.maxFileEntries": 500,
"editor.acceptSuggestionOnCommitCharacter": false,
"workbench.settings.showAISearchToggle": false,
"gitlens.ai.enabled": false,
"chat.agent.enabled": false,
"remote.SSH.experimental.chat": false,
"scm.showInputActionButton": false,
"typescript.updateImportsOnFileMove.enabled": "always",
}
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+[BracketLeft]",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
"key": "ctrl+shift+r",
"command": "typescript.restartTsServer"
},
{
"key": "ctrl+shift+e",
"command": "eslint.restart"
},
{
"key": "alt+down",
"command": "workbench.action.compareEditor.nextChange",
"when": "textCompareEditorVisible"
},
{
"key": "alt+up",
"command": "workbench.action.compareEditor.previousChange",
"when": "textCompareEditorVisible"
},
{
"key": "ctrl+k enter",
"command": "-workbench.action.keepEditor"
},
{
"key": "ctrl+q",
"command": "workbench.action.keepEditor"
}
]
sudo apt install xubuntu-desktop
sudo apt purge gnome-desktop
sudo apt search gnome
sudo apt purge ubuntu-gnome-desktop gnome-shell
sudo apt autoremove
土台となる環境をインストールする
# 基礎環境の導入
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y \
zsh \
ssh \
net-tools \
traceroute \
unzip \
mariadb-server \
nginx \
git
# chsh
sudo apt -y install unzip traceroute
chsh -s $(which zsh)
# dotfiles
wget https://github.com/Lycolia/my-dotfiles/archive/refs/heads/main.zip
unzip main.zip
cp -R my-dotfiles-main/. .
rm -Rf my-dotfiles-main main.zip
chshを効かせるためにOSを再起動
Dockerをインストール
# Docker
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt -y update
sudo apt -y install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# sudo緩和
sudo usermod -aG docker $USER
- Node.jsをインストール
# Node.js @ nvm
export NVM_DIR="$HOME/.nvm" && (
git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
cd "$NVM_DIR"
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"
nvm install --lts
- dotfilesのセクションで拾ってきた.zshrcを開き、nvmが動くようにコメントを外す
- 鍵置き場を作り、鍵を配置する
mkdir ~/.ssh
chmod 700 ~/.ssh
touch config
chmod 600 <鍵ファイル>
- 接続情報を書く
Host hoge
User foo
Hostname git1.example.com
IdentityFile ~/.ssh/config/id_ed25519_foo
Port 22222
Host piyo
User bar
Hostname git2.example.com
IdentityFile ~/.ssh/config/id_ed25519_bar
Port 20202
LibreOfficeのバージョンを最新まで上げるとOnedriveに繋げるようになるらしいので上げてみたが、「LibreOffice OneDrive the specified device invalid」のようなエラーメッセージが出て実際には使えなかった。Google Driveでも同様の問題があるらしい。
バージョンの上げ方
公式サイトからdebをダウンロードしてきて展開し、debが詰まったディレクトリでsudo dpkg -i *.debするとインストールできる。
そのままではXubuntuのLibreOfficeと競合するため以下のコマンドで古い方を消す。
sudo apt remove libreoffice-common
sudo apt autoremove
取り敢えず使いそうなもの入れる
php
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install -y php8.4 \
php8.4-bz2 \
php8.4-cgi \
php8.4-cli \
php8.4-common \
php8.4-curl \
php8.4-dev \
php8.4-ds \
php8.4-fpm \
php8.4-gd \
php8.4-http \
php8.4-imagick \
php8.4-intl \
php8.4-ldap \
php8.4-mbstring \
php8.4-mcrypt \
php8.4-mysql \
php8.4-oauth \
php8.4-odbc \
php8.4-pgsql \
php8.4-smbclient \
php8.4-snmp \
php8.4-soap \
php8.4-sqlite3 \
php8.4-uuid \
php8.4-vips \
php8.4-xdebug \
php8.4-xml \
php8.4-xmlrpc \
php8.4-yaml \
php8.4-zip \
php8.4-zstd
sudo sed -i -e 's/;listen.mode = 0660/listen.mode = 0666/' /etc/php/8.4/fpm/pool.d/www.conf
sudo service php8.0-fpm start
nginxでfpmが動くか動作確認するために/etc/nginx/conf.d/test.confを作成し、以下を記述
server {
listen 80;
listen [::1]:80;
location ~ ^/.*$ {
root /usr/share/nginx/html;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
sudo service nginx restart
/usr/share/nginx/html/に適当なPHPスクリプトを置いて動いてるのが確認出来たらOK