moucheh

oop_ar_os_setup

Apr 16th, 2024 (edited)
1,121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.67 KB | Source Code | 0 0
  1. <<swap escape and caps lock>>
  2.  
  3. gsettings set org.gnome.desktop.input-sources xkb-options "['grp:alt_shift_toggle,caps:swapescape']"
  4.  
  5. <<fedora goodies>>
  6.  
  7. sudo nano /etc/dnf/dnf.conf
  8. max_parallel_downloads=10
  9. fastestmirror=true
  10.  
  11. sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
  12. sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
  13.  
  14. <<nix env>>
  15.  
  16. curl is a dependency
  17.  
  18. sudo pacman -S curl // arch
  19. sudo apt install curl // debian based distros
  20. sudo dnf install curl // rhel based distros
  21.  
  22. sh <( curl -L https://bit.ly/4h7TIdB )
  23. cd $HOME/fetnix/nix
  24.  
  25. ./fetch_shell cpp_shell
  26.  
  27. ./fetch_shell fsharp_shell
  28.  
  29. fetch should be run twice, the first time, then exit the shell and then rerun
  30.  
  31. on ubuntu 24.04 LTS, code should be run with --no-sandbox option e.g.
  32. code --no-sandbox .
  33.  
  34. <<install docker>> // deprecated
  35.  
  36. wget -qO- https://get.docker.com/ | sudo sh && \
  37. sudo usermod -a -G docker $USER && \
  38. sudo shutdown -r 0
  39.  
  40. sudo systemctl enable docker
  41. sudo systemctl start docker
  42.  
  43. <<docker container fet_base, native>>
  44.  
  45. wget -q -O- https://gitlab.com/amer.hasanovic/fet_base/raw/master/install | sudo bash
  46.  
  47. <<docker container fet_base, virtual>>
  48.  
  49. wget -qO- https://gitlab.com/amer.hasanovic/fet_base/raw/master/install_vbox | sudo bash
  50.  
  51. <<docker container fet_ar>>
  52.  
  53. docker pull registry.gitlab.com/amer.hasanovic/fet_ar:latest
  54.  
  55. <<bash script source and tmux enable>>
  56.  
  57. if [ -d "/opt1/" ]; then
  58.    export TERM=xterm-256color
  59.    source /opt1/script.sh
  60.    [ -z "$TMUX" ] && exec tmux
  61. fi
  62.  
  63. <<source ~/.bash_aliases>>
  64.  
  65. if [ -f ~/.bash_aliases ]; then
  66. . ~/.bash_aliases
  67. fi
  68.  
  69. <<~/.bash_aliases>>
  70.  
  71. #!/bin/bash
  72.  
  73. make_directory_and_cd_into_it () {
  74.     mkdir $1
  75.     cd $1
  76. }
  77.  
  78. alias sc='sudo start_container'
  79.  
  80. alias clr='clear'
  81. alias md='make_directory_and_cd_into_it'
  82.  
  83. alias run='clear && ./main'
  84. alias bldc='clear && gcc -o *.c main.c -lm'
  85. alias bldnrunc='gcc -o main *.c -lm && clear && ./main'
  86.  
  87. alias bldcpp='clear && g++ -std=c++17 *.cpp -o main'
  88. alias bldnruncpp='g++ -std=c++17 *.cpp -o main && clear && ./main'
  89.  
  90. alias bldwas='clang++ -fsanitize=address *.cpp -o main'
  91. alias bldwasc='clang++ -fsanitize=address *.c -o main'
  92.  
  93. alias vim='nvim'
  94. alias vi='nvim'
  95.  
  96. <<__git_ps1 command not found fix>>
  97.  
  98. curl -L https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > ~/.bash_git
  99.  
  100. if [ -f ~/.bash_git ]; then
  101. . ~/.bash_git
  102. fi
  103.  
  104. <<nvchad setup>>
  105.  
  106. git clone https://github.com/NvChad/starter ~/.config/nvim && nvim
  107.  
  108. :MasonInstallAll
  109.  
  110. rm -rf ~/.config/nvim/.git
  111.  
  112. <<bash functions for compiling mips and running gdb>>
  113.  
  114. if [ -f ~/.bash_functions ]; then
  115. . ~/.bash_functions
  116. fi
  117.  
  118. # add to .bash_functions
  119.  
  120. # $1 - input files, if multiple put in double quotes
  121. # $2 - output file name
  122.  
  123. run_mips_db () {
  124.    ecc -g -target mips32r2el-linux $1 -o $2
  125.    qemu-mipsel -g 1234 $2&
  126.    gdb-multiarch -q $2
  127. }
  128.  
  129. run_mips_cpp_db () {
  130.    ecc++ -std=c++11 -g -target mips32r2el-linux $1 -o $2
  131.    qemu-mipsel -g 1234 $2&
  132.    gdb-multiarch -q $2
  133. }
  134.  
  135. compile_mips () {
  136.    ecc $1 -target mips32r2el-linux -o $2
  137. }
  138.  
  139. compile_mips_cpp () {
  140.    ecc++ -std=c++11 $1 -target mips32r2el-linux -o $2
  141. }
  142.  
  143. <<~/.gitconfig>>
  144.  
  145. [user]
  146.   email = your_name@example.com
  147.   name = your_name
  148.  
  149. [init]
  150.   defaultBranch = main
  151.  
  152. [push]
  153.   autoSetupRemote = true
  154.  
  155. [url "ssh://[email protected]/"]
  156.   insteadOf = https://github.com/
  157.  
  158. [url "ssh://[email protected]/"]
  159.   insteadOf = https://gitlab.com/
  160.  
  161. <<ssh>>
  162.  
  163. ssh-keygen -t ed25519 -C "identifier"
  164.  
  165. # add the public key to your github/gitlab account
  166.  
  167. eval "$(ssh-agent -s)"
  168.  
  169. ssh-add key_name
Add Comment
Please, Sign In to add comment