User Tools

Site Tools


example_of_initial_ubuntu_settings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
example_of_initial_ubuntu_settings [2025/02/20 03:14] – [Customize .bashrc .profile] jianwuexample_of_initial_ubuntu_settings [2025/03/10 14:50] (current) – [Customize .bashrc .profile] jianwu
Line 1: Line 1:
 +[[https://pctresearch.com/|{{:wiki_banner.jpg?nolink&800|}}]]
 +
 ===== Example of initial Ubuntu settings ===== ===== Example of initial Ubuntu settings =====
 First, you should install Ubuntu on your machine or through WSL2 First, you should install Ubuntu on your machine or through WSL2
 ===== Install ubuntu-24.04 from WSL2 ===== ===== Install ubuntu-24.04 from WSL2 =====
-<code>+<code Bash>
 > wsl --install Ubuntu-24.04 --location "<Location you want to put ext4.vhdx in>" --name <distribution_name> --web-download > wsl --install Ubuntu-24.04 --location "<Location you want to put ext4.vhdx in>" --name <distribution_name> --web-download
   ex)   ex)
Line 8: Line 10:
 </code> </code>
 ===== Setting example of .gitconfig .gitignore ===== ===== Setting example of .gitconfig .gitignore =====
-<code Bash>+<code Dos>
 $ cat ~/.gitconfig $ cat ~/.gitconfig
 [user] [user]
Line 26: Line 28:
     cmd = meld "$LOCAL" "$REMOTE"     cmd = meld "$LOCAL" "$REMOTE"
 </code> </code>
-<code Bash>+<code Dos>
 $ cat ~/.gitignore $ cat ~/.gitignore
 # Ignore all # Ignore all
Line 40: Line 42:
 ===== Configure Git to Use Meld for Diffs in Ubuntu ===== ===== Configure Git to Use Meld for Diffs in Ubuntu =====
 <code Bash> <code Bash>
-$ sudo vimn /usr/bin/git-meld-diff+$ sudo apt install meld 
 +</code> 
 +<code Bash> 
 +$ sudo vim /usr/bin/git-meld-diff
 -- --
 #!/usr/bin/python3 #!/usr/bin/python3
Line 62: Line 67:
 ===== Customize .bashrc .profile ===== ===== Customize .bashrc .profile =====
 <code Diff> <code Diff>
-cgit diff 8175285fb6420ddd2bd23df18e7f8c9c74e9e830..HEAD .bashrc +git diff 8175285fb6420ddd2bd23df18e7f8c9c74e9e830..HEAD .bashrc
-diff --git a/.bashrc b/.bashrc +
-index b488fcc..a369f62 100644 +
---- a/.bashrc +
-+++ b/.bashrc +
-@@ -8,6 +8,16 @@ case $- in +
-       *) return;; +
- esac +
- +
-+blk='\[\033[01;30m\]'   # Black +
-+red='\[\033[01;31m\]'   # Red +
-+grn='\[\033[01;32m\]'   # Green +
-+ylw='\[\033[01;33m\]'   # Yellow +
-+blu='\[\033[01;34m\]'   # Blue +
-+pur='\[\033[01;35m\]'   # Purple +
-+cyn='\[\033[01;36m\]'   # Cyan +
-+wht='\[\033[01;37m\]'   # White +
-+clr='\[\033[00m\]'      # Reset +
-+
- # don't put duplicate lines or lines starting with space in the history. +
- # See bash(1) for more options +
- HISTCONTROL=ignoreboth +
-@@ -57,7 +67,8 @@ if [ -n "$force_color_prompt" ]; then +
- fi +
- +
- if [ "$color_prompt" = yes ]; then +
--    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '+
 diff --git a/.bashrc b/.bashrc diff --git a/.bashrc b/.bashrc
 index b488fcc..a369f62 100644 index b488fcc..a369f62 100644
Line 143: Line 122:
 +#PS1=${cyn}${PS_GIT}${clr}${PS1}${pur}'\n'${clr}'\$ ' +#PS1=${cyn}${PS_GIT}${clr}${PS1}${pur}'\n'${clr}'\$ '
 +PS1=${cyn}${PS_GIT}${clr}${PS1}${pur}''${clr}'\$ ' +PS1=${cyn}${PS_GIT}${clr}${PS1}${pur}''${clr}'\$ '
 ++
 </code> </code>
 <code Diff> <code Diff>
-source ~/.bashrc +$ git diff 8175285fb6420ddd2bd23df18e7f8c9c74e9e830..HEAD .profile
-$ source ~/.profile +
-  or +
-$ . ~/.bashrc +
-$ . ~/.profile +
-</code> +
-Now you can use "git diff" from the CLI with "cgit diff" and from the GUI with "ggit diff".  +
-<code Diff> +
-$ cgit diff 8175285fb6420ddd2bd23df18e7f8c9c74e9e830..HEAD .profile+
 diff --git a/.profile b/.profile diff --git a/.profile b/.profile
 index d89ea5a..8192c32 100644 index d89ea5a..8192c32 100644
Line 167: Line 139:
 +export PATH="$PATH:/mnt/c/Windows/System32" +export PATH="$PATH:/mnt/c/Windows/System32"
 +export PATH="$PATH:$HOME/.local/bin" +export PATH="$PATH:$HOME/.local/bin"
 ++# suppress glxinfo error
 ++export GALLIUM_DRIVER=d3d12
 ++#  VcXsrv(X Server)
 ++
 </code> </code>
 <code Diff> <code Diff>
Line 196: Line 172:
  "set mouse=a           " Enable mouse usage (all modes)  "set mouse=a           " Enable mouse usage (all modes)
 +set number +set number
 +
 + " Source a global configuration file if available
 + if filereadable("/etc/vim/vimrc.local")
 </code> </code>
 +<code Bash>
 +$ source ~/.bashrc
 +$ source ~/.profile
 +  or
 +$ . ~/.bashrc
 +$ . ~/.profile
 +</code>
 +Now you can use "git diff" from the CLI with "cgit diff" and from the GUI with "ggit diff"
  
example_of_initial_ubuntu_settings.1739988889.txt.gz · Last modified: 2025/02/20 03:14 by jianwu