-
Notifications
You must be signed in to change notification settings - Fork 0
/
fresh_fedora_setup.sh
executable file
·238 lines (195 loc) · 8.21 KB
/
fresh_fedora_setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#!/bin/sh
# This script is intended to be run on freshly installed fedora.
# It is my personal list of programs that I use and want to install as easily as possible.
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
echo "Type \"su\" provide admin password and rerun."
echo "If you haven't established root password yet, type \"sudo passwd root\" and provide password to be used for \"su\""
exit 1
fi
dnf install vim -y
dnf install htop -y
# adobe flash player (for FB, YT,...)
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
dnf install flash-plugin -y
# video codec
dnf install ffmpeg-libs -y
# Java
# Fedora should include support for Java via OpenJDK
dnf install java icedtea-web -y
# audio
dnf install xmms xmms-mp3 xmms-faad2 xmms-flac xmms-pulse xmms-skins -y
# audio codecs gst-plugins-ugly
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -y
dnf install gstreamer1-{ffmpeg,libav,plugins-{good,ugly,bad{,-free,-nonfree}}} --setopt=strict=0 -y
# video player
dnf install vlc -y
# guake
dnf install guake -y
# guake autostart
cp /usr/share/applications/guake.desktop /etc/xdg/autostart/
# manual settings: color=#1ec503
# Palette: right-most, top field
# Arduino IDE + fix
ARD_VERSION="1.8.19"
wget https://downloads.arduino.cc/arduino-${ARD_VERSION}-linux64.tar.xz -P ~
tar xvf ~/arduino-${ARD_VERSION}-linux64.tar.xz
rm arduino-${ARD_VERSION}-linux64.tar.xz
~/arduino-${ARD_VERSION}/install.sh
rm -rf java # fix "no menu"
# see the issue:
# https://github.com/arduino/Arduino/issues/11150
# Another fix may be needed
#dnf install java-latest-openjdk # fix
#printf "##########################################################"
#printf "Pick the line that says \"java-latest\""
#printf "##########################################################"
#alternatives --config java
# Sublime text 3
echo "Sublime Text editor works without buying license, but your company might get in trouble"
INSTALL=0
while true; do
read -p "Do you wish to install this program? [y/n] " yn
case $yn in
[Yy]* ) echo "installing"; INSTALL=1; break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
if [[ $INSTALL == 1 ]]; then
rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
dnf config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
dnf install sublime-text
#Update
#dnf and install Sublime Text
# Sublime addon: Package controll
echo "Manual install of Sublime-text package controll:"
echo "https://packagecontrol.io/installation"
# Sublime addon: SFTP
echo "Manual install of Sublime-text SFTP:"
echo "https://wbond.net/sublime_packages/sftp/installation"
fi
# M$ stuff
dnf install unar -y # for .RAR archives
dnf install abiword -y # for .RTF text files
# Teams
wget https://packages.microsoft.com/yumrepos/ms-teams/teams-1.2.00.32451-1.x86_64.rpm
dnf localinstall teams-1.2.00.32451-1.x86_64.rpm -y
# prevent new windows stealing focus
# only for gnome
gconftool-2 --set /apps/metacity/general/focus_new_windows --type string strict
# read more here:
# http://bertrandbenoit.blogspot.com/2011/09/change-window-behavior-to-prevent-focus.html
#
# Manual GMONE plugins
# https://extensions.gnome.org/extension/1414/unblank/
# https://extensions.gnome.org/extension/3933/toggle-night-light/
# Bitcoin Markets tray addon / widget
git clone https://github.com/OttoAllmendinger/gnome-shell-bitcoin-markets.git
cd gnome-shell-bitcoin-markets
make install
cd -
# cmd-line app for YouTube (YT) download and conversion
dnf install youtube-dl -y
# Example: download video
#youtube-dl https://www.youtube.com/watch?v=k0kg80jAtI8
# Example: download and convert to MP3
#youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=kRb41Joq-94&list=PL_MHjKxnHz1sm0YARyIdgev09N9A-3FEP
#############################
# git setup
# more readable log and also make alias log -> l
# usage:
# git l
git config --global alias.l "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# more aliases
git config --global alias.s status
git config --global alias.a add
git config --global alias.c commit
git config --global alias.ch checkout
#git config --global alias.d diff # uses standard diff
git config --global diff.tool vimdiff # setup vimdiff for git diff tool
git config --global merge.tool vimdiff # setup vimdiff for git merge tool
git config --global difftool.prompt false # stop asking every time if I really want to use vimdiff - fuck yeah I do!
git config --global alias.d difftool # shortcut: git diff > git d
git config --global alias.r restore
# TODO alias with parameter (not from user) example git c == git commit -m
# stop asking git for username and Password
# prerequisite - generate SSH key on computer and load it in web account
# https://docs.github.com/en/github/using-git/changing-a-remotes-url
# Change the current working directory to your local project.
# git remote -v
# git remote set-url origin [email protected]:USERNAME/REPOSITORY.git
# git remote -v
# vim shortcuts:
#1st. Put this to your ~/.bashrc
printf "bind -r '\C-s'\nstty -ixon" >> ~/.bashrc
# 2nd. Place this to your ~/.vimrc
printf "inoremap <C-s> <esc>:w<cr> \" save files\nnnoremap <C-s> :w<cr>\ninoremap <C-d> <esc>:wq\!<cr> \" save and exit\nnnoremap <C-d> :wq\!<cr>\ninoremap <C-q> <esc>:qa\!<cr> \" quit discarding changes\nnnoremap <C-q> :qa\!<cr>" >> ~/.vimrc
# vim line numbers
echo ":set number" >> ~/.vimrc
# install tray icons as extension of gnome
dnf install gnome-shell-extension-topicons-plus.noarch -y
echo "Manualy install TopIcons Plus from page:"
echo "https://extensions.gnome.org/extension/1031/topicons/"
echo ""
echo "Manually install Gnome extensions for vertical workspaces"
echo "https://extensions.gnome.org/extension/4144/vertical-overview/"
# Add cdl function - shortcut for cd;ll
echo "" >> ~/.bashrc
echo "# Calling \"cdl <folder_name>\" is equal to \"cd <folder_name>; ll\"" >> ~/.bashrc
echo "function cdl() {" >> ~/.bashrc
echo "# echo \"cd \\\"\$1\\\"; ll\"" >> ~/.bashrc
echo " cd \"\$1\"" >> ~/.bashrc
echo " ll" >> ~/.bashrc
echo "}" >> ~/.bashrc
source ~/.bashrc
#### Manualy put to .bashrc
# subl ~/.bashrc
# # Set up aliases
# alias flash="my_flash"
# alias fl="flash"
# alias f="flash"
# alias terminal="my_terminal"
# alias term="terminal"
# alias t="terminal"
# alias serial="terminal"
# alias ser="terminal"
# alias s="terminal"
# alias flt="my_flt"
# alias ft="flt"
# #alias all="make && flash && terminal"
# alias all="make -j EXTRAFLAGS+=\"-DESP32_IGNORE_CHIP_REVISION_CHECK\" && flash && terminal"
source ~/.bashrc
exit
### Connect to shared folder from Windoze
## In Windoze:
# Right click on drive - properties - sharing - share - add name and description
# in the properties - security - add - advanced - Everyone - ok - tick full controll and modify - OK (takes sime time)
# note: it is better to use network path name instead of ip.
# The network path name can be found in the sharing tab in properties
# it will look something like:
# \\DESKTOP-ABCDEGH\Shared_folder_name
##In Fedora
#https://tecadmin.net/mount-remote-windows-share-on-linux/
nmblookup <Windoze IP> -A
# this will print the Windoze machine network name
# this is better to use instead of IP which can change in tame
#create mount point - where you want the folder to be located:
mkdir ~/Windoze_Multimedia
# mount:
sudo mount -t cifs //WINDOWS_NETWORK_NAME/SHARE_NAME ~/Windoze_Multimedia -o username=WINDOZE_USERNAME,password=WINDOZE_PASSWORD
# but this is onetime and it will brake after turning off either of the computers (probably)
sudo subl /etc/cifs-credentials
# add the folowing - obviously type in your real windows username and password
username=WINDOZE_USERNAME
password=WINDOZE_PASSWORD
# save and close the file and then:
sudo chmod 600 /etc/cifs-credentials
sudo subl /etc/fstab
# add line
//WINDOWS_NETWORK_NAME/SHARE_NAME /mnt/windows-share cifs credentials=/etc/cifs-credentials,uid=1000,gid=1000 0 0
# test
df -h
# in case of problems
sudo chown -R $USER:$USER ~/Windoze_Multimedia