Skip to content

Instantly share code, notes, and snippets.

@okanon
Last active August 7, 2020 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okanon/27d1c8ddad7110ec0ecb562b666eb628 to your computer and use it in GitHub Desktop.
Save okanon/27d1c8ddad7110ec0ecb562b666eb628 to your computer and use it in GitHub Desktop.
ubuntu20.04 LTS install scripts
#!/bin/bash
sudo apt update
sudo apt -y upgrade
# install utils
sudo apt -y install tree net-tools git vim curl fish \
neofetch openssh-server speedtest-cli \
psensor ffmpeg
if [ $DESKTOP_SESSION = "plasma" ]; then #KDE
LANG=C xdg-user-dirs-update --force
ls $HOME | grep -E [亜-熙ぁ-んァ-ヶ] | xargs -I@ rm -rf $HOME/@
# Konsole Settings
sudo cp Lisa.colorscheme /usr/share/konsole
cp konsolerc $HOME/.config/
# install KDE themes
sudo apt -y install latte-dock
else # GNOME
LANG=C xdg-user-dirs-gtk-update
fi
# set default shell
chsh
sudo chsh
# install fonts
curl -OL https://github.com/vjpr/monaco-bold/raw/master/MonacoB/MonacoB.otf
curl -OL https://github.com/vjpr/monaco-bold/raw/master/MonacoB2/MonacoB2.otf
sudo mv Monaco* /usr/share/fonts/
fc-cache -f
# install checkra1n
echo "deb https://assets.checkra.in/debian /" | sudo tee -a /etc/apt/sources.list
sudo apt-key adv --fetch-keys https://assets.checkra.in/debian/archive.key
sudo apt update
sudo apt install checkra1n
# install python packages
sudo apt -y install python-dev python3-dev python3-testresources
# install pip
curl -kL https://bootstrap.pypa.io/get-pip.py | sudo python
curl -kL https://bootstrap.pypa.io/get-pip.py | sudo python3
# install solaar (logicool mouse controller)
git clone https://github.com/pwr-Solaar/Solaar && cd Solaar
sudo python3 setup.py install && cd ..
sudo rm -rf Solaar
# install c cpp runtime
sudo apt -y install gcc-10 g++-10 gccgo-10 gfortran-10
sudo apt -y install make automake flex bison zlib1g-dev \
z3 libssl-dev libcurl4-openssl-dev \
gettext libncurses-dev liblua5.3-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \
--slave /usr/bin/gccgo gccgo /usr/bin/gccgo-10 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-10
# install chrome
curl -OL https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt -y --fix-broken install
rm -f google-chrome-stable_current_amd64.deb
# install jdk
sudo apt -y install openjdk-11-jdk openjdk-14-jdk
sudo update-java-alternatives -s java-1.11.0-openjdk-amd64
# install sbt
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt update
sudo apt -y install sbt
# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup install --force stable
rustup install --force beta
rustup install --force nightly
# install exa
git clone https://github.com/ogham/exa
cd exa && make
sudo mv target/release/exa /usr/local/bin && cd ..
rm -rf exa
# install nodejs & npm
sudo apt -y install nodejs npm
sudo npm install -g n
sudo n latest
sudo npm install -g npm
sudo apt -y purge nodejs npm
sudo chown -R $USER /usr/local/{lib/node_modules,bin,share}
# install npm software
npm install -g @angular/cli bagbak yarn
# install vim colorscheme & dein.vim
mkdir -p ~/.vim/colors
git clone https://github.com/NLKNguyen/papercolor-theme
cp papercolor-theme/colors/PaperColor.vim ~/.vim/colors
mkdir -p ~/.vim/dein
curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
sh ./installer.sh ~/.vim/dein
# install coc.nvim
mkdir -p ~/.vim/toml
cp dein.toml ~/.vim/toml
set fish_color_user 5a79ba
set fish_color_cwd 00a381
set fish_color_error e9546b
set fish_color_param 596777
set fish_color_host_remote normal
set fish_prompt_pwd_dir_length 0
set PATH $HOME/.cargo/bin $PATH
set PATH /usr/local/go/bin $PATH
set GOPATH $HOME/go
set PIP2 "sudo -H pip2"
set PIP3 "sudo -H pip3"
alias pip2=$PIP2
alias pip3=$PIP3
alias ls="exa"
alias checkra1n="sudo checkra1n"
[[plugins]]
repo = 'neoclide/coc.nvim'
build = './install.sh nightly'
[Desktop Entry]
DefaultProfile=ubuntu.profile
[DownloadDialog Settings]
Height 1440=523
Width 2560=700
[Favorite Profiles]
Favorites=
[KonsoleWindow]
ShowMenuBarByDefault=false
[MainWindow]
Height 1440=777
MenuBar=Disabled
State=AAAA/wAAAAD9AAAAAAAABFYAAAMJAAAABAAAAAQAAAAIAAAACPwAAAAA
ToolBarsMovable=Disabled
Width 2560=1110
[Background]
Color=244,244,244
[BackgroundFaint]
Color=225,226,226
[BackgroundIntense]
Color=235,236,236
[Color0]
Color=43,43,43
[Color0Faint]
Color=43,43,43
[Color0Intense]
Color=112,144,128
[Color1]
Color=255,101,147
[Color1Faint]
Color=238,87,132
[Color1Intense]
Color=255,93,139
[Color2]
Color=47,190,188
[Color2Faint]
Color=46,189,187
[Color2Intense]
Color=47,190,188
[Color3]
Color=59,175,228
[Color3Faint]
Color=64,192,250
[Color3Intense]
Color=54,158,207
[Color4]
Color=255,113,106
[Color4Faint]
Color=234,104,97
[Color4Intense]
Color=247,112,103
[Color5]
Color=198,121,221
[Color5Faint]
Color=198,121,221
[Color5Intense]
Color=198,120,221
[Color6]
Color=255,196,107
[Color6Faint]
Color=240,185,101
[Color6Intense]
Color=247,192,104
[Color7]
Color=84,108,120
[Color7Faint]
Color=65,84,94
[Color7Intense]
Color=74,95,106
[Foreground]
Color=89,103,119
[ForegroundFaint]
Color=100,116,134
[ForegroundIntense]
Color=75,86,100
[General]
Blur=false
ColorRandomization=false
Description=Lisa
Opacity=1
Wallpaper=
" Vim syntax file
" Language: Scala
" Maintainer: Derek Wyatt
" URL: https://github.com/derekwyatt/vim-scala
" License: Same as Vim
" Last Change: 20 May 2016
" ----------------------------------------------------------------------------
if !exists('main_syntax')
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
let main_syntax = 'scala'
endif
scriptencoding utf-8
let b:current_syntax = "scala"
" Allows for embedding, see #59; main_syntax convention instead? Refactor TOP
"
" The @Spell here is a weird hack, it means *exclude* if the first group is
" TOP. Otherwise we get spelling errors highlighted on code elements that
" match scalaBlock, even with `syn spell notoplevel`.
function! s:ContainedGroup()
try
silent syn list @scala
return '@scala,@NoSpell'
catch /E392/
return 'TOP,@Spell'
endtry
endfunction
unlet! b:current_syntax
syn case match
syn sync minlines=200 maxlines=1000
syn keyword scalaKeyword catch do else final finally for forSome if
syn keyword scalaKeyword match return throw try while yield macro
syn keyword scalaKeyword class trait object extends with nextgroup=scalaInstanceDeclaration skipwhite
syn keyword scalaKeyword case nextgroup=scalaKeyword,scalaCaseFollowing skipwhite
syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
hi link scalaKeyword Keyword
exe 'syn region scalaBlock start=/{/ end=/}/ contains=' . s:ContainedGroup() . ' fold'
syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome
hi link scalaAkkaSpecialWord PreProc
syn keyword scalatestSpecialWord shouldBe
syn match scalatestShouldDSLA /^\s\+\zsit should/
syn match scalatestShouldDSLB /\<should\>/
hi link scalatestSpecialWord PreProc
hi link scalatestShouldDSLA PreProc
hi link scalatestShouldDSLB PreProc
syn match scalaSymbol /'[_A-Za-z0-9$]\+/
hi link scalaSymbol Number
syn match scalaChar /'.'/
syn match scalaChar /'\\[\\"'ntbrf]'/ contains=scalaEscapedChar
syn match scalaChar /'\\u[A-Fa-f0-9]\{4}'/ contains=scalaUnicodeChar
syn match scalaEscapedChar /\\[\\"'ntbrf]/
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
"hi link scalaChar Character
hi scalaChar ctermfg=72
hi link scalaEscapedChar Function
hi link scalaUnicodeChar Special
syn match scalaOperator "||"
syn match scalaOperator "&&"
syn match scalaOperator "|"
syn match scalaOperator "&"
hi link scalaOperator Special
syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList
syn match scalaNameDefinition /`[^`]\+`/ contained nextgroup=scalaPostNameDefinition
syn match scalaVariableDeclarationList /\s*,\s*/ contained nextgroup=scalaNameDefinition
syn match scalaPostNameDefinition /\_s*:\_s*/ contained nextgroup=scalaTypeDeclaration
hi link scalaNameDefinition Function
syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaInstanceHash
syn match scalaInstanceDeclaration /`[^`]\+`/ contained
syn match scalaInstanceHash /#/ contained nextgroup=scalaInstanceDeclaration
hi link scalaInstanceDeclaration Special
hi link scalaInstanceHash Type
syn match scalaUnimplemented /???/
hi link scalaUnimplemented ERROR
syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/
hi link scalaCapitalWord Special
" Handle type declarations specially
syn region scalaTypeStatement matchgroup=Keyword start=/\<type\_s\+\ze/ end=/$/ contains=scalaTypeTypeDeclaration,scalaSquareBrackets,scalaTypeTypeEquals,scalaTypeStatement
" Ugh... duplication of all the scalaType* stuff to handle special highlighting
" of `type X =` declarations
syn match scalaTypeTypeDeclaration /(/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals contains=scalaRoundBrackets skipwhite
syn match scalaTypeTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite
syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite
syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite
syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite
syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
hi link scalaTypeTypeDeclaration Type
hi link scalaTypeTypeExtension Keyword
hi link scalaTypeTypePostDeclaration Special
hi link scalaTypeTypePostExtension Keyword
syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite
syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite
syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite
syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeDeclaration skipwhite
hi link scalaTypeDeclaration Type
hi link scalaTypeExtension Keyword
hi link scalaTypePostExtension Keyword
syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration contains=scalaRoundBrackets
syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration
hi link scalaTypeAnnotation Normal
syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained
syn match scalaCaseFollowing /`[^`]\+`/ contained
hi link scalaCaseFollowing Special
syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
hi link scalaKeywordModifier Function
syn keyword scalaSpecial this true false ne eq
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
syn match scalaSpecial "\%(=>\|\|<-\|\|->\|\)"
syn match scalaSpecial /`[^`]\+`/ " Backtick literals
hi link scalaSpecial PreProc
syn keyword scalaExternal package import
hi link scalaExternal Include
syn match scalaStringEmbeddedQuote /\\"/ contained
syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar
"hi link scalaString String
hi scalaString ctermfg=72
hi link scalaStringEmbeddedQuote String
syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\ze\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
hi link scalaIString String
hi link scalaTripleIString String
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
exe 'syn region scalaInterpolationB matchgroup=scalaInterpolationBoundary start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
hi link scalaInterpolation Function
hi link scalaInterpolationB Normal
syn region scalaFString matchgroup=scalaInterpolationBrackets start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
exe 'syn region scalaFInterpolationB matchgroup=scalaInterpolationBoundary start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
hi link scalaFString String
hi link scalaFInterpolation Function
hi link scalaFInterpolationB Normal
syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleFString matchgroup=scalaInterpolationBrackets start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
hi link scalaTripleString String
hi link scalaTripleFString String
hi link scalaInterpolationBrackets Special
hi link scalaInterpolationBoundary Function
syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number
syn match scalaNumber /\%(\<\d\+\.\d*\|\.\d\+\)\%([eE][-+]\=\d\+\)\=[fFdD]\=/ " exponential notation 1
syn match scalaNumber /\<\d\+[eE][-+]\=\d\+[fFdD]\=\>/ " exponential notation 2
syn match scalaNumber /\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>/ " exponential notation 3
hi scalaNumber ctermfg=209
syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets
syn region scalaSquareBrackets matchgroup=scalaSquareBracketsBrackets start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter
syn match scalaTypeOperator /[-+=:<>]\+/ contained
syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
hi link scalaSquareBracketsBrackets Type
hi link scalaTypeOperator Keyword
hi link scalaTypeAnnotationParameter Function
syn match scalaShebang "\%^#!.*" display
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@Spell keepend fold
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
syn match scalaParameterAnnotation "\%(@tparam\|@param\|@see\)" nextgroup=scalaParamAnnotationValue skipwhite contained
syn match scalaParamAnnotationValue /[.`_A-Za-z0-9$]\+/ contained
syn region scalaDocLinks start="\[\[" end="\]\]" contained
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
syn match scalaTodo "\vTODO|FIXME|XXX" contained
hi link scalaShebang Comment
hi link scalaMultilineComment Comment
hi link scalaDocLinks Function
hi link scalaParameterAnnotation Function
hi link scalaParamAnnotationValue Keyword
hi link scalaCommentAnnotation Function
hi link scalaCommentCodeBlockBrackets String
hi link scalaCommentCodeBlock String
hi link scalaTodo Todo
syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/
hi scalaAnnotation ctermfg=111
syn match scalaTrailingComment "//.*$" contains=scalaTodo,@Spell
hi link scalaTrailingComment Comment
syn match scalaAkkaFSM /goto([^)]*)\_s\+\<using\>/ contains=scalaAkkaFSMGotoUsing
syn match scalaAkkaFSM /stay\_s\+using/
syn match scalaAkkaFSM /^\s*stay\s*$/
syn match scalaAkkaFSM /when\ze([^)]*)/
syn match scalaAkkaFSM /startWith\ze([^)]*)/
syn match scalaAkkaFSM /initialize\ze()/
syn match scalaAkkaFSM /onTransition/
syn match scalaAkkaFSM /onTermination/
syn match scalaAkkaFSM /whenUnhandled/
syn match scalaAkkaFSMGotoUsing /\<using\>/
syn match scalaAkkaFSMGotoUsing /\<goto\>/
hi link scalaAkkaFSM PreProc
hi link scalaAkkaFSMGotoUsing PreProc
let b:current_syntax = 'scala'
if main_syntax ==# 'scala'
unlet main_syntax
endif
" vim:set sw=2 sts=2 ts=8 et:
Host gitlab
User git
HostName gitlab.com
Preferredauthentications publickey
IdentityFile ~/.ssh/id_rsa_git
Host gitlab.com
User git
HostName gitlab.com
Preferredauthentications publickey
IdentityFile ~/.ssh/id_rsa_git
Host github
User git
HostName github.com
Preferredauthentications publickey
IdentityFile ~/.ssh/id_rsa_git
Host github.com
User git
HostName github.com
Preferredauthentications publickey
IdentityFile ~/.ssh/id_rsa_git
Host gist.github.com
User git
HostName github.com
Preferredauthentications publickey
IdentityFile ~/.ssh/id_rsa_git
Host okanon
User git
HostName github.com
Preferredauthentications publickey
IdentityFile ~/.ssh/id_rsa_git
[Appearance]
BoldIntense=false
ColorScheme=Lisa
Font=MonacoB,9,-1,5,50,0,0,0,0,0,レギュラー
[Cursor Options]
CursorShape=2
[General]
Name=ubuntu
Parent=FALLBACK/
TerminalColumns=135
TerminalRows=45
[Scrolling]
HistorySize=50000
[Terminal Features]
BlinkingCursorEnabled=true
set fenc=utf-8
set tabstop=3
set shiftwidth=3
set expandtab
set autoindent
set smartindent
set nobackup
set noswapfile
set autoread
set showcmd
set showmatch
set backspace=indent,eol,start
set t_Co=256
set background=light
autocmd ColorScheme * highlight Normal ctermbg=none
autocmd ColorScheme * highlight NonText ctermbg=none
autocmd ColorScheme * highlight LineNr ctermbg=none
colorscheme PaperColor
autocmd FileType c setlocal sw=3 ts=3 et
autocmd FileType scala setlocal sw=2 ts=2 et
autocmd FileType rust setlocal sw=4 ts=4 et
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('~/.vim/dein/')
call dein#begin('~/.vim/dein/')
" Let dein manage dein
" Required:
call dein#add('~/.vim/dein/repos/github.com/Shougo/dein.vim')
let s:tomld = $HOME . '/.vim/toml'
let s:toml = s:tomld . '/dein.toml'
call dein#load_toml(s:toml, {'lazy': 0})
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax on
" If you want to install not installed plugins on startup.
"if dein#check_install()
" call dein#install()
"endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment