1 Commits

Author SHA1 Message Date
anthony 5970e9b968 Moved from ./install/todo 2022-07-04 22:13:41 +08:00
87 changed files with 1062 additions and 4206 deletions
-13
View File
@@ -1,13 +0,0 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
[{install/*, uninstall/*, upgrade/*}]
indent_style = space
indent_size = 4
[{packs/*, Makefile*}]
indent_style = tab
indent_size = 4
-4
View File
@@ -1,5 +1 @@
.DS_Store
*.bak
*.log
.env
*.env*
-13
View File
@@ -1,13 +0,0 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2022 Антон Аксенов <anthonyaxenov@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
+50 -374
View File
@@ -1,438 +1,114 @@
# Autogenerated at 10.07.2026 15:03 using ./gen-makefile
.DEFAULT_GOAL := help
# Autogenerated at 04.07.2022 22:11 using ./gen-makefile.sh
#===============================================
# Scripts listed in ./install
#===============================================
##lamp: Apache + php + mariadb
lamp: apache php mariadb
##apache: Install apache2 (latest)
apache:
./install/apache
##anytype: Manage anytype (deb)
anytype:
@./install/anytype install
##apache2: Manage apache2 (apt)
apache2:
@./install/apache2 install
##apt: Install basic software from apt
##apt: Install bunch of software from apt
apt:
@./install/apt install
./install/apt
##brew: Install software from brew
brew:
@./install/brew install
##canon-mg2500: Canon Pixma MG2500 + ppa
canon-mg2500:
@./install/canon-mg2500 install
##chrome: Google Chrome (latest)
##chrome: Install google chrome (latest)
chrome:
@./install/chrome install
##clamav: ClamAV
clamav:
@./install/clamav install
./install/chrome
##composer: Install composer (latest)
composer:
@./install/composer install
./install/composer
##docker: Docker + ppa
##docker: Install docker (latest) + docker-compose (latest) + ppa
docker:
@./install/docker install
./install/docker
##droidcam: Install droidcam v1.9.0
##droidcam: Install droidcam v1.8.2
droidcam:
@./install/droidcam install
./install/droidcam
##droidcam-obs: Install droidcam-obs plugin v1.5.1
droidcam-obs:
@./install/droidcam-obs install
##_example: Example script
_example:
@./install/_example install
##flameshot: Install flameshot (latest)
flameshot:
@./install/flameshot install
./install/droidcam-obs
##git: Install git (latest)
git:
@./install/git install
./install/git
##golang: Install golang
##golang: Install golang v1.18.3
golang:
@./install/golang install
./install/golang
##grub-customizer: Install grub-customizer (latest + ppa)
grub-customizer:
@./install/grub-customizer install
##grubc: Install grub-customizer (latest) + ppa
grubc:
./install/grubc
##kde-appmenu: Install KDE Window AppMenu Applet
kde-appmenu:
@./install/kde-appmenu install
./install/kde-appmenu
##kde-backports: Install KDE Backports
kde-backports:
@./install/kde-backports install
##kde-file-templates: Install file templates (KDE)
kde-file-templates:
@./install/kde-file-templates install
##kde-portal: Install KDE portal
kde-portal:
@./install/kde-portal install
##keyd: Install keyd
keyd:
@./install/keyd install
##libreoffice: Install libreoffice
libreoffice:
@./install/libreoffice install
##lite-xl: Install lite-xl v2.1.7
##lite-xl: Install lite-xl v2.0.5 (draft)
lite-xl:
@./install/lite-xl install
##llmfit: Install llmfit
llmfit:
@./install/llmfit install
./install/lite-xl
##mariadb: Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed)
mariadb:
@./install/mariadb install
##nerd-fonts: Install nerd-fonts
nerd-fonts:
@./install/nerd-fonts install
./install/mariadb
##nodejs: Install nodejs + npm via nvm
nodejs:
@./install/nodejs install
##ntfy: Install ntfy (latest) + ppa
ntfy:
@./install/ntfy install
##nvim: Install nvim + lazyvim
nvim:
@./install/nvim install
##obs-studio: Install obs-studio (latest snap)
obs-studio:
@./install/obs-studio install
##ollama: Install ollama
ollama:
@./install/ollama install
##omz-clean: Install omz (latest)
omz-clean:
@./install/omz-clean install
##omz-fancy: Install omz fancy (powerline10k + MesloLGS font)
omz-fancy:
@./install/omz-fancy install
##openvpn: Install openvpn v2.6.3 (src)
openvpn:
@./install/openvpn install
##papirus: Install papirus-icon-theme (latest)
papirus:
@./install/papirus install
./install/nodejs
##pgsql: Install postgresql (latest) and php-pgsql (if php is installed)
pgsql:
@./install/pgsql install
./install/pgsql
##php: Install php v8.4
##php: Install php v8.1 + ppa
php:
@./install/php install
##phpcs: Install phpcs + php-cs-fixer
phpcs:
@./install/phpcs install
##phpmd: Install phpmd
phpmd:
@./install/phpmd install
##php-psalm: Install psalm
php-psalm:
@./install/php-psalm install
##php-spx: Install php-spx
php-spx:
@./install/php-spx install
##phpstan: Install phpstan
phpstan:
@./install/phpstan install
##phpunit: Install phpunit
phpunit:
@./install/phpunit install
./install/php
##postman: Install postman (latest)
postman:
@./install/postman install
./install/postman
##qt5: Install qt5
qt5:
@./install/qt5 install
##rustdesk: Install rustdesk client v1.4.2 (deb)
##rustdesk: Install rustdesk v1.1.8 (deb)
rustdesk:
@./install/rustdesk install
./install/rustdesk
##snap: Install bunch of software from snap
snap:
@./install/snap install
##sublimemerge: Install Sublime Merge
sublimemerge:
@./install/sublimemerge install
##sublimetext: Install Sublime Text
sublimetext:
@./install/sublimetext install
##suld: Samsung Unified Linux Driver repo
suld:
@./install/suld install
./install/snap
##syncthing: Install syncthing (latest) + ppa
syncthing:
@./install/syncthing install
./install/syncthing
##telebit: Install telebit (latest)
telebit:
@./install/telebit install
##telegram: Install telegram (latest)
telegram:
@./install/telegram install
##tilt: Install tilt (k8s dev env)
tilt:
@./install/tilt install
./install/telebit
##ulauncher: Install ulauncher (latest) + ppa
ulauncher:
@./install/ulauncher install
./install/ulauncher
##vivaldi: Install Vivaldi + ppa
vivaldi:
@./install/vivaldi install
##vscode: VSCode deb-package
vscode:
@./install/vscode install
##wine: Install wine (latest) + ppa
##wine: Install wine (latest) + ppa (focal)
wine:
@./install/wine install
##youtube-dl: Install youtube-dl (src)
youtube-dl:
@./install/youtube-dl install
##ytdlcue: Install ytdlcue
ytdlcue:
@./install/ytdlcue install
./install/wine
##zint: Install zint (latest)
zint:
@./install/zint install
./install/zint
##zsh: Install vanilla zsh
##zsh: Install zsh + omz (latest)
zsh:
@./install/zsh install
./install/zsh
#===============================================
# Scripts listed in ./packs
#===============================================
##lamp: [PACK] Apache + php + mariadb
lamp: apache phpstack mariadb
##obs: [PACK] Install OBS Studio + droidcam-obs
obs: obs-studio droidcam-obs
##omz: [PACK] zsh + omz + powerline10k + MesloLGS font
omz: zsh omz-clean omz-fancy
chsh -s /usr/bin/zsh
@exec zsh
##phptools: [PACK] Install only php tooling (composer, phpunit, psalm, phpcs, php-cs-fixer, phpmd)
phptools: composer php-psalm phpcs phpmd phpstan phpunit
##phpstack: [PACK] Install full php stack with tooling
phpstack: php phptools
#===============================================
# Upgrade targets (use install script with 'upgrade' arg)
#===============================================
##^apache2: Manage apache2 (apt)
^apache2:
@./install/apache2 upgrade
##^apt: Install basic software from apt
^apt:
@./install/apt upgrade
##^canon-mg2500: Canon Pixma MG2500 + ppa
^canon-mg2500:
@./install/canon-mg2500 upgrade
##^chrome: Google Chrome (latest)
^chrome:
@./install/chrome upgrade
##^clamav: ClamAV
^clamav:
@./install/clamav upgrade
##^composer: Install composer (latest)
^composer:
@./install/composer upgrade
##^docker: Docker + ppa
^docker:
@./install/docker upgrade
##^golang: Install golang
^golang:
@./install/golang upgrade
##^keyd: Install keyd
^keyd:
@./install/keyd upgrade
##^llmfit: Install llmfit
^llmfit:
@./install/llmfit upgrade
##^omz-clean: Install omz (latest)
^omz-clean:
@./install/omz-clean upgrade
#===============================================
# Remove targets (use install script with 'remove' arg)
#===============================================
##/anytype: Manage anytype (deb)
/anytype:
@./install/anytype remove
##/apache2: Manage apache2 (apt)
/apache2:
@./install/apache2 remove
##/canon-mg2500: Canon Pixma MG2500 + ppa
/canon-mg2500:
@./install/canon-mg2500 remove
##/chrome: Google Chrome (latest)
/chrome:
@./install/chrome remove
##/clamav: ClamAV
/clamav:
@./install/clamav remove
##/composer: Install composer (latest)
/composer:
@./install/composer remove
##/docker: Docker + ppa
/docker:
@./install/docker remove
##/golang: Install golang
/golang:
@./install/golang remove
##/grub-customizer: Install grub-customizer (latest + ppa)
/grub-customizer:
@./install/grub-customizer remove
##/keyd: Install keyd
/keyd:
@./install/keyd remove
##/lite-xl: Install lite-xl v2.1.7
/lite-xl:
@./install/lite-xl remove
##/llmfit: Install llmfit
/llmfit:
@./install/llmfit remove
##/nerd-fonts: Install nerd-fonts
/nerd-fonts:
@./install/nerd-fonts remove
##/nodejs: Install nodejs + npm via nvm
/nodejs:
@./install/nodejs remove
##/nvim: Install nvim + lazyvim
/nvim:
@./install/nvim remove
##/ollama: Install ollama
/ollama:
@./install/ollama remove
##/omz-clean: Install omz (latest)
/omz-clean:
@./install/omz-clean remove
##/rustdesk: Install rustdesk client v1.4.2 (deb)
/rustdesk:
@./install/rustdesk remove
##/sublimemerge: Install Sublime Merge
/sublimemerge:
@./install/sublimemerge remove
##/sublimetext: Install Sublime Text
/sublimetext:
@./install/sublimetext remove
##/vivaldi: Install Vivaldi + ppa
/vivaldi:
@./install/vivaldi remove
##/wine: Install wine (latest) + ppa
/wine:
@./install/wine remove
#===============================================
# Service goals
#===============================================
self:
@./gen-makefile
##help: Show this help message
help: Makefile
@echo "Ubuntu software installator"
@echo
@echo "Usage:"
@echo "\tmake help\t - show this help"
@echo "\tmake self\t - regenerate Makefile (alias of ./gen-makefile)"
@echo "\tmake GOAL\t - install software"
@echo "\tmake ^GOAL\t - upgrade software"
@echo "\tmake /GOAL\t - uninstall software"
@echo "\nYou can combine GOALs, here are some examples:"
@echo "\tmake /docker docker"
@echo "\tmake php /docker ^omz"
@echo "\nAvailable GOALs:"
@sed -n 's/^##//p' $< | column -ts ':' | sed -e "s/^/\t/"
+%:
@make
@echo "\tmake <goal>\n"
@echo "Available goals:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e "s/^/\t/"
##<goal>_: Same as 'cat ./install/<goal>.sh'
%_:
@cat ./install/$*.sh
+38 -64
View File
@@ -1,57 +1,61 @@
# My shell environment
# My Ubuntu environment
`make`-ready bunch of scripts for easily (de)installation of different software and bunch of useful handy functions for custom scripting.
`make`-ready bunch of scripts for easily installation of different software.
## Requirements
* Ubuntu >= 20.04 (not tested with version < 20)
* `bash`, `zsh` or other `sh`-compatible shell
* `make` (optional but recommended)
* `wget` (required for some scripts)
* `git` (required for some scripts)
If some dependencies are missed for some of these scripts, it is enough to run `./install/apt` in most cases; otherwise the script will suggest (or even install) them.
* `wget` (necessary for some scripts)
* `git` (necessary for some scripts)
## Usage
```shell
# with git
git clone git@git.axenov.dev:anthony/shell.git --depth=1 --single-branch
### Clone this repo (recommended)
# without git
wget -qO - https://git.axenov.dev/anthony/shell/archive/master.tar.gz | tar -zxf -
```shell
# if git is installed
git clone git@git.axenov.dev:anthony/my-env.git --depth=1
# if git is not installed
wget -qO - https://git.axenov.dev/anthony/my-env/archive/master.tar.gz | tar -zxf -
# switch to repo dir
cd my-env
# get full list of `make` goals
cd shell && make
make help
# generate new ./Makefile and get full list of `make` goals
./gen-makefile.sh
```
## How to add my script?
### Selective straightforward installation
1. Create a new shell script in `./install` directory.
At the beginning of a file you must write these two lines:
```shell
# from remote file
wget -qO - https://git.axenov.dev/anthony/my-env/raw/branch/master/install/apt.sh | bash
# from locally cloned repo
./install/apt.sh
```
## How to add a new software script?
1. Create new `./install/*.sh` script.
At the beggining of a file you must write these two lines:
```shell
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Your description for Makefile
```
2. Implement `install()`, `upgrade()` and/or `remove()` functions with `set -eo pipefail` and a trailing `case "$1"` block.
3. Make this script executable, e.g.:
```shell
chmod +x ./install/myscript
```
4. Test your script standalone:
```shell
./install/myscript install
./install/myscript upgrade
./install/myscript remove
```
5. Run `make self` to regenerate `./Makefile`
2. Test your script
3. Run `./gen-makefile.sh` to generate new `./Makefile`
## How to create a pack?
## How to create packs?
You can create new file inside `./packs` dir.
Syntax is same as classic makefile.
It is important to add a comment with short description:
Syntax is same as classic makefile with one important and necessary addition -- a comment started with `##`:
```makefile
##mypack1: Pack description
@@ -59,42 +63,12 @@ mypack1: goal1 goal2 goalX ...
...
##mypackX: Pack description
mypackX: goalA goalB
mypackY: goalA goalB
@cp file1 file2
...
...
```
where:
* `mypack*` is the pack name of your choice
* `mypack*` is the pack name
* `goal*` are script names in `./install`
## Useful links and sources used
* https://gist.github.com/anthonyaxenov/d53c4385b7d1466e0affeb56388b1005
* https://gist.github.com/anthonyaxenov/89c99e09ddb195985707e2b24a57257d
* ...and other my [gists](https://gist.github.com/anthonyaxenov/) with [SHELL] prefix
* https://github.com/nvie/gitflow/blob/develop/gitflow-common (BSD License)
* https://github.com/petervanderdoes/gitflow-avh/blob/develop/gitflow-common (FreeBSD License)
* https://github.com/vaniacer/bash_color/blob/master/color
* https://misc.flogisoft.com/bash/tip_colors_and_formatting
* https://www-users.york.ac.uk/~mijp1/teaching/2nd_year_Comp_Lab/guides/grep_awk_sed.pdf
* https://www.galago-project.org/specs/notification/
* https://laurvas.ru/bash-trap/
* https://stackoverflow.com/a/52674277
* https://rtfm.co.ua/bash-funkciya-getopts-ispolzuem-opcii-v-skriptax/
* https://gist.github.com/jacknlliu/7c51e0ee8b51881dc8fb2183c481992e
* https://gist.github.com/anthonyaxenov/d53c4385b7d1466e0affeb56388b1005
* https://github.com/nvie/gitflow/blob/develop/gitflow-common
* https://github.com/petervanderdoes/gitflow-avh/blob/develop/gitflow-common
* https://gitlab.com/kyb/autorsync/-/blob/master/
* https://lug.fh-swf.de/vim/vim-bash/StyleGuideShell.en.pdf
* https://www.thegeekstuff.com/2010/06/bash-array-tutorial/
* https://www.distributednetworks.com/linux-network-admin/module4/ephemeral-reserved-portNumbers.php
* https://github.com/community-scripts/ProxmoxVE/tree/main/install
* https://github.com/community-scripts/ProxmoxVE/tree/main/misc
* https://faculty.cs.niu.edu/~hutchins/csci480/signals.htm
## License
[WTFPLv2](LICENSE) but other licences are also possible.
-11
View File
@@ -1,11 +0,0 @@
# Todo list
* tdesktop (https://desktop.telegram.org)
* spoofdpi (https://git.axenov.dev/mirrors/SpoofDPI/tags)
* lazynvim (https://www.lazyvim.org)
* build: [flameshot](https://github.com/flameshot-org/flameshot#compilation)
* build: [rustdesk](https://github.com/rustdesk/rustdesk#build)
* update scripts (when possible)
* uninstall scripts (when possible)
* ...
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
echo
echo "==============================================="
echo "Installing flatpak and its software..."
echo "==============================================="
echo
sudo apt install -y --autoremove \
flatpak \
gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
+49
View File
@@ -0,0 +1,49 @@
#!/bin/bash
echo
echo "==============================================="
echo "Installing oci8..."
echo "==============================================="
echo
# https://www.oracle.com/cis/database/technologies/instant-client/downloads.html
#check for
# wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linuxx64.zip
# wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip -- only libociicus.so
# wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sqlplus-linuxx64.zip
# wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-tools-linuxx64.zip
# wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip
#unzip
sudo mkdir /opt/oracle/
sudo mv ~/Downloads/instant_client/ /opt/oracle/
sudo sh -c "echo /opt/oracle/instant_client > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig
sudo apt install -y --autoremove \
php-dev \
php-pear \
build-essential \
libaio1 \
default-jdk
sudo pecl channel-update pecl.php.net
sudo pecl install oci8 # php8
#sudo pecl install oci8-2.2.0 # php7
#sh -c "echo '; priority=10' > /etc/php/7.4/mods-available/oci8.ini"
# sudo sh -c "echo 'extension=oci8.so' >> /etc/php/7.4/mods-available/oci8.ini"
# sudo chmod 0644 /etc/php/7.4/mods-available/oci8.ini
sudo phpenmod oci8
php -i | grep oci8
# instantclient,/opt/oracle/instant_client
# https://pecl.php.net/package/oci8
#sudo pecl install oci8-2.2.0
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
echo
echo "==============================================="
echo "Installing phpstorm-url-handler..."
echo "==============================================="
echo
installed() {
command -v "$1" >/dev/null 2>&1
}
# https://github.com/rozwell/phpstorm-url-handler/
# https://askubuntu.com/a/1023143
# https://askubuntu.com/a/919825
# https://medium.com/swlh/custom-protocol-handling-how-to-8ac41ff651eb
# https://www.linuxquestions.org/questions/linux-desktop-74/xdg-open-doesn%27t-recognize-custom-protocol-4175433062/#post4809984
sudo rm -rf /usr/bin/phpstorm-url-handler >/dev/null
sudo rm -rf ~/.local/share/applications/phpstorm-url-handler.desktop >/dev/null
sudo rm -rf /usr/share/applications/phpstorm-url-handler.desktop >/dev/null
if installed "git"; then
sudo git clone https://github.com/rozwell/phpstorm-url-handler.git /usr/src/phpstorm-url-handler
else
sudo wget https://github.com/rozwell/phpstorm-url-handler/archive/master.zip -O /tmp/phpstorm-url-handler.zip
sudo unzip /tmp/phpstorm-url-handler.zip -d /usr/src/phpstorm-url-handler
sudo rm -f /tmp/phpstorm-url-handler.zip
fi
info "Copy .desktop"
sudo cp /usr/src/phpstorm-url-handler/phpstorm-url-handler.desktop /usr/share/local/applications/phpstorm-url-handler.desktop
info "Symlink bin"
sudo cp /usr/src/phpstorm-url-handler/phpstorm-url-handler /usr/bin/phpstorm-url-handler
info "desktop-file-install"
sudo desktop-file-install phpstorm-url-handler.desktop
info "update-desktop-database"
sudo update-desktop-database -v 2>&1 | grep -E "^(.+)\/phpstorm-url-handler.desktop(.+)$"
info "xdg-mime"
xdg-mime default phpstorm-url-handler.desktop x-scheme-handler/phpstorm
+46
View File
@@ -0,0 +1,46 @@
#!/bin/bash
echo
echo "==============================================="
echo "Installing samp-server v03svr_R2-1..."
echo "==============================================="
echo
# https://sampwiki.blast.hk/wiki/Linux_Server
# https://team.sa-mp.com/wiki/Server.cfg_RU.html
cd $HOME
wget -qO - https://files.sa-mp.com/samp03svr_R2-1.tar.gz | tar -zxf -
# sudo dpkg --add-architecture i386
# sudo apt update
# sudo apt install -y libc6:i386
apt-get install ia32-libs
echo "echo Executing Server Config...
lanmode 0
rcon 1
language Russian
rcon_password bootsector
maxplayers 50
port 7777
hostname My Server
gamemode0 bare 1
filterscripts base gl_actions gl_property gl_realtime
announce 1
query 1
weburl
maxnpc 0
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 800.0
stream_rate 1000
timestamp 1
output 0
" > $HOME/samp03/server.cfg
ln -s $HOME/samp03/samp03svr /usr/local/bin/samp
echo
echo "Success! Now run via 'samp &'"
echo
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
echo
echo "==============================================="
echo "Installing wkhtmltopdf..."
echo "==============================================="
echo
# не тестировалось
wget "https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb" -O /tmp/wkhtmltopdf.deb
sudo dpkg -i /tmp/wkhtmltopdf.deb
rm /tmp/wkhtmltopdf.deb
-100
View File
@@ -1,100 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
[ -f Makefile ] && mv Makefile Makefile.bak
CHR_UPGRADE='^'
CHR_UNINSTALL='/'
cat << EOF > Makefile
# Autogenerated at $(date +'%d.%m.%Y %H:%M') using ${BASH_SOURCE[0]}
.DEFAULT_GOAL := help
#===============================================
# Scripts listed in ./install
#===============================================
EOF
for file in ./install/*; do
name=${file##*/}
name=${name%.sh}
desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file})
[ -z "$desc" ] && desc='<no description>'
echo -e "##${name}: ${desc}\n${name}:\n\t@${file} install\n" >> Makefile
done;
cat << EOF >> Makefile
#===============================================
# Scripts listed in ./packs
#===============================================
EOF
for file in ./packs/*; do
cat "$file" >> Makefile
echo >> Makefile
done;
cat << EOF >> Makefile
#===============================================
# Upgrade targets (use install script with 'upgrade' arg)
#===============================================
EOF
for file in ./install/*; do
name=${file##*/}
name=${name%.sh}
[ "$name" = "_example" ] && continue
has_upgrade=$(grep -q '^upgrade() {' ${file} && echo yes || echo no)
[ "$has_upgrade" = "no" ] && continue
desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file})
[ -z "$desc" ] && desc='<no description>'
echo -e "##${CHR_UPGRADE}${name}: ${desc}\n${CHR_UPGRADE}${name}:\n\t@${file} upgrade\n" >> Makefile
done;
cat << EOF >> Makefile
#===============================================
# Remove targets (use install script with 'remove' arg)
#===============================================
EOF
for file in ./install/*; do
name=${file##*/}
name=${name%.sh}
[ "$name" = "_example" ] && continue
has_remove=$(grep -q '^remove() {' ${file} && echo yes || echo no)
[ "$has_remove" = "no" ] && continue
desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file})
[ -z "$desc" ] && desc='<no description>'
echo -e "##${CHR_UNINSTALL}${name}: ${desc}\n${CHR_UNINSTALL}${name}:\n\t@${file} remove\n" >> Makefile
done;
cat << EOF >> Makefile
#===============================================
# Service goals
#===============================================
self:
@./gen-makefile
help: Makefile
@echo "Ubuntu software installator"
@echo
@echo "Usage:"
@echo "\tmake help\t - show this help"
@echo "\tmake self\t - regenerate Makefile (alias of ./gen-makefile)"
@echo "\tmake GOAL\t - install software"
@echo "\tmake ${CHR_UPGRADE}GOAL\t - upgrade software"
@echo "\tmake ${CHR_UNINSTALL}GOAL\t - uninstall software"
@echo "\nYou can combine GOALs, here are some examples:"
@echo "\tmake ${CHR_UNINSTALL}docker docker"
@echo "\tmake php ${CHR_UNINSTALL}docker ${CHR_UPGRADE}omz"
@echo "\nAvailable GOALs:"
@sed -n 's/^##//p' $< | column -ts ':' | sed -e "s/^/\t/"
+%:
@make $*
EOF
echo "New ./Makefile has been generated!"
echo "Old one has been saved as ./Makefile.bak"
echo "Now run 'make' to get help"
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
mv Makefile Makefile.bak
echo -e "# Autogenerated at $(date +'%d.%m.%Y %H:%M') using ${BASH_SOURCE[0]}\n" > Makefile
for file in ./packs/*; do
cat ${file} >> Makefile
done;
for file in ./install/*; do
name=${file##*/}
name=${name%.sh}
desc=$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${file})
[ -z "$desc" ] && desc='<no description>'
echo -e "##${name}: ${desc}\n${name}:\n\t${file}\n" >> Makefile
done;
cat << EOF >> Makefile
##help: Show this help message
help: Makefile
@echo "Usage:"
@echo "\tmake <goal>\n"
@echo "Available goals:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e "s/^/\t/"
##<goal>_: Same as 'cat ./install/<goal>.sh'
%_:
@cat ./install/\$*.sh
EOF
echo "New ./Makefile has been generated!"
echo "Old one has been saved as ./Makefile.bak"
echo
make help
-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/env bash
set -oe pipefail
__root__=$( dirname $(readlink -e -- "${BASH_SOURCE}"))
source $__root__/helpers/io.sh || exit 255
source $__root__/helpers/git.sh || exit 255
source $__root__/helpers/basic.sh || exit 255
source $__root__/helpers/debug.sh || exit 255
source $__root__/helpers/packages.sh || exit 255
title() {
[[ $__AAA_NO_TITLE = 1 ]] || {
[ "$1" ] && title="$1" || title="$(grep -m 1 -oP "(?<=^##makedesc:\s).*$" ${BASH_SOURCE[1]})"
info
info "==============================================="
info "$title"
info "==============================================="
info
}
}
-46
View File
@@ -1,46 +0,0 @@
#!/usr/bin/env bash
##makedesc: Example script
set -eo pipefail
install() {
echo
echo "==============================================="
echo "Installing example"
echo "==============================================="
echo
sleep 3
echo
echo "Finish! example v1.2.3"
echo
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading example"
echo "==============================================="
echo
sleep 3
echo
echo "Finish! example v1.2.3"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing example"
echo "==============================================="
echo
sleep 3
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
-46
View File
@@ -1,46 +0,0 @@
#!/usr/bin/env bash
##makedesc: Manage anytype (deb)
set -eo pipefail
installDir="$HOME/install/anytype"
install() {
release="$(curl -s 'https://api.github.com/repos/anyproto/anytype-ts/releases/latest')"
tag="$(echo "$release" | jq -r '.tag_name')"
asset="$(echo "$release" | jq -r '.assets.[] | select(.name | test("amd64.deb$"))')"
url="$(echo "$asset" | jq -r '.browser_download_url')"
echo -e "$tag $url"
echo
echo "==============================================="
echo "Installing anytype $tag"
echo "==============================================="
echo
mkdir -p "$installDir"
filepath="$installDir/anytype_${tag}_amd46.deb"
wget "$url" -O "$filepath"
sudo dpkg -i "$filepath"
echo
echo "Finish! $tag"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing anytype"
echo "==============================================="
echo
sudo apt purge -y anytype*
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
##makedesc: Install apache2 (latest)
echo
echo "==============================================="
echo "Installing apache2..."
echo "==============================================="
echo
sudo apt install -y --autoremove apache2
sudo service apache2 restart
apache2 -v
-48
View File
@@ -1,48 +0,0 @@
#!/usr/bin/env bash
##makedesc: Manage apache2 (apt)
set -eo pipefail
install() {
echo
echo "==============================================="
echo "Installing apache2"
echo "==============================================="
echo
sudo apt install -y apache2
sudo systemctl restart apache2
echo
echo "Finish! $(apache2 -v)"
echo
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading apache2"
echo "==============================================="
echo
sudo apt upgrade -y apache2 apache2-data apache2-utils
sudo systemctl restart apache2
echo
echo "Finish! $(apache2 -v)"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing apache2"
echo "==============================================="
echo
sudo apt purge -y apache2*
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
+58 -76
View File
@@ -1,78 +1,60 @@
#!/usr/bin/env bash
##makedesc: Install basic software from apt
#!/bin/bash
##makedesc: Install bunch of software from apt
set -eo pipefail
echo
echo "==============================================="
echo "Installing software from apt..."
echo "==============================================="
echo
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: This script is for Debian/Ubuntu only. Use 'make brew' on macOS." >&2
exit 1
fi
install() {
echo
echo "==============================================="
echo "Installing basic software from apt"
echo "==============================================="
echo
sudo apt update
sudo apt upgrade -y --autoremove
sudo apt install -y \
alien \
apt-transport-https \
build-essential \
ca-certificates \
cmake \
curl \
dconf-editor \
default-jdk \
dialog \
gettext \
gnupg \
gparted \
hardinfo \
htop \
libaio1 \
libcurl4-gnutls-dev \
libexpat1-dev \
libghc-zlib-dev \
libssl-dev \
lsb-release \
make \
mc \
meld \
nano \
neofetch \
net-tools \
nmap \
p7zip-full \
easyeffects \
software-properties-common \
ubuntu-restricted-extras \
unzip \
vlc \
ffmpeg \
inotify-tools \
notify-osd \
fonts-open-sans \
libnotify-bin \
tree \
earlyoom
# terminator
# xclip
# sqlitebrowser
# etckeeper
echo
echo "Finish!"
echo
}
upgrade() {
install
}
case "$1" in
u|upgrade|update) upgrade ;;
*) install ;;
esac
sudo apt update && sudo apt upgrade -y --autoremove
sudo apt install -y --autoremove \
apt-transport-https \
ca-certificates \
curl \
make \
cmake \
dialog \
build-essential \
software-properties-common \
libaio1 \
libssl-dev \
libghc-zlib-dev \
libcurl4-gnutls-dev \
libexpat1-dev \
gettext \
gnupg \
ubuntu-restricted-extras \
unzip \
mc \
htop \
nano \
neofetch \
default-jdk \
terminator \
dconf-editor \
alien \
meld \
vlc \
gparted \
hardinfo \
libreoffice \
pulseeffects \
lsp-plugins \
lsb-release \
net-tools \
nmap \
p7zip-full \
sqlitebrowser
# gnome-software \
# minder \
# redshift \
# redshift-gtk \
# nodejs \
# compiz \
# compizconfig-settings-manager \
# earlyoom \
# etckeeper \
# deepin-screenshot \
# geoclue-2.0 \
# at
-41
View File
@@ -1,41 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install software from brew
set -eo pipefail
if [ "$(uname -s)" != "Darwin" ]; then
echo "ERROR: This script is for MacOS only." >&2
exit 1
fi
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing software from brew"
echo "==============================================="
echo
if ! installed brew; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew install \
bash \
stow \
gnupg \
pinentry-mac
mkdir -p ~/.gnupg
echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf
gpgconf --kill gpg-agent
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
-59
View File
@@ -1,59 +0,0 @@
#!/usr/bin/env bash
##makedesc: Canon Pixma MG2500 + ppa
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: Canon Pixma MG2500 drivers are not supported on macOS." >&2
exit 1
fi
install() {
echo
echo "==============================================="
echo "Installing Canon Pixma MG2500 + ppa"
echo "==============================================="
echo
sudo add-apt-repository -y ppa:thierry-f/fork-michael-gruz
sudo apt install -y cnijfilter-mg2500series scangearmp-mg2500series
echo
echo "Finish!"
echo "Drivers for Canon Pixma MG2500 installed!"
echo "Now you must reboot PC and connect your printer."
echo
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading Canon Pixma MG2500 + ppa"
echo "==============================================="
echo
sudo apt upgrade -y cnijfilter-mg2500series scangearmp-mg2500series
echo
echo "Finish!"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing Canon Pixma MG2500 + ppa"
echo "==============================================="
echo
# sudo apt purge -y cnijfilter-mg2500series scangearmp-mg2500series
sudo dpkg -r cnijfilter-mg2500series
sudo dpkg -r cnijfilter-common
sudo dpkg -r scangearmp-mg2500series
sudo dpkg -r scangearmp-common
sudo add-apt-repository -ry ppa:thierry-f/fork-michael-gruz
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
+11 -94
View File
@@ -1,98 +1,15 @@
#!/usr/bin/env bash
##makedesc: Google Chrome (latest)
#!/bin/bash
##makedesc: Install google chrome (latest)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
echo
echo "==============================================="
echo "Installing google chrome (latest)..."
echo "==============================================="
echo
# https://t.me/axenov_blog/251
dest="$HOME/install/deb"
deb="$dest/google-chrome.deb"
url="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask google-chrome
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing Google Chrome"
echo "==============================================="
echo
mkdir -p "$dest"
if installed wget; then
wget -q --show-progress "$url" -O "$deb"
else
curl -fsSL "$url" -o "$deb"
fi
sudo dpkg -i "$deb"
echo
echo "Finish!"
google-chrome --version
echo
}
upgrade() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew upgrade --cask google-chrome
fi
return
fi
echo
echo "==============================================="
echo "Upgrading Google Chrome"
echo "==============================================="
echo
mkdir -p "$dest"
if installed wget; then
wget -q --show-progress "$url" -O "$deb"
else
curl -fsSL "$url" -o "$deb"
fi
sudo dpkg -i "$deb"
echo
echo "Finish!"
google-chrome --version
echo
}
remove() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew uninstall --cask google-chrome
fi
return
fi
echo
echo "==============================================="
echo "Removing Google Chrome"
echo "==============================================="
echo
sudo dpkg -r google-chrome-stable
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
# sudo snap install chromium
wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" -O /tmp/google-chrome-stable_current_amd64.deb
sudo dpkg -i /tmp/google-chrome-stable_current_amd64.deb
rm /tmp/google-chrome-stable_current_amd64.deb
-61
View File
@@ -1,61 +0,0 @@
#!/usr/bin/env bash
##makedesc: ClamAV
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: clamav are not supported on macOS." >&2
exit 1
fi
install() {
echo
echo "==============================================="
echo "Installing clamav"
echo "==============================================="
echo
sudo apt install -y clamav
echo "DatabaseMirror packages.microsoft.com/clamav" \
| sudo tee -a /etc/clamav/freshclam.conf
sudo freshclam
echo
echo "Finish!"
echo
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading clamav"
echo "==============================================="
echo
sudo apt upgrade -y clamav
sudo freshclam
echo
echo "Finish!"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing clamav"
echo "==============================================="
echo
sudo apt purge -y clamav*
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
+47 -98
View File
@@ -1,107 +1,56 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install composer (latest)
set -eo pipefail
echo
echo "==============================================="
echo "Installing composer (latest)..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
warn() { echo "WARNING: $*" >&2; }
require() {
local missing=()
for pkg in "$@"; do
installed "$pkg" || missing+=("$pkg")
done
if [ ${#missing[@]} -gt 0 ]; then
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install "${missing[@]}"
else
echo "ERROR: Missing: ${missing[*]}. Install manually or use brew." >&2
exit 1
fi
else
sudo apt install -y "${missing[@]}"
fi
fi
installed() {
command -v "$1" >/dev/null 2>&1
}
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
if installed "php"; then
if installed "composer"; then
echo "WARNING: You already have composer installed - removing to install actual version"
sudo apt remove -y --autoremove composer
sudo rm -f /bin/composer
sudo rm -f /usr/bin/composer
sudo rm -f /usr/local/bin/composer
sudo rm -rf /usr/src/composer
fi
}
install() {
echo
echo "==============================================="
echo "Installing composer"
echo "==============================================="
echo
sudo mkdir -m 0777 -p /usr/src/composer
cd /usr/src/composer
# https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
require php
if installed composer; then
warn "Removing current composer to install latest one"
composer --version
rm -f "$HOME/.local/bin/composer" /usr/local/bin/composer /usr/bin/composer 2>/dev/null || true
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
sudo cp /usr/src/composer/composer.phar /usr/local/bin/composer
cd - >/dev/null
sudo rm -rf /usr/src/composer/
installed "composer" && composer --version
else
echo "WARNING: You need to have php installed"
fi
mkdir -p "$HOME/install/other" "$HOME/.local/bin"
download "https://getcomposer.org/installer" \
"$HOME/install/other/composer-setup.php"
php "$HOME/install/other/composer-setup.php" \
--install-dir="$HOME/.local/bin/" \
--filename="composer"
COMPOSER_GLOBAL_HOME="$($HOME/.local/bin/composer config -g home)"
NEWPATH="PATH=\"$COMPOSER_GLOBAL_HOME/vendor/bin:\${PATH}\""
if ! grep -qoh "$NEWPATH" "$HOME/.profile" 2>/dev/null; then
export "$NEWPATH"
echo "export $NEWPATH" >> "$HOME/.profile"
fi
# shellcheck source=/dev/null
source "$HOME/.profile"
echo
echo "Finish!"
composer --version
echo
}
upgrade() {
install
}
remove() {
echo
echo "==============================================="
echo "Removing composer"
echo "==============================================="
echo
sudo apt remove -y --autoremove composer 2>/dev/null || true
rm -f \
"$HOME/.local/bin/composer" \
/bin/composer \
/usr/bin/composer \
/usr/local/bin/composer \
/usr/src/composer 2>/dev/null || true
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
# title "Installing composer.phar in home dir..."
# cd ~
# EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
# if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
# then
# >&2 echo 'ERROR: Invalid installer signature'
# rm composer-setup.php
# exit 1
# fi
# php composer-setup.php --quiet
# RESULT=$?
# rm composer-setup.php
+31 -94
View File
@@ -1,97 +1,34 @@
#!/usr/bin/env bash
##makedesc: Docker + ppa
#!/bin/bash
##makedesc: Install docker (latest) + docker-compose (latest) + ppa
echo
echo "==============================================="
echo "Installing docker (latest)..."
echo "==============================================="
echo
# https://docs.docker.com/engine/install/ubuntu/
# https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
set -eo pipefail
doRemove() {
sudo apt purge -y docker* podman-docker containerd runc
}
installRepo() {
sudo apt install -y ca-certificates lsb-release
source /etc/os-release
key="/etc/apt/keyrings/docker.asc"
arch=$(dpkg --print-architecture)
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" -o "$key"
sudo chmod a+r $key
echo "deb [arch=$arch signed-by=$key] https://download.docker.com/linux/ubuntu $VERSION_CODENAME stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
}
doInstall() {
echo
echo "==============================================="
echo "Installing Docker"
echo "==============================================="
echo
# doRemove
installRepo
sudo apt install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin
sudo usermod -aG docker "$(whoami)"
newgrp docker
echo
echo "Finish! $(docker --version)"
echo "Probably, you need to relogin to apply 'docker' group permanently."
echo
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading Docker"
echo "==============================================="
echo
sudo apt upgrade -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin \
docker-model-plugin
echo
echo "Finish!"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing Docker"
echo "==============================================="
echo
sudo apt remove -y --autoremove \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin \
docker-ce-rootless-extras
sudo rm -rf \
/var/lib/docker \
/var/lib/containerd \
/etc/apt/sources.list.d/docker.list \
/etc/apt/keyrings/docker.asc
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
install-repo) installRepo ;;
# remove-repo) removeRepo ;; #TODO
*) doInstall ;;
esac
sudo apt remove -y docker docker-engine docker.io containerd runc
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.gpg
sudo apt update
sudo apt install -y --autoremove \
docker-ce \
docker-ce-cli \
containerd.io \
docker-compose-plugin \
docker-compose
sudo usermod -aG docker anthony
echo
echo "You need to logout and log in again to apply docker group"
echo
+16 -36
View File
@@ -1,40 +1,20 @@
#!/usr/bin/env bash
##makedesc: Install droidcam v1.9.0
#!/bin/bash
##makedesc: Install droidcam v1.8.2
set -eo pipefail
# https://www.dev47apps.com/droidcam/linux/
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: droidcam is not supported on macOS." >&2
exit 1
fi
echo
echo "==============================================="
echo "Installing droidcam v1.8.2..."
echo "==============================================="
echo
install() {
echo
echo "==============================================="
echo "Installing droidcam"
echo "==============================================="
echo
mkdir -p ~/install/droidcam
wget -O /tmp/droidcam.zip https://files.dev47apps.net/linux/droidcam_1.8.2.zip
unzip -o /tmp/droidcam.zip -d ~/install/droidcam
rm -rf /tmp/droidcam.zip
cd ~/install/droidcam && sudo ./install-client
# https://droidcam.app/linux/
mkdir -p "$HOME/install/deb/"
if command -v wget >/dev/null 2>&1; then
wget -q --show-progress "https://beta.droidcam.app/go/droidCam.client.setup.deb" -O "$HOME/install/deb/droidcam_client_amd64.deb"
else
curl -fsSL "https://beta.droidcam.app/go/droidCam.client.setup.deb" -o "$HOME/install/deb/droidcam_client_amd64.deb"
fi
sudo dpkg -i "$HOME/install/deb/droidcam_client_amd64.deb"
sudo apt install -y v4l2loopback-dkms
echo
echo "Finish!"
echo "Don't forget to install the android app:"
echo "https://play.google.com/store/apps/developer?id=Dev47Apps"
echo
}
case "$1" in
*) install ;;
esac
echo
echo "Don't forget to install android app: https://play.google.com/store/apps/developer?id=Dev47Apps"
echo
+20 -43
View File
@@ -1,49 +1,26 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install droidcam-obs plugin v1.5.1
set -eo pipefail
# https://www.dev47apps.com/droidcam/linux/
# https://www.dev47apps.com/obs/
# https://www.dev47apps.com/obs/usage.html
#TODO
# ffmpeg -version | head -n 1 | awk '{print $3}'
# https://github.com/dev47apps/droidcam-obs-plugin/releases
echo
echo "==============================================="
echo "Installing droidcam-obs..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
command -v "obs" >/dev/null 2>&1 || echo 'You need to install obs first!'
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: droidcam-obs plugin is not supported on macOS." >&2
exit 1
fi
mkdir -p ~/install/droidcam_obs
wget -O /tmp/droidcam-obs.zip https://files.dev47apps.net/obs/droidcam_obs_1.5.1_linux.zip
unzip -o /tmp/droidcam-obs.zip -d ~/install/droidcam-obs
rm -rf /tmp/droidcam-obs.zip
cd ~/install/droidcam-obs && ./install.sh
install() {
echo
echo "==============================================="
echo "Installing droidcam-obs"
echo "==============================================="
echo
# https://www.dev47apps.com/droidcam/linux/
# https://www.dev47apps.com/obs/
command -v "obs-studio" >/dev/null 2>&1 || echo "WARNING: You need obs-studio first!"
mkdir -p "$HOME/install/droidcam-obs"
wget -O /tmp/droidcam-obs.zip https://files.dev47apps.net/obs/droidcam_obs_1.5.1_linux.zip
unzip -oq /tmp/droidcam-obs.zip -d "$HOME/install/droidcam-obs"
rm -rf /tmp/droidcam-obs.zip
cd "$HOME/install/droidcam-obs"
./install.sh
sudo modprobe v4l2loopback video_nr=2 card_label="OBS Virtual Camera"
echo
echo "Finish!"
echo "Don't forget to:"
echo "1) restart OBS if it is running right now OR install (if not) and start it"
echo "2) install android app: https://play.google.com/store/apps/developer?id=Dev47Apps"
echo "3) if virtual camera not starting then execute:"
echo -e "\tsudo modprobe v4l2loopback video_nr=2 card_label=\"OBS Virtual Camera\""
echo
}
case "$1" in
*) install ;;
esac
echo
echo "Don't forget to:"
echo "1) restart OBS if it is running right now"
echo "2) install android app: https://play.google.com/store/apps/developer?id=Dev47Apps"
echo
-71
View File
@@ -1,71 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install flameshot (latest)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask flameshot
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing flameshot"
echo "==============================================="
echo
# https://github.com/flameshot-org/flameshot?tab=readme-ov-file#compilation
# sudo apt install -y --autoremove flameshot
# sudo systemctl restart flameshot
dir="$HOME/install"
clone_dir="$dir/flameshot"
mkdir -p "$dir"
sudo apt install -y \
g++ \
cmake \
build-essential \
qtbase5-dev \
qttools5-dev-tools \
libqt5svg5-dev \
qttools5-dev \
libqt5dbus5 \
libqt5network5 \
libqt5core5a \
libqt5widgets5 \
libqt5gui5 \
libqt5svg5
if [ ! -d "$clone_dir" ]; then
git clone --depth=1 --single-branch https://github.com/flameshot-org/flameshot.git "$clone_dir"
fi
# Directory where build files will be placed, may be relative
export BUILD_DIR=build
# Directory prefix where flameshot will be installed.
export CMAKE_INSTALL_PREFIX=/opt/flameshot
cd "$clone_dir"
git pull
cmake -S . -B "$BUILD_DIR"
cmake --build "$BUILD_DIR"
echo
echo "Finish!"
# /opt/flameshot/flameshot -v
echo
}
case "$1" in
*) install ;;
esac
+31 -73
View File
@@ -1,80 +1,38 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install git (latest)
set -eo pipefail
echo
echo "==============================================="
echo "Installing git (latest)..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
require() {
local missing=()
for pkg in "$@"; do
installed "$pkg" || missing+=("$pkg")
done
if [ ${#missing[@]} -gt 0 ]; then
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install "${missing[@]}"
else
echo "ERROR: Missing: ${missing[*]}. Install manually or use brew." >&2
exit 1
fi
else
sudo apt install -y "${missing[@]}"
fi
fi
installed() {
command -v "$1" >/dev/null 2>&1
}
ENVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
! installed make && sudo apt install -y make
clone_quick() {
git clone --depth=1 --single-branch "$@"
}
if installed git; then
sudo rm -rf /usr/src/git
sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git
sudo chown -R $USER: /usr/src/git
cd /usr/src/git/
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
else
! installed wget && sudo apt install -y wget
wget https://github.com/git/git/archive/master.zip -O /tmp/git.zip
sudo unzip -q /tmp/git.zip -d /usr/src/git
rm /tmp/git.zip
cd /usr/src/git/git-master
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
cd /usr/src
sudo rm -rf git
sudo git clone https://github.com/git/git.git --depth=1 /usr/src/git
sudo chown -R $USER: /usr/src/git
fi
install() {
echo
echo "==============================================="
echo "Installing git"
echo "==============================================="
echo
require make
if installed git; then
if [ -d "$HOME/install/git" ]; then
cd "$HOME/install/git"
git pull
else
clone_quick "https://github.com/git/git.git" "$HOME/install/git"
cd "$HOME/install/git"
fi
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
else
require wget unzip
mkdir -p "$HOME/install/git"
download "https://github.com/git/git/archive/master.zip" "/tmp/git.zip"
unzip -oq "/tmp/git.zip" -d "$HOME/install/git"
rm /tmp/git.zip
cd "$HOME/install/git/git-master"
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install
cd -
rm -rf git
clone_quick "https://github.com/git/git.git" "$HOME/install/git"
fi
echo
echo "Finish!"
git --version
echo
}
case "$1" in
*) install ;;
esac
git --version
+20 -75
View File
@@ -1,82 +1,27 @@
#!/usr/bin/env bash
##makedesc: Install golang
#!/bin/bash
##makedesc: Install golang v1.18.3
# https://go.dev/dl/
# https://golang.org/doc/install
# https://github.com/udhos/update-golang/blob/master/update-golang.sh
# https://www.vultr.com/docs/install-the-latest-version-of-golang-on-ubuntu
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
[ $1 ] && VERSION="$1" || VERSION="1.18.3"
FILE="go$VERSION.linux-amd64.tar.gz"
doRemove() {
[ -d "/usr/local/go" ] && sudo rm -rf "/usr/local/go"
}
install() {
dlUrl="https://go.dev/dl"
json=$(curl -sSL "$dlUrl/?mode=json")
version=$(echo "$json" | jq -r '.[0].version')
echo
echo "==============================================="
echo "Installing golang v$version"
echo "==============================================="
echo
local os="linux"
[ "$(uname -s)" = "Darwin" ] && os="darwin"
latestJson=$(echo "$json" | jq -r ".[0].files.[] | select (.kind == \"archive\" and .os == \"$os\" and .arch == \"amd64\")")
fileName=$(echo "$latestJson" | jq -r '.filename')
fileUrl="$dlUrl/$fileName"
downloadPath="$HOME/install"
archivePath="$downloadPath/$fileName"
doRemove
if [ ! -f "$archivePath" ]; then
if installed wget; then
wget -q --show-progress "$fileUrl" -O "$archivePath"
else
curl -fsSL "$fileUrl" -o "$archivePath"
fi
fi
sudo tar -xzf "$archivePath" -C /usr/local
sudo chown "$USER": -R /usr/local/go
if ! grep -q '/usr/local/go/bin' "$HOME/.profile" 2>/dev/null; then
echo 'export PATH="/usr/local/go/bin:$PATH"' >> "$HOME/.profile"
echo "export GOPATH=\"\$HOME/.go\"" >> "$HOME/.profile"
fi
# shellcheck source=/dev/null
source "$HOME/.profile"
echo
go version
go install github.com/go-delve/delve/cmd/dlv@latest
echo "Finish!"
echo
}
upgrade() {
install
}
remove() {
echo
echo "==============================================="
echo "Removing golang"
echo "==============================================="
echo
doRemove
sed -i '/\/usr\/local\/go\/bin/d' "$HOME/.profile"
sed -i '/GOPATH/d' "$HOME/.profile"
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
echo
echo "==============================================="
echo "Installing golang v$VERSION..."
echo "==============================================="
echo
sudo rm -rf /usr/local/go && \
wget "https://golang.org/dl/$FILE" -O /tmp/$FILE && \
sudo tar -xzf /tmp/$FILE -C /usr/local && \
rm -rf /tmp/$FILE && \
sudo chown $USER: -R /usr/local/go && \
echo 'export PATH="$PATH:/usr/local/go/bin\"' >> $HOME/.profile && \
echo 'export GOPATH="$HOME/.go"' >> $HOME/.profile && \
# source ~/.profile && \
go version && \
echo "NOTE: now run 'source ~/.profile' to apply new env vars"
-49
View File
@@ -1,49 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install grub-customizer (latest + ppa)
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: grub-customizer is not supported on macOS." >&2
exit 1
fi
install() {
echo
echo "==============================================="
echo "Installing grub-customizer"
echo "==============================================="
echo
sudo add-apt-repository -y ppa:danielrichter2007/grub-customizer
sudo apt install -y --autoremove grub-customizer
echo
echo "Finish!"
grub-customizer -v
echo
}
remove() {
echo
echo "==============================================="
echo "Removing grub-customizer"
echo "==============================================="
echo
source_file="/etc/apt/sources.list.d/$(ls -1 /etc/apt/sources.list.d/ | grep danielrichter2007)"
sudo apt remove -y --autoremove grub-customizer
if [ -f "$source_file" ]; then
sudo rm "$source_file"
sudo apt update
fi
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
Executable
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
##makedesc: Install grub-customizer (latest) + ppa
echo
echo "==============================================="
echo "Installing grub-customizer (latest)..."
echo "==============================================="
echo
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt install -y --autoremove grub-customizer
+38 -54
View File
@@ -1,59 +1,43 @@
#!/usr/bin/env bash
#!/bin/bash (latest)
##makedesc: Install KDE Window AppMenu Applet
set -eo pipefail
echo
echo "==============================================="
echo "Installing KDE Window AppMenu Applet..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
# https://github.com/psifidotos/applet-window-appmenu/blob/master/INSTALLATION.md
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: KDE Window AppMenu Applet is not supported on macOS." >&2
exit 1
sudo apt install -y --autoremove \
make \
cmake \
extra-cmake-modules \
qtdeclarative5-dev \
libkf5plasma-dev \
libqt5x11extras5-dev \
g++ \
libsm-dev \
libkf5configwidgets-dev \
libkdecorations2-dev \
libxcb-randr0-dev \
libkf5wayland-dev \
plasma-workspace-dev
if installed 'git'; then
sudo rm -rf /usr/src/appmenu-applet
sudo git clone https://github.com/psifidotos/applet-window-appmenu.git --depth=1 /usr/src/appmenu-applet
else
sudo wget https://github.com/psifidotos/applet-window-appmenu/archive/master.zip -O /tmp/appmenu-applet.zip
sudo unzip /tmp/appmenu-applet.zip -d /usr/src/appmenu-applet
sudo mv /usr/src/appmenu-applet/applet-window-appmenu-master/* /usr/src/appmenu-applet/
sudo mv /usr/src/appmenu-applet/applet-window-appmenu-master/.* /usr/src/appmenu-applet/
sudo rm -rf /usr/src/appmenu-applet/applet-window-appmenu-master
sudo rm -f /usr/src/appmenu-applet.zip
fi
install() {
echo
echo "==============================================="
echo "Installing KDE Window AppMenu Applet"
echo "==============================================="
echo
# https://github.com/psifidotos/applet-window-appmenu/blob/master/INSTALLATION.md
sudo apt install -y --autoremove \
make \
cmake \
extra-cmake-modules \
qtdeclarative5-dev \
libkf5plasma-dev \
libqt5x11extras5-dev \
g++ \
libsm-dev \
libkf5configwidgets-dev \
libkdecorations2-dev \
libxcb-randr0-dev \
libkf5wayland-dev \
plasma-workspace-dev
if installed git; then
sudo rm -rf /usr/src/appmenu-applet
sudo git clone https://github.com/psifidotos/applet-window-appmenu.git --depth=1 /usr/src/appmenu-applet
else
sudo wget https://github.com/psifidotos/applet-window-appmenu/archive/master.zip -O /tmp/appmenu-applet.zip
sudo unzip -oq /tmp/appmenu-applet.zip -d /usr/src/appmenu-applet
sudo mv /usr/src/appmenu-applet/applet-window-appmenu-master/* /usr/src/appmenu-applet/
sudo mv /usr/src/appmenu-applet/applet-window-appmenu-master/.* /usr/src/appmenu-applet/
sudo rm -rf /usr/src/appmenu-applet/applet-window-appmenu-master
sudo rm -f /usr/src/appmenu-applet.zip
fi
sudo chown -R "$USER": /usr/src/appmenu-applet
cd /usr/src/appmenu-applet/
sh ./install.sh
echo
echo "Finish! Now you can add 'Window AppMenu Applet' on desktop or panel"
echo
}
case "$1" in
*) install ;;
esac
sudo chown -R $USER: /usr/src/appmenu-applet
cd /usr/src/appmenu-applet/
sh ./install.sh
echo
echo 'Success! Now you can add "Window AppMenu Applet" on desktop or panel'
echo
-29
View File
@@ -1,29 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install KDE Backports
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: KDE Backports are not supported on macOS." >&2
exit 1
fi
install() {
echo
echo "==============================================="
echo "Installing KDE Backports"
echo "==============================================="
echo
sudo add-apt-repository -y ppa:kubuntu-ppa/backports
sudo apt update
sudo apt full-upgrade
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
-127
View File
@@ -1,127 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install file templates (KDE)
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "WARNING: KDE file templates are not applicable on macOS." >&2
exit 1
fi
install() {
echo "==============================================="
echo "Installing file templates (KDE)..."
echo "==============================================="
echo
TPL_DIR="$HOME/.local/share/templates"
TPL_SRC="$TPL_DIR/.source"
[ ! -d "$TPL_SRC" ] && mkdir -p "$TPL_SRC"
echo "- Markdown" ####################################################
cat <<EOF > "$TPL_SRC/template.md"
# Title
EOF
cat << EOF > "$TPL_DIR/md.desktop"
[Desktop Entry]
Name=Документ Markdown
Icon=text-markdown
Type=Link
URL=.source/template.md
EOF
echo "- PHP" ####################################################
cat <<EOF > "$TPL_SRC/template.php"
<?php
declare(strict_types=1);
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('log_errors', 1);
EOF
cat << EOF > "$TPL_DIR/php.desktop"
[Desktop Entry]
Name=PHP-скрипт
Icon=application-x-php
Type=Link
URL=.source/template.php
EOF
echo "- Shell" ####################################################
cat <<EOF > "$TPL_SRC/template.sh"
#!/usr/bin/env bash
EOF
cat << EOF > "$TPL_DIR/sh.desktop"
[Desktop Entry]
Name=Bash-скрипт
Icon=terminal
Type=Link
URL=.source/template.sh
EOF
echo "- Go" ####################################################
cat <<EOF > "$TPL_SRC/template.go"
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
EOF
cat << EOF > "$TPL_DIR/go.desktop"
[Desktop Entry]
Name=Golang файл
Type=Link
URL=.source/template.go
EOF
echo "- Dockerfile" ####################################################
cat <<EOF > "$TPL_SRC/Dockerfile"
# https://habr.com/ru/company/ruvds/blog/439980/
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
FROM ubuntu:latest
EOF
cat << EOF > "$TPL_DIR/dockerfile.desktop"
[Desktop Entry]
Name=Dockerfile
Type=Link
URL=.source/Dockerfile.go
EOF
echo "- docker-compose" ####################################################
cat <<EOF > "$TPL_SRC/docker-compose.yml"
# https://docs.docker.com/compose/gettingstarted/
# https://docs.docker.com/compose/compose-file/compose-file-v3/
services:
EOF
cat << EOF > "$TPL_DIR/docker-compose.desktop"
[Desktop Entry]
Name=docker-compose
Type=Link
URL=.source/docker-compose.yml
EOF
echo
echo "Finish! You can find them here:"
echo -e "\t$TPL_DIR"
echo
}
case "$1" in
*) install ;;
esac
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install KDE portal
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: KDE portal is not supported on macOS." >&2
exit 1
fi
install() {
echo
echo "==============================================="
echo "Installing KDE portal"
echo "==============================================="
echo
sudo apt install -y \
xdg-desktop-portal \
xdg-desktop-portal-kde \
xdg-desktop-portal-gtk
echo "GTK_USE_PORTAL=1" | sudo tee -a /etc/environment
echo "XDG_CURRENT_DESKTOP=KDE" | sudo tee -a /etc/environment
echo
echo "Finish! Now you need to relogin"
echo
}
case "$1" in
*) install ;;
esac
-84
View File
@@ -1,84 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install keyd
# https://github.com/rvaiya/keyd
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: keyd is not supported on macOS." >&2
exit 1
fi
installed() { command -v "$1" >/dev/null 2>&1; }
mkdir -p "$HOME/install"
install() {
echo
echo "==============================================="
echo "Installing keyd (latest)"
echo "==============================================="
echo
installed git || { echo "ERROR: git not installed" ; exit 1; }
cd "$HOME/install"
git clone --depth=1 --single-branch https://github.com/rvaiya/keyd.git "$HOME/install/keyd"
cd "$HOME/install/keyd"
make
sudo make install
sudo systemctl enable --now keyd
echo
echo "Finish!"
echo
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading keyd"
echo "==============================================="
echo
installed git || { echo "ERROR: git not installed" ; exit 1; }
[ -d "$HOME/install/keyd" ] || { echo "ERROR: repo not found: $HOME/install/keyd" ; exit 1; }
cd "$HOME/install/keyd"
make
sudo make install
sudo systemctl enable --now keyd
sudo usermod -aG keyd "$(whoami)"
echo
echo "Finish!"
echo
}
restart() {
sudo systemctl restart keyd
}
reload() {
sudo systemctl reload keyd
}
remove() {
echo
echo "==============================================="
echo "Removing keyd"
echo "==============================================="
echo
sudo dpkg -r keyd
echo
echo "Finish!"
echo
}
case "$1" in
restart) restart ;;
reload) reload ;;
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
-28
View File
@@ -1,28 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install libreoffice
set -eo pipefail
install() {
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: This script is for Debian/Ubuntu only. Install LibreOffice manually on macOS." >&2
exit 1
fi
echo
echo "==============================================="
echo "Installing libreoffice"
echo "==============================================="
echo
sudo apt update
sudo apt install -y --autoremove libreoffice
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
+28 -107
View File
@@ -1,113 +1,34 @@
#!/usr/bin/env bash
##makedesc: Install lite-xl v2.1.7
#!/bin/bash
##makedesc: Install lite-xl v2.0.5 (draft)
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: lite-xl portable install is not supported on macOS. Use brew install --cask lite-xl or build from source." >&2
exit 1
fi
# DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
# DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
# DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
# DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
# DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT
installed() { command -v "$1" >/dev/null 2>&1; }
# https://github.com/lite-xl/lite-xl
install() {
echo
echo "==============================================="
echo "Installing lite-xl v2.1.7"
echo "==============================================="
echo
[ $1 ] && LITEXLVER="$1" || LITEXLVER="2.0.5"
echo
echo "==============================================="
echo "Installing lite-xl v${LITEXLVER}..."
echo "==============================================="
echo
# https://github.com/lite-xl/lite-xl/releases
# https://lite-xl.com/setup/getting-started/
wget "https://github.com/lite-xl/lite-xl/releases/download/v${LITEXLVER}/lite-xl-linux-x86_64.tar.gz" -O /tmp/lite-xl.tar.gz
sudo tar -xzf /tmp/lite-xl.tar.gz -C /tmp
mkdir -p $HOME/.local/bin && cp /tmp/lite-xl/bin/lite-xl $HOME/.local/bin
cp -r /tmp/lite-xl/share $HOME/.local
rm -rf /tmp/lite-xl*
echo -e 'export PATH="$PATH:$HOME/.local/bin"' >> $HOME/.bashrc
[ -f $HOME/.zshrc ] && echo -e 'export PATH="$PATH:$HOME/.local/bin"' >> $HOME/.zshrc
xdg-desktop-menu forceupdate
tar_url="https://github.com/lite-xl/lite-xl/releases/download/v2.1.7/lite-xl-v2.1.7-addons-linux-x86_64-portable.tar.gz"
lpm_url="https://github.com/lite-xl/lite-xl-plugin-manager/releases/download/latest/lpm.x86_64-linux"
tar_filepath="$HOME/install/lite-xl-v2.1.7.tar.gz"
untar_dir="$HOME/install"
rm -rf \
"$HOME/.local/bin/lpm" \
"$HOME/install/lite-xl" \
"$HOME/.local/bin/lite-xl" \
"$HOME/.local/share/lite-xl"
mkdir -p \
"$untar_dir" \
"$HOME/.local/bin" \
"$HOME/.local/share/lite-xl"
if installed wget; then
wget -q --show-progress "$tar_url" -O "$tar_filepath"
wget -q --show-progress "$lpm_url" -O "$HOME/.local/bin/lpm"
else
curl -fsSL "$tar_url" -o "$tar_filepath"
curl -fsSL "$lpm_url" -o "$HOME/.local/bin/lpm"
fi
chmod +x "$HOME/.local/bin/lpm"
tar -xzf "$tar_filepath" -C "$untar_dir"
cp -f "$untar_dir/lite-xl/lite-xl" "$HOME/.local/bin/"
cp -fr "$untar_dir"/lite-xl/data/* "$HOME/.local/share/lite-xl/"
cat << EOF > "$HOME/.local/share/applications/org.lite_xl.lite_xl.desktop"
[Desktop Entry]
Type=Application
Name=Lite XL
Comment=A lightweight text editor written in Lua
Exec=$HOME/.local/bin/lite-xl %F
Icon=lite-xl
Terminal=false
StartupWMClass=lite-xl
Categories=Development;IDE;
MimeType=text/plain;
EOF
if command -v update-desktop-database >/dev/null 2>&1; then
sudo update-desktop-database
fi
if command -v xdg-desktop-menu >/dev/null 2>&1; then
xdg-desktop-menu forceupdate
fi
echo
echo "Finish!"
echo
}
remove() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew uninstall --cask lite-xl 2>/dev/null || true
fi
return
fi
echo
echo "==============================================="
echo "Removing lite-xl"
echo "==============================================="
echo
rm -rf \
"$HOME/.local/bin/lite-xl" \
"$HOME/.local/bin/lpm" \
"$HOME/.local/share/applications/org.lite_xl.lite_xl.desktop" \
"$HOME/.local/share/lite-xl" \
"$HOME/.config/lite-xl"
if command -v update-desktop-database >/dev/null 2>&1; then
sudo update-desktop-database
fi
if command -v xdg-desktop-menu >/dev/null 2>&1; then
xdg-desktop-menu forceupdate
fi
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
### uninstall
# rm -f $HOME/.local/bin/lite-xl
# rm -rf $HOME/.local/share/icons/hicolor/scalable/apps/lite-xl.svg \
# $HOME/.local/share/applications/org.lite_xl.lite_xl.desktop \
# $HOME/.local/share/metainfo/org.lite_xl.lite_xl.appdata.xml \
# $HOME/.local/share/lite-xl
-49
View File
@@ -1,49 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install llmfit
# https://github.com/AlexsJones/llmfit
set -eo pipefail
mkdir -p "$HOME/install"
install() {
echo
echo "==============================================="
echo "Installing llmfit (latest)"
echo "==============================================="
echo
curl -fsSL https://llmfit.axjns.dev/install.sh | sh -s -- --local
echo
echo "Finish!"
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading llmfit"
echo "==============================================="
echo
curl -fsSL https://llmfit.axjns.dev/install.sh | sh -s -- --local
echo
echo "Finish!"
}
remove() {
echo
echo "==============================================="
echo "Removing llmfit"
echo "==============================================="
echo
sudo rm -rf "$(which llmfit)"
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
+11 -34
View File
@@ -1,39 +1,16 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install mariadb (latest) and php-mysql + phpMyAdmin (if php is installed)
set -eo pipefail
echo
echo "==============================================="
echo "Installing mariadb (latest)..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install mariadb
brew services start mariadb
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing mariadb"
echo "==============================================="
echo
sudo apt install -y --autoremove mariadb-server mariadb-client
sudo mysql_secure_installation
if installed php; then
sudo apt install -y --autoremove php-mysql phpmyadmin
fi
echo
echo "Finish!"
echo
installed() {
command -v "$1" >/dev/null 2>&1
}
case "$1" in
*) install ;;
esac
sudo apt install -y --autoremove mariadb-server mariadb-client
sudo mysql_secure_installation
installed "php" && sudo apt install -y --autoremove php-mysql phpmyadmin
-80
View File
@@ -1,80 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install nerd-fonts
set -eo pipefail
#TODO nokia-sans
installed() { command -v "$1" >/dev/null 2>&1; }
isMac() { [ "$(uname -s)" = "Darwin" ]; }
isLinux() { [ "$(uname -s)" = "Linux" ]; }
url="https://github.com/ryanoasis/nerd-fonts/releases/latest/download"
downloadPath="$HOME/install/nerd-fonts"
if isMac; then
installPath="$HOME/Library/Fonts/"
elif isLinux; then
installPath="$HOME/.local/share/fonts/"
else
echo "This OS is not supported yet!"
exit
fi
fontsNames=(
FiraCode
# FiraMono
JetBrainsMono
Meslo
# Noto
RobotoMono
# Ubuntu
# UbuntuMono
# UbuntuSans
)
install() {
echo
echo "==============================================="
echo "Installing nerd-fonts"
echo "==============================================="
echo
[[ -d "$downloadPath" ]] || mkdir -p "$downloadPath"
for fontname in "${fontsNames[@]}"; do
fontDir="$installPath/Nerd-$fontname"
if installed wget; then
wget -q --show-progress "$url/$fontname.tar.xz" -O "$downloadPath/$fontname.tar.xz"
else
curl -fsSL "$url/$fontname.tar.xz" -o "$downloadPath/$fontname.tar.xz"
fi
[[ -d "$installPath/$fontname" ]] || mkdir -p "$fontDir"
tar -xJf "$downloadPath/$fontname.tar.xz" -C "$fontDir"
done
isLinux && fc-cache -vf "$installPath"
echo
echo "Finish!"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing nerd-fonts"
echo "==============================================="
echo
find "$installPath" -type d -name "Nerd-*" -exec rm -rf {} +
isLinux && fc-cache -vf "$installPath"
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
+22 -75
View File
@@ -1,83 +1,30 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install nodejs + npm via nvm
set -eo pipefail
echo
echo "==============================================="
echo "Installing nodejs..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
installed() {
command -v "$1" >/dev/null 2>&1
}
isMac() { [ "$(uname -s)" = "Darwin" ]; }
isLinux() { [ "$(uname -s)" = "Linux" ]; }
# sudo apt install -y --autoremove nodejs npm
NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
install() {
echo
echo "==============================================="
echo "Installing nodejs + nvm"
echo "==============================================="
echo
if isMac; then
if installed brew; then
brew install nvm
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
elif isLinux; then
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
else
echo "ERROR: This OS is not supported yet!" >&2
exit 1
fi
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && source "$NVM_DIR/bash_completion"
if !installed "nvm"; then
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
fi
if [ $(nvm current) == 'system' ]; then
echo "WARNING: You already have node installed - removing to install actual version"
sudo apt remove -y --autoremove nodejs npm
else
nvm install-latest-npm
nvm install node
nvm use node
fi
if ! grep -q 'NVM_DIR' "$HOME/.profile" 2>/dev/null; then
cat << EOF >> "$HOME/.profile"
# nvm (not nvim!)
export NVM_DIR="\$HOME/.nvm"
[ -s "\$NVM_DIR/nvm.sh" ] && source "\$NVM_DIR/nvm.sh"
[ -s "\$NVM_DIR/bash_completion" ] && source "\$NVM_DIR/bash_completion"
EOF
fi
echo
echo "Finish!"
nvm current
echo
}
remove() {
echo
echo "==============================================="
echo "Removing nodejs + nvm"
echo "==============================================="
echo
if command -v nvm >/dev/null 2>&1; then
nvm unload 2>/dev/null || true
fi
rm -rf "$NVM_DIR"
sed -i '/NVM_DIR/d' "$HOME/.profile" 2>/dev/null || true
if isMac && installed brew; then
brew uninstall nvm 2>/dev/null || true
fi
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
nvm install node
nvm use node
installed "node" && nvm current
nvm ls
-39
View File
@@ -1,39 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install ntfy (latest) + ppa
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: ntfy apt/ppa install is not supported on macOS. Use 'brew install ntfy' instead." >&2
exit 1
fi
echo
echo "==============================================="
echo "Installing ntfy"
echo "==============================================="
echo
# https://ntfy.sh/docs/install/#general-steps
installed curl || sudo apt install -y curl
curl -sSL https://archive.heckel.io/apt/pubkey.txt | sudo apt-key add -
sudo apt install -y apt-transport-https
sudo sh -c "echo 'deb [arch=amd64] https://archive.heckel.io/apt debian main' > /etc/apt/sources.list.d/archive.heckel.io.list"
sudo apt update
sudo apt install -y ntfy
sudo systemctl enable ntfy
sudo systemctl start ntfy
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
-106
View File
@@ -1,106 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install nvim + lazyvim
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
# https://www.lazyvim.org/installation
# https://www.devas.life/effective-neovim-setup-for-web-development-towards-2024/
# TODO https://github.com/rockerBOO/awesome-neovim
# TODO https://docs.astronvim.com
isMac() { [ "$(uname -s)" = "Darwin" ]; }
isLinux() { [ "$(uname -s)" = "Linux" ]; }
if isLinux; then
url="https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz"
nvimDirName="nvim-linux-x86_64"
elif isMac; then
url="https://github.com/neovim/neovim/releases/latest/download/nvim-macos-x86_64.tar.gz"
nvimDirName="nvim-macos-x86_64"
fi
downloadPath="$HOME/install"
downloadTarGz="$downloadPath/nvim.tar.gz"
installPath="/opt/nvim"
cfgPath="$HOME/.config/nvim"
nvimDataPaths=(
"$cfgPath"
"$HOME/.local/share/nvim"
"$HOME/.local/state/nvim"
"$HOME/.cache/nvim"
)
backup() {
echo "Backup configuration files..."
t=$(date +'%s')
for path in "${nvimDataPaths[@]}"; do
[[ -d "$path" ]] && cp -rv "$path" "$path-$t.bak"
done
echo "Done"
}
install() {
echo
echo "==============================================="
echo "Installing neovim"
echo "==============================================="
echo
backup
if installed wget; then
wget -q --show-progress "$url" -O "$downloadTarGz"
else
curl -fsSL "$url" -o "$downloadTarGz"
fi
tar -xzf "$downloadTarGz" -C "$downloadPath"
sudo rm -rf "$installPath"
sudo mv "$downloadPath/$nvimDirName" "$installPath"
if [ -d "$cfgPath" ]; then
rm -rf "$cfgPath"
fi
git clone --depth=1 --single-branch https://github.com/LazyVim/starter "$cfgPath"
rm -rf "$cfgPath/.git"
if command -v update-desktop-database >/dev/null 2>&1; then
sudo update-desktop-database
fi
if command -v xdg-desktop-menu >/dev/null 2>&1; then
xdg-desktop-menu forceupdate
fi
echo
echo "Finish!"
nvim -v
echo
}
remove() {
echo
echo "==============================================="
echo "Removing neovim"
echo "==============================================="
echo
sudo rm -rf "$installPath"
for path in "${nvimDataPaths[@]}"; do
rm -rf "$path"
done
find "$HOME/.config" -type f -path "*/nvim*" -exec rm -rfv {} + 2>/dev/null || true
find "$HOME/.local" -type f -path "*/nvim*" -exec rm -rfv {} + 2>/dev/null || true
echo
echo "Finish!"
echo
}
case "$1" in
b|backup) backup ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
-34
View File
@@ -1,34 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install obs-studio (latest snap)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask obs
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing obs-studio"
echo "==============================================="
echo
sudo snap install obs-studio
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
-58
View File
@@ -1,58 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install ollama
# https://github.com/ollama/ollama
set -eo pipefail
install() {
echo
echo "==============================================="
echo "Installing ollama"
echo "==============================================="
echo
curl -fsSL https://ollama.com/install.sh | sh
echo
echo "Finish!"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing ollama"
echo "==============================================="
echo
if [ "$(uname -s)" = "Darwin" ]; then
sudo rm -rf /usr/local/bin/ollama /usr/local/lib/ollama ~/.ollama
else
# https://docs.ollama.com/linux#uninstall
sudo systemctl stop ollama 2>/dev/null || true
sudo systemctl disable ollama 2>/dev/null || true
sudo rm -f /etc/systemd/system/ollama.service 2>/dev/null || true
if command -v ollama >/dev/null 2>&1; then
sudo rm -rf "$(dirname "$(dirname "$(which ollama)")")/lib/ollama" 2>/dev/null || true
sudo rm -f "$(which ollama)"
fi
sudo userdel ollama 2>/dev/null || true
sudo groupdel ollama 2>/dev/null || true
sudo rm -rf \
/usr/bin/ollama \
/usr/share/ollama \
/usr/local/lib/ollama \
/usr/local/bin/ollama
fi
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
-69
View File
@@ -1,69 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install omz (latest)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing omz"
echo "==============================================="
echo
if ! installed zsh || ! installed git || ! installed curl; then
echo "ERROR: you need git, zsh and curl to be installed!" >&2
exit 1
fi
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo
echo "Finish!"
echo
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading omz"
echo "==============================================="
echo
if [ -d "$ZSH" ]; then
bash "$ZSH/tools/upgrade.sh"
else
echo "ERROR: OMZ not found." >&2
exit 1
fi
echo
echo "Finish!"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing omz"
echo "==============================================="
echo
if [ -d "$ZSH" ]; then
bash "$ZSH/tools/uninstall.sh"
else
echo "WARNING: OMZ not found, cleaning up." >&2
fi
rm -rf "$HOME/.oh-my-zsh"
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install omz fancy (powerline10k + MesloLGS font)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
isMac() { [ "$(uname -s)" = "Darwin" ]; }
install() {
echo
echo "==============================================="
echo "Installing omz fancy: powerline10k + MesloLGS font"
echo "==============================================="
echo
if ! installed zsh || ! installed git; then
echo "ERROR: you need git and zsh to be installed!" >&2
exit 1
fi
if [[ ! -d "$HOME/.oh-my-zsh" ]]; then
echo "ERROR: you need omz to be installed!" >&2
exit 1
fi
echo
echo "1/3 Installing MesloLGS fonts..."
mkdir -p "$HOME/.local/share/fonts/"
FONTS_URL="https://github.com/romkatv/powerlevel10k-media/raw/master"
if installed wget; then
wget -q --show-progress "$FONTS_URL/MesloLGS%20NF%20Regular.ttf" -O "$HOME/.local/share/fonts/MesloLGS NF Regular.ttf"
wget -q --show-progress "$FONTS_URL/MesloLGS%20NF%20Bold.ttf" -O "$HOME/.local/share/fonts/MesloLGS NF Bold.ttf"
wget -q --show-progress "$FONTS_URL/MesloLGS%20NF%20Italic.ttf" -O "$HOME/.local/share/fonts/MesloLGS NF Italic.ttf"
wget -q --show-progress "$FONTS_URL/MesloLGS%20NF%20Bold%20Italic.ttf" -O "$HOME/.local/share/fonts/MesloLGS NF Bold Italic.ttf"
else
curl -fsSL "$FONTS_URL/MesloLGS%20NF%20Regular.ttf" -o "$HOME/.local/share/fonts/MesloLGS NF Regular.ttf"
curl -fsSL "$FONTS_URL/MesloLGS%20NF%20Bold.ttf" -o "$HOME/.local/share/fonts/MesloLGS NF Bold.ttf"
curl -fsSL "$FONTS_URL/MesloLGS%20NF%20Italic.ttf" -o "$HOME/.local/share/fonts/MesloLGS NF Italic.ttf"
curl -fsSL "$FONTS_URL/MesloLGS%20NF%20Bold%20Italic.ttf" -o "$HOME/.local/share/fonts/MesloLGS NF Bold Italic.ttf"
fi
if command -v fc-cache >/dev/null 2>&1; then
fc-cache -vf "$HOME/.local/share/fonts/"
fi
echo
echo "2/3 Installing powerlevel10k theme..."
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"
sed -i.bak 's#^ZSH_THEME=.*$#ZSH_THEME="powerlevel10k/powerlevel10k"#g' "$HOME/.zshrc"
echo
echo "3/3 Installing plugins..."
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions"
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting"
sed -i.bak 's/^plugins=/plugins=(git laravel docker docker-compose composer zsh-autosuggestions zsh-syntax-highlighting)/g' "$HOME/.zshrc"
p10k configure
echo
echo "Finish! You need to:"
echo "- review your plugins in $HOME/.zshrc"
echo "- restart terminal windows to reload fonts and set 'MesloLGS NF Regular' as default font"
echo "- log out of your session and login again"
echo
}
case "$1" in
*) install ;;
esac
-80
View File
@@ -1,80 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install openvpn v2.6.3 (src)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
require() {
local missing=()
for pkg in "$@"; do
installed "$pkg" || missing+=("$pkg")
done
if [ ${#missing[@]} -gt 0 ]; then
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install "${missing[@]}"
else
echo "ERROR: Missing: ${missing[*]}. Install manually or use brew." >&2
exit 1
fi
else
sudo apt install -y "${missing[@]}"
fi
fi
}
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
unpack_targz() {
tar -xzvf "$1" -C "$2"
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install openvpn
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing openvpn"
echo "==============================================="
echo
# https://openvpn.net/community-downloads/
# https://openvpn.net/community-resources/installing-openvpn/
OVPNVER='2.6.3'
require libssl-dev liblzo2-dev libpam0g-dev
mkdir -p "$HOME/install/"
download "https://swupdate.openvpn.org/community/releases/openvpn-${OVPNVER}.tar.gz" "$HOME/install/openvpn-${OVPNVER}.tar.gz"
unpack_targz "$HOME/install/openvpn-${OVPNVER}.tar.gz" "$HOME/install/"
cd "$HOME/install/openvpn-${OVPNVER}"
sudo ./configure
sudo make
sudo make install
sudo apt install -y network-manager-openvpn network-manager-openvpn-gnome
echo
echo "Finish!"
openvpn --version
echo
}
case "$1" in
*) install ;;
esac
-55
View File
@@ -1,55 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install papirus-icon-theme (latest)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: Papirus icon theme is not supported on macOS." >&2
exit 1
fi
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
install() {
echo
echo "==============================================="
echo "Installing papirus-icon-theme"
echo "==============================================="
echo
if installed git; then
sudo git clone \
--depth 1 \
--single-branch \
https://github.com/PapirusDevelopmentTeam/papirus-icon-theme.git \
/usr/src/papirus-icon-theme
sudo chown "$(whoami)": -R /usr/src/papirus-icon-theme
else
download https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/archive/refs/heads/master.zip /tmp/papirus-icon-theme.zip
sudo unzip -oq /tmp/papirus-icon-theme.zip -d /usr/src/papirus-icon-theme
rm -f /tmp/papirus-icon-theme.zip
fi
sudo ln -sf /usr/src/papirus-icon-theme/Papirus /usr/share/icons/Papirus
sudo ln -sf /usr/src/papirus-icon-theme/Papirus-Dark /usr/share/icons/Papirus-Dark
sudo ln -sf /usr/src/papirus-icon-theme/Papirus-Light /usr/share/icons/Papirus-Light
echo
echo "Finish!"
echo "You can find icons in /usr/share/icons/"
echo
}
case "$1" in
*) install ;;
esac
+11 -55
View File
@@ -1,60 +1,16 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install postgresql (latest) and php-pgsql (if php is installed)
set -eo pipefail
echo
echo "==============================================="
echo "Installing postgresql (latest)..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
require() {
local missing=()
for pkg in "$@"; do
installed "$pkg" || missing+=("$pkg")
done
if [ ${#missing[@]} -gt 0 ]; then
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install "${missing[@]}"
else
echo "ERROR: Missing: ${missing[*]}. Install manually or use brew." >&2
exit 1
fi
else
sudo apt install -y "${missing[@]}"
fi
fi
installed() {
command -v "$1" >/dev/null 2>&1
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install postgresql
brew services start postgresql
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing postgresql"
echo "==============================================="
echo
require postgresql postgresql-contrib
sudo service postgresql restart
if installed php; then
sudo apt install -y --autoremove php-pgsql phpmyadmin
fi
echo
echo "Finish!"
postgres --version
echo
}
case "$1" in
*) install ;;
esac
sudo apt install -y --autoremove postgresql postgresql-contrib
sudo service postgresql restart
installed 'php' && sudo apt install -y --autoremove php-pgsql
+32 -56
View File
@@ -1,58 +1,34 @@
#!/usr/bin/env bash
##makedesc: Install php v8.4
#!/bin/bash
##makedesc: Install php v8.1 + ppa
set -eo pipefail
[ $1 ] && PHPVER="$1" || PHPVER="8.1"
echo
echo "==============================================="
echo "Installing php${PHPVER}..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install php
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
PHPVER="8.4"
echo
echo "==============================================="
echo "Installing php ${PHPVER}"
echo "==============================================="
echo
sudo apt install -y --autoremove \
php${PHPVER}-fpm \
php${PHPVER}-dev \
php${PHPVER}-apcu \
php${PHPVER}-bcmath \
php${PHPVER}-cli \
php${PHPVER}-common \
php${PHPVER}-curl \
php${PHPVER}-dom \
php${PHPVER}-gd \
php${PHPVER}-intl \
php${PHPVER}-mbstring \
php${PHPVER}-mysql \
php${PHPVER}-opcache \
php${PHPVER}-pgsql \
php${PHPVER}-simplexml \
php${PHPVER}-soap \
php${PHPVER}-sqlite3 \
php${PHPVER}-xdebug \
php${PHPVER}-xml \
php${PHPVER}-xmlrpc \
php${PHPVER}-zip
echo
echo "Finish!"
php -v
echo
}
case "$1" in
*) install ;;
esac
sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
sudo apt install -y --autoremove \
php${PHPVER} \
php${PHPVER}-cli \
php${PHPVER}-common \
php${PHPVER}-xdebug \
# php${PHPVER}-bcmath \
# php${PHPVER}-bz2 \
# php${PHPVER}-curl \
# php${PHPVER}-gd \
# php${PHPVER}-json \
# php${PHPVER}-mbstring \
# php${PHPVER}-mysql \
# php${PHPVER}-opcache \
# php${PHPVER}-pgsql \
# php${PHPVER}-soap \
# php${PHPVER}-xml \
# php${PHPVER}-xmlrpc \
# php${PHPVER}-xsl \
# php${PHPVER}-sqlite3 \
# php${PHPVER}-zip
# php${PHPVER}-dba
# php${PHPVER}-ldap
php -v
-43
View File
@@ -1,43 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install psalm
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing psalm"
echo "==============================================="
echo
if ! installed php; then
echo "ERROR: You need php to be installed" >&2
exit 1
fi
if ! installed composer; then
echo "ERROR: You need composer to be installed" >&2
exit 2
fi
COMPOSER_GLOBAL_HOME="$(composer config -g home)"
NEWPATH="export PATH=\"$COMPOSER_GLOBAL_HOME/vendor/bin:\${PATH}\""
if ! grep -qoh "$NEWPATH" "$HOME/.profile" 2>/dev/null; then
echo "$NEWPATH" >> "$HOME/.profile"
fi
# shellcheck source=/dev/null
source "$HOME/.profile"
composer global require vimeo/psalm --dev
echo
echo "Finish!"
psalm --version
echo
}
case "$1" in
*) install ;;
esac
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install php-spx
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: php-spx is not supported on macOS (requires Linux PHP extension build)." >&2
exit 1
fi
echo
echo "==============================================="
echo "Installing php-spx"
echo "==============================================="
echo
if ! installed php; then
echo "ERROR: You need php to be installed" >&2
exit 1
fi
if ! installed phpize; then
echo "ERROR: You need php-dev to be installed" >&2
exit 2
fi
if ! installed make; then
sudo apt install -y make
fi
mkdir -p "$HOME/install/php-spx"
if installed wget; then
wget -q --show-progress https://github.com/NoiseByNorthwest/php-spx/archive/refs/heads/release/latest.zip -O /tmp/php-spx.zip
else
curl -fsSL https://github.com/NoiseByNorthwest/php-spx/archive/refs/heads/release/latest.zip -o /tmp/php-spx.zip
fi
unzip -oq /tmp/php-spx.zip -d "$HOME/install/php-spx"
rm /tmp/php-spx.zip
cd "$HOME/install/php-spx/php-spx-release-latest"
phpize
./configure
make
sudo make install
PHPVER=$(php -r 'echo ($v=explode(".",PHP_VERSION))[0].".".$v[1];')
cat << EOF | sudo tee -a "/etc/php/${PHPVER}/mods-available/spx.ini"
; https://github.com/NoiseByNorthwest/php-spx/tree/release/latest#configuration
; https://habr.com/ru/post/505192/
; extension=spx.so
; spx.data_dir = '/tmp/spx'
spx.http_enabled = 0
spx.http_key = 'spx'
; spx.http_ip_whitelist = "127.0.0.1"
EOF
sudo ln -sf "/etc/php/${PHPVER}/mods-available/spx.ini" "/etc/php/${PHPVER}/cli/conf.d/99-spx.ini"
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
-45
View File
@@ -1,45 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install phpcs + php-cs-fixer
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing phpcs + php-cs-fixer"
echo "==============================================="
echo
if ! installed php; then
echo "ERROR: You need php to be installed" >&2
exit 1
fi
if ! installed composer; then
echo "ERROR: You need composer to be installed" >&2
exit 2
fi
COMPOSER_GLOBAL_HOME="$(composer config -g home)"
NEWPATH="export PATH=\"$COMPOSER_GLOBAL_HOME/vendor/bin:\${PATH}\""
if ! grep -qoh "$NEWPATH" "$HOME/.profile" 2>/dev/null; then
echo "$NEWPATH" >> "$HOME/.profile"
fi
# shellcheck source=/dev/null
source "$HOME/.profile"
composer global require squizlabs/php_codesniffer --dev
composer global require friendsofphp/php-cs-fixer --dev
echo
echo "Finish!"
phpcs --version
php-cs-fixer --version
echo
}
case "$1" in
*) install ;;
esac
-43
View File
@@ -1,43 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install phpmd
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing phpmd"
echo "==============================================="
echo
if ! installed php; then
echo "ERROR: You need php to be installed" >&2
exit 1
fi
if ! installed composer; then
echo "ERROR: You need composer to be installed" >&2
exit 2
fi
COMPOSER_GLOBAL_HOME="$(composer config -g home)"
NEWPATH="export PATH=\"$COMPOSER_GLOBAL_HOME/vendor/bin:\${PATH}\""
if ! grep -qoh "$NEWPATH" "$HOME/.profile" 2>/dev/null; then
echo "$NEWPATH" >> "$HOME/.profile"
fi
# shellcheck source=/dev/null
source "$HOME/.profile"
composer global require phpmd/phpmd --dev
echo
echo "Finish!"
phpmd --version
echo
}
case "$1" in
*) install ;;
esac
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install phpstan
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing phpstan"
echo "==============================================="
echo
if ! installed php; then
echo "ERROR: You need php to be installed" >&2
exit 1
fi
if ! installed composer; then
echo "ERROR: You need composer to be installed" >&2
exit 2
fi
COMPOSER_GLOBAL_HOME="$(composer config -g home)"
NEWPATH="export PATH=\"$COMPOSER_GLOBAL_HOME/vendor/bin:\${PATH}\""
if ! grep -qoh "$NEWPATH" "$HOME/.profile" 2>/dev/null; then
echo "$NEWPATH" >> "$HOME/.profile"
fi
# shellcheck source=/dev/null
source "$HOME/.profile"
composer global require phpstan/phpstan --dev
echo
echo "Finish!"
phpstan --version
echo
}
case "$1" in
*) install ;;
esac
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install phpunit
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing phpunit"
echo "==============================================="
echo
if ! installed php; then
echo "ERROR: You need php to be installed" >&2
exit 1
fi
if ! installed composer; then
echo "ERROR: You need composer to be installed" >&2
exit 2
fi
COMPOSER_GLOBAL_HOME="$(composer config -g home)"
NEWPATH="export PATH=\"$COMPOSER_GLOBAL_HOME/vendor/bin:\${PATH}\""
if ! grep -qoh "$NEWPATH" "$HOME/.profile" 2>/dev/null; then
echo "$NEWPATH" >> "$HOME/.profile"
fi
# shellcheck source=/dev/null
source "$HOME/.profile"
composer global require phpunit/phpunit --dev
echo
echo "Finish!"
phpunit --version
echo
}
case "$1" in
*) install ;;
esac
+17 -57
View File
@@ -1,67 +1,27 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install postman (latest)
set -eo pipefail
echo
echo "==============================================="
echo "Installing postman (latest)..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
wget "https://dl.pstmn.io/download/latest/linux64" -O /tmp/postman.tar.gz
# sudo tar -xvzf /tmp/postman.tar.gz -C /usr/local/bin
sudo tar -xzf /tmp/postman.tar.gz -C /usr/local
rm /tmp/postman.tar.gz
sudo ln -s /usr/local/Postman/Postman /usr/local/bin/postman
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
echo "#!/usr/bin/env xdg-open
unpack_targz() {
tar -xzvf "$1" -C "$2"
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask postman
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing postman"
echo "==============================================="
echo
# https://learning.postman.com/docs/getting-started/installation-and-updates/#installing-postman-on-linux
mkdir -p "$HOME/install" "$HOME/.local/bin" "$HOME/.local/share/applications"
download "https://dl.pstmn.io/download/latest/linux64" "$HOME/install/postman.tar.gz"
unpack_targz "$HOME/install/postman.tar.gz" "$HOME/install"
ln -sf "$HOME/install/Postman/Postman" "$HOME/.local/bin/postman"
cat << EOF > "$HOME/.local/share/applications/Postman.desktop"
[Desktop Entry]
Name=Postman
Exec=$HOME/.local/bin/postman %U
Icon=$HOME/install/Postman/app/resources/app/assets/icon.png
Categories=Development,Network
Exec=/usr/local/bin/postman
Icon=/usr/local/Postman/app/icons/icon_128x128.png
Categories=Utility,Network
Terminal=false
Type=Application
Encoding=UTF-8
EOF
if command -v update-desktop-database >/dev/null 2>&1; then
sudo update-desktop-database
fi
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
" > $HOME/.local/share/applications/Postman.desktop
sudo update-desktop-database
-47
View File
@@ -1,47 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install qt5
set -eo pipefail
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if command -v brew >/dev/null 2>&1; then
brew install qt@5
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing qt5"
echo "==============================================="
echo
sudo apt install -y --autoremove \
build-essential \
ca-certificates \
cmake \
g++ \
libqt5core5a \
libqt5dbus5 \
libqt5gui5 \
libqt5network5 \
libqt5svg5 \
libqt5svg5-dev \
libqt5widgets5 \
openssl \
qtbase5-dev \
qttools5-dev \
qttools5-dev-tools
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
+13 -68
View File
@@ -1,71 +1,16 @@
#!/usr/bin/env bash
##makedesc: Install rustdesk client v1.4.2 (deb)
#!/bin/bash
##makedesc: Install rustdesk v1.1.8 (deb)
set -eo pipefail
[ $1 ] && RDVER="$1" || RDVER="1.1.8"
echo
echo "==============================================="
echo "Installing rustdesk v${RDVER}..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
# https://github.com/rustdesk/rustdesk
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask rustdesk
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
RDVER="1.4.9"
echo
echo "==============================================="
echo "Installing rustdesk v${RDVER}"
echo "==============================================="
echo
# https://github.com/rustdesk/rustdesk
deb_path="$HOME/install"
deb_name="rustdesk-${RDVER}.deb"
mkdir -p "$deb_path"
deb="$deb_path/$deb_name"
sudo apt install -y libxdo3 python3-pip
if installed wget; then
wget -q --show-progress "https://github.com/rustdesk/rustdesk/releases/download/${RDVER}/${deb_name}" -O "$deb"
else
curl -fsSL "https://github.com/rustdesk/rustdesk/releases/download/${RDVER}/${deb_name}" -o "$deb"
fi
sudo dpkg -i "$deb"
echo
echo "Finish!"
echo
}
remove() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew uninstall --cask rustdesk
fi
return
fi
echo
echo "==============================================="
echo "Removing rustdesk"
echo "==============================================="
echo
sudo dpkg -r rustdesk 2>/dev/null || true
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
sudo apt install libxdo3
wget "http://github.com/rustdesk/rustdesk/releases/download/${RDVER}/rustdesk-${RDVER}.deb" -qO /tmp/rustdesk.deb
sudo dpkg -i /tmp/rustdesk.deb
rm /tmp/rustdesk.deb
+34 -31
View File
@@ -1,41 +1,44 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install bunch of software from snap
set -eo pipefail
echo
echo "==============================================="
echo "Installing software from snap..."
echo "==============================================="
echo
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: snap is not supported on macOS. Use brew instead." >&2
exit 1
fi
installed() { command -v "$1" >/dev/null 2>&1; }
installed() {
command -v "$1" >/dev/null 2>&1
}
snapi() {
snap install "$1" 2>/dev/null || snap install "$1" --classic
snap install $1 2>/dev/null
[[ $? -ne 0 ]] && snap install $1 --classic
}
install() {
echo
echo "==============================================="
echo "Installing software from snap"
echo "==============================================="
echo
if ! installed snapd; then
sudo apt update
sudo apt install -y --autoremove snapd gnome-software-plugin-snap
fi
if ! installed snapd; then
sudo apt update
sudo apt install -y --autoremove snapd
fi
# snapi snap-store
snapi telegram-desktop
snapi code
# snapi phpstorm
snapi skype
# snapi audacity
# snapi flameshot
# snapi gtk-common-themes
# snapi gtk2-common-themes
# snapi kde-frameworks-5-core18
snapi zoom-client
snapi peek
snapi peek
snapi skype
snapi dbeaver-ce
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
# https://certbot.eff.org/
# snapi certbot
# sudo ln -s /snap/bin/certbot /usr/bin/certbot
# snapi mysql-workbench-community
snapi dbeaver-ce
# snapi discord
# snapi obs-studio
-78
View File
@@ -1,78 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install Sublime Merge
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask sublime-merge
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing Sublime Merge"
echo "==============================================="
echo
# https://www.sublimemerge.com/download
SMVER='2102'
mkdir -p "$HOME/install"
DEB_PATH="$HOME/install/sublime-merge_build-${SMVER}_amd64.deb"
BIN_PATH="/opt/sublime_merge/sublime_merge"
if [[ ! -f "$DEB_PATH" ]]; then
download "https://download.sublimetext.com/sublime-merge_build-${SMVER}_amd64.deb" "$DEB_PATH"
fi
sudo dpkg -i "$DEB_PATH"
echo
echo "Finish!"
$BIN_PATH --version
echo
}
remove() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew uninstall --cask sublime-merge
fi
return
fi
echo
echo "==============================================="
echo "Removing Sublime Merge"
echo "==============================================="
echo
sudo dpkg -r sublime-merge 2>/dev/null || true
sudo rm -rf /opt/sublime_merge
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
-87
View File
@@ -1,87 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install Sublime Text
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask sublime-text
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing Sublime Text"
echo "==============================================="
echo
# https://www.sublimetext.com/download
STVER='4200'
mkdir -p "$HOME/install"
DEB_PATH="$HOME/install/sublime-text_build-${STVER}_amd64.deb"
BIN_PATH="/opt/sublime_text/sublime_text"
if [[ ! -f "$DEB_PATH" ]]; then
download "https://download.sublimetext.com/sublime-text_build-${STVER}_amd64.deb" "$DEB_PATH"
fi
sudo dpkg -i "$DEB_PATH"
sudo cp -f "$BIN_PATH" "$BIN_PATH.old"
if [[ $STVER = 4169 ]]; then
echo "00489f39: c640 0501 4885 c9" | sudo xxd -r - "$BIN_PATH"
elif [[ $STVER = 4200 ]]; then
sudo sed -i 's#\x0F\xB6\x51\x05\x83\xF2\x01#\xC6\x41\x05\x01\xB2\x00\x90#' "$BIN_PATH"
else
sudo sed -i 's#\x80\x79\x05\x00\x0F\x94\xC2#\xC6\x41\x05\x01\xB2\x00\x90#' "$BIN_PATH"
fi
echo
echo "Finish!"
$BIN_PATH --version
echo
}
remove() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew uninstall --cask sublime-text
fi
return
fi
echo
echo "==============================================="
echo "Removing Sublime Text"
echo "==============================================="
echo
sudo dpkg -r sublime-text 2>/dev/null || true
sudo rm -rf /opt/sublime_text
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
-48
View File
@@ -1,48 +0,0 @@
#!/usr/bin/env bash
##makedesc: Samsung Unified Linux Driver repo
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: Samsung Unified Linux Driver is not supported on macOS." >&2
exit 1
fi
echo
echo "==============================================="
echo "Installing Samsung Unified Linux Driver"
echo "==============================================="
echo
# https://www.bchemnet.com/suldr/
# https://www.bchemnet.com/suldr/supported.html
mkdir -p "$HOME/install"
sudo bash -c 'echo "deb https://www.bchemnet.com/suldr/ debian extra" >> /etc/apt/sources.list.d/samsung.list'
download \
https://www.bchemnet.com/suldr/pool/debian/extra/su/suldr-keyring_3_all.deb \
"$HOME/install/suldr-keyring_3_all.deb"
sudo dpkg -i "$HOME/install/suldr-keyring_3_all.deb"
sudo apt install -y suld-driver2-1.00.39
echo
echo "Finish!"
echo "Don't forget to connect your Samsung printer"
echo "See more info here: https://www.bchemnet.com/suldr/"
echo
}
case "$1" in
*) install ;;
esac
+20 -50
View File
@@ -1,58 +1,28 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install syncthing (latest) + ppa
set -eo pipefail
echo
echo "==============================================="
echo "Installing syncthing (latest) + ppa..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
# https://apt.syncthing.net/
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
# Add the release PGP keys:
sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install syncthing
brew services start syncthing
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
# Add the "stable" channel to your APT sources:
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
echo
echo "==============================================="
echo "Installing syncthing"
echo "==============================================="
echo
# Add the "candidate" channel to your APT sources:
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing candidate" | sudo tee /etc/apt/sources.list.d/syncthing.list
# https://apt.syncthing.net/
# Update and install syncthing:
sudo apt update
sudo apt install -y --autoremove syncthing
# Add the release PGP keys:
sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
# Add the channels to APT sources:
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing candidate" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt update
sudo apt install -y --autoremove syncthing
mkdir -p "$HOME/.local/share/applications" "$HOME/.config/autostart"
download "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-start.desktop" "$HOME/.local/share/applications/syncthing-start.desktop"
download "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-ui.desktop" "$HOME/.local/share/applications/syncthing-ui.desktop"
ln -sf "$HOME/.local/share/applications/syncthing-start.desktop" "$HOME/.config/autostart/syncthing-start.desktop"
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
wget "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-start.desktop" -O $HOME/.local/share/applications/syncthing-start.desktop
wget "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-ui.desktop" -O $HOME/.local/share/applications/syncthing-ui.desktop
ln -s $HOME/.local/share/applications/syncthing-start.desktop $HOME/.config/autostart/syncthing-start.desktop
# или демоном: https://habr.com/ru/post/350892/
+14 -19
View File
@@ -1,23 +1,18 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install telebit (latest)
set -eo pipefail
echo
echo "==============================================="
echo "Installing telebit (latest)..."
echo "==============================================="
echo
install() {
echo
echo "==============================================="
echo "Installing telebit"
echo "==============================================="
echo
# https://git.coolaj86.com/coolaj86/telebit.js#install
# https://git.coolaj86.com/coolaj86/telebit.js#install
curl -fsSL https://get.telebit.io/ | bash
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
# export NODEJS_VER=v10.2 # v10.2 is tested working, but we can test other versions
# export TELEBIT_VERSION=master # git tag or branch to install from
# export TELEBIT_USERSPACE=no # install as a system service (launchd, systemd only)
# export TELEBIT_PATH=/opt/telebit
# export TELEBIT_USER=telebit
# export TELEBIT_GROUP=telebit
curl https://get.telebit.io/ | bash
-40
View File
@@ -1,40 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install telegram (latest)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask telegram
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing telegram"
echo "==============================================="
echo
mkdir -p "$HOME/install" "$HOME/.local/bin"
if installed wget; then
wget -q --show-progress "https://telegram.org/dl/desktop/linux" -O "$HOME/install/telegram.tar.gz"
else
curl -fsSL "https://telegram.org/dl/desktop/linux" -o "$HOME/install/telegram.tar.gz"
fi
tar -xJf "$HOME/install/telegram.tar.gz" -C "$HOME/.local/bin"
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
-56
View File
@@ -1,56 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install tilt (k8s dev env)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
isMac() { [ "$(uname -s)" = "Darwin" ]; }
install() {
echo
echo "==============================================="
echo "Installing tilt"
echo "==============================================="
echo
mkdir -p ~/install/tilt ~/.local/bin
if isMac; then
if installed brew; then
brew install kubectl tilt-dev/tap/ctlptl tilt-dev/tap/tilt
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
else
cd ~/install/tilt
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
chmod +x kubectl
cp ./kubectl ~/.local/bin/kubectl
CTLPTL_URL=$(curl -s "https://api.github.com/repos/tilt-dev/ctlptl/releases/latest" \
| jq -r '.assets.[] | select(.name | test("linux.x86_64.tar.gz")).browser_download_url')
curl -fsSL "$CTLPTL_URL" | tar -xz -C ~/.local/bin ctlptl
TILT_URL=$(curl -s "https://api.github.com/repos/tilt-dev/tilt/releases/latest" \
| jq -r '.assets.[] | select(.name | test("linux.x86_64.tar.gz")).browser_download_url')
curl -fsSL "$TILT_URL" | tar -xz -C ~/.local/bin tilt
fi
echo
echo "Finish!"
echo "ctlptl version = $(ctlptl version)"
echo "tilt version = $(tilt version)"
echo "kubectl version:"
kubectl version
echo
}
case "$1" in
*) install ;;
esac
+8 -27
View File
@@ -1,30 +1,11 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install ulauncher (latest) + ppa
set -eo pipefail
echo
echo "==============================================="
echo "Installing ulauncher (latest) + ppa..."
echo "==============================================="
echo
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: ulauncher is not supported on macOS. Use Alfred or Raycast instead." >&2
exit 1
fi
install() {
echo
echo "==============================================="
echo "Installing ulauncher"
echo "==============================================="
echo
sudo add-apt-repository universe -y
sudo add-apt-repository ppa:agornostal/ulauncher -y
sudo apt update
sudo apt install -y ulauncher
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
sudo add-apt-repository ppa:agornostal/ulauncher
sudo apt install -y --autoremove ulauncher
-42
View File
@@ -1,42 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install uv (fast Python package manager)
# https://github.com/astral-sh/uv
set -eo pipefail
install() {
echo
echo "==============================================="
echo "Installing uv (fast Python package manager)"
echo "==============================================="
echo
curl -LsSf https://astral.sh/uv/install.sh | sh
echo
echo "Finish!"
uv --version
echo
}
remove() {
echo
echo "==============================================="
echo "Removing uv"
echo "==============================================="
echo
rm -rf "$HOME/.local/bin/uv" \
"$HOME/.local/bin/uvx" \
"$HOME/.local/share/uv"
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
-74
View File
@@ -1,74 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install Vivaldi + ppa
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
doInstall() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask vivaldi
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing Vivaldi"
echo "==============================================="
echo
# https://repo.vivaldi.com
# https://help.vivaldi.com/desktop/#install-update
if installed wget; then
wget -qO- https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor > packages.vivaldi.gpg
else
curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | gpg --dearmor > packages.vivaldi.gpg
fi
sudo install -o root -g root -m 644 packages.vivaldi.gpg /etc/apt/trusted.gpg.d
sudo sh -c 'echo "deb [arch=amd64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.vivaldi.gpg] https://repo.vivaldi.com/archive/deb stable main" > /etc/apt/sources.list.d/vivaldi.list'
rm -f packages.vivaldi.gpg
sudo apt update
sudo apt install -y vivaldi-stable
echo
echo "Finish!"
echo
}
remove() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew uninstall --cask vivaldi
fi
return
fi
echo
echo "==============================================="
echo "Removing Vivaldi"
echo "==============================================="
echo
sudo apt remove -y vivaldi-stable
sudo rm -rf \
/usr/share/keyrings/vivaldi-browser.gpg \
/etc/apt/sources.list.d/vivaldi-archive.list \
/etc/apt/sources.list.d/vivaldi.list
sudo apt update
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) doInstall ;;
esac
-47
View File
@@ -1,47 +0,0 @@
#!/usr/bin/env bash
##makedesc: VSCode deb-package
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install --cask visual-studio-code
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing VSCode"
echo "==============================================="
echo
mkdir -p "$HOME/install"
download "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64" \
"$HOME/install/vscode.deb"
sudo dpkg -i "$HOME/install/vscode.deb"
echo
echo "Finish!"
code --version
echo
}
case "$1" in
*) install ;;
esac
+12 -55
View File
@@ -1,57 +1,14 @@
#!/usr/bin/env bash
##makedesc: Install wine (latest) + ppa
#!/bin/bash
##makedesc: Install wine (latest) + ppa (focal)
set -eo pipefail
echo
echo "==============================================="
echo "Installing wine (latest)..."
echo "==============================================="
echo
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: wine on macOS requires Wine Skin, CrossOver, or manual setup" >&2
exit 1
fi
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing wine"
echo "==============================================="
echo
sudo dpkg --add-architecture i386
if installed wget; then
wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
else
curl -fsSL https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
fi
sudo add-apt-repository -y "deb https://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -cs 2>/dev/null) main"
sudo apt install -y --autoremove winehq-stable
echo
echo "Finish!"
wine --version
echo
}
remove() {
echo
echo "==============================================="
echo "Removing wine"
echo "==============================================="
echo
sudo apt remove --purge -y "wine*"
rm -rf "$HOME/.wine"
rm -f "$HOME/.config/menus/applications-merged/"*wine*
rm -rf "$HOME/.local/share/applications/wine"
rm -f "$HOME/.local/share/desktop-directories/"*wine*
rm -f "$HOME/.local/share/icons/"*wine*
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac
sudo dpkg --add-architecture i386
wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
sudo apt install -y --autoremove winehq-stable
wine --version
-59
View File
@@ -1,59 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install youtube-dl (src)
set -eo pipefail
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing youtube-dl"
echo "==============================================="
echo
# https://github.com/ytdl-org/youtube-dl#installation
if ! installed make; then
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: Install Xcode Command Line Tools first." >&2
exit 1
else
sudo apt install -y make
fi
fi
mkdir -p "$HOME/install/youtube-dl" "$HOME/.local/bin"
if installed git; then
if [ -d "$HOME/install/youtube-dl" ]; then
cd "$HOME/install/youtube-dl"
git pull
else
git clone https://github.com/ytdl-org/youtube-dl.git "$HOME/install/youtube-dl" --depth=1 --single-branch
fi
else
if ! installed wget; then
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: Install wget or use git." >&2
exit 1
else
sudo apt install -y wget
fi
fi
wget -q --show-progress https://github.com/ytdl-org/youtube-dl/archive/refs/heads/master.zip -O "$HOME/install/youtube-dl.zip"
unzip -oq "$HOME/install/youtube-dl.zip" -d "$HOME/install/youtube-dl"
fi
cd "$HOME/install/youtube-dl"
make youtube-dl
mv youtube-dl "$HOME/.local/bin/"
echo
echo "Finish!"
youtube-dl --version
echo
}
case "$1" in
*) install ;;
esac
-27
View File
@@ -1,27 +0,0 @@
#!/usr/bin/env bash
##makedesc: Install ytdlcue
set -eo pipefail
install() {
echo
echo "==============================================="
echo "Installing ytdlcue"
echo "==============================================="
echo
# https://gist.github.com/anthonyaxenov/8e11f18493c8419ee7abc94a8ea0cfaf
install_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
tools_dir="$(dirname "$install_dir")/tools"
cp "${tools_dir}/ytdlcue.sh" "$HOME/.local/bin/ytdlcue"
chmod +rx "$HOME/.local/bin/ytdlcue"
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
+33 -47
View File
@@ -1,51 +1,37 @@
#!/usr/bin/env bash
#!/bin/bash
##makedesc: Install zint (latest)
set -eo pipefail
echo
echo "==============================================="
echo "Installing zint (latest)..."
echo "==============================================="
echo
installed() { command -v "$1" >/dev/null 2>&1; }
sudo apt install -y --autoremove \
g++ \
cmake \
qtbase5-dev \
qttools5-dev \
libpng-dev
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install zint
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
echo
echo "==============================================="
echo "Installing zint"
echo "==============================================="
echo
sudo apt install -y --autoremove \
g++ \
cmake \
qtbase5-dev \
qttools5-dev \
libpng-dev
if installed git; then
sudo rm -rf /usr/src/zint
sudo git clone https://github.com/zint/zint.git /usr/src/zint
cd /usr/src/zint
sudo cmake .
sudo make
sudo make install
else
echo "ERROR: You need git to be installed!" >&2
exit 1
fi
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac
if installed git; then
# 2.9.* ===============================================================================
sudo git clone git@github.com:zint/zint.git /usr/src/zint
cd /usr/src/zint
sudo cmake .
sudo make
sudo make install
else
echo "You need git to be installed!"
# 2.4.2 ===============================================================================
# https://wayneoutthere.com/2021/02/17/how-to-install-zint-on-ubuntu/
# sudo wget https://github.com/downloads/zint/zint/zint-2.4.2.tar.gz -O /usr/src/zint.tar.gz
# sudo tar -C /usr/src/ -xzf /usr/src/zint.tar.gz
# sudo rm -rf /usr/src/zint.tar.gz
# cd /usr/src/zint-2.4.2/build
# sudo cmake ..
# sudo make
# sudo make install
# sudo rm -rf /usr/src/zint*
# cd -
fi
+52 -19
View File
@@ -1,23 +1,56 @@
#!/usr/bin/env bash
##makedesc: Install vanilla zsh
#!/bin/bash
##makedesc: Install zsh + omz (latest)
set -eo pipefail
echo
echo "==============================================="
echo "Installing zsh + omz (latest)..."
echo "==============================================="
echo
install() {
echo
echo "==============================================="
echo "Installing vanilla zsh"
echo "==============================================="
echo
sudo apt install -y --autoremove zsh
echo "source ~/.profile" >> "$HOME/.zshrc"
echo
echo "Finish!"
echo
installed() {
command -v "$1" >/dev/null 2>&1
}
case "$1" in
*) install ;;
esac
if ! installed git || ! installed curl; then
echo "ERROR: you need git and curl to be installed!"
exit 1
fi
sudo apt install -y --autoremove zsh
# sudo chsh -s $(which zsh)
# Based on:
# https://github.com/Powerlevel9k/powerlevel9k/wiki/Install-Instructions
# https://github.com/ohmyzsh/ohmyzsh
# https://powerline.readthedocs.io/en/latest/installation/linux.html#fonts-installation
# https://gist.github.com/dogrocker/1efb8fd9427779c827058f873b94df95
# https://linuxhint.com/install_zsh_shell_ubuntu_1804/
echo
echo "1. Installing oh-my-zsh..."
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo
echo "2. Installing powerlevel9k theme (legacy)..."
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
sed -i 's@^ZSH_THEME=.*$@ZSH_THEME="powerlevel9k/powerlevel9k"@g' ~/.zshrc
echo
echo "3. Installing powerline fonts..."
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
mkdir -p ~/.local/share/fonts/
mv PowerlineSymbols.otf ~/.local/share/fonts/
fc-cache -vf ~/.local/share/fonts/
mkdir -p ~/.config/fontconfig/conf.d/
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
echo
echo "4. Installing autosuggestions and syntax highlighting..."
git clone https://github.com/zsh-users/zsh-autosuggestions.git .oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git .oh-my-zsh/custom/plugins/zsh-syntax-highlighting
sed -i 's@plugins=(git)@plugins=(git zsh-autosuggestions zsh-syntax-highlighting)@g' ~/.zshrc
echo
echo "Finish! Log out of your session and login again."
echo
-2
View File
@@ -1,2 +0,0 @@
##lamp: [PACK] Apache + php + mariadb
lamp: apache phpstack mariadb
+2
View File
@@ -0,0 +1,2 @@
##lamp: Apache + php + mariadb
lamp: apache php mariadb
-2
View File
@@ -1,2 +0,0 @@
##obs: [PACK] Install OBS Studio + droidcam-obs
obs: obs-studio droidcam-obs
-4
View File
@@ -1,4 +0,0 @@
##omz: [PACK] zsh + omz + powerline10k + MesloLGS font
omz: zsh omz-clean omz-fancy
chsh -s /usr/bin/zsh
@exec zsh
-2
View File
@@ -1,2 +0,0 @@
##phptools: [PACK] Install only php tooling (composer, phpunit, psalm, phpcs, php-cs-fixer, phpmd)
phptools: composer php-psalm phpcs phpmd phpstan phpunit
-2
View File
@@ -1,2 +0,0 @@
##phpstack: [PACK] Install full php stack with tooling
phpstack: php phptools
+120
View File
@@ -0,0 +1,120 @@
##############################################################
# Скрипт для автоматического резервного копирования
# базы данных.
#
# Автор: Антон Аксенов
# URL: anthonyaxenov.ru
# Email: anthonyaxenov@gmail.com
#
# Подробности о скрипте, подготовка к работе:
# https://anthonyaxenov.blogspot.ru/2017/05/cron-1.html
#
##############################################################
#!/bin/bash
# Данные для работы с БД
DBHOST=
DBUSER=
DBPASS=
DBNAME=
DBCHARSET="utf8"
# Даты
FMT_DT_DIR="%d-%m-%Y" # формат даты для директорий | 19-03-2021
FMT_DT_FILE="%H%M%S-%d%m%y" # формат даты для файлов | 082456-190321
FMT_DT_LOG="%H:%M:%S" # формат даты для лога | 08:24:15.168149413
# Локальное хранилище
LOCALDIR=/backup # полный путь директории для бэкапов
LOCALPATH=$LOCALDIR/$(date +$FMT_DT_DIR) # полный путь директории за сегодня
LOCALFILE=$LOCALPATH/$DBNAME-$(date +$FMT_DT_FILE).sql # полный путь к файлу дампа
# Облачное хранилище
CLOUDUSE=1 # Копировать ли в облако? Закомментировать строку, если не надо
CLOUDMNT=/mnt/yadisk # Точка монтирования облака относительно корня
CLOUDDIR=db_backup # Папка в облаке, куда будут лететь файлы (внутри папки CLOUDMNT, т.е. без / в начале)
CLOUDPATH=$CLOUDMNT/$CLOUDDIR/$DATE # полный путь к папке текущей даты в облаке относительно корня
CLOUDFILE=$CLOUDPATH/$DBNAME-$DATETIME.sql # полный путь к файлу дампа в облаке
CLOUDFILEGZ=$CLOUDFILE.gz # полный путь к архиву в облаке
# Путь к бекапу на примонтированном хранилище будет выглядеть так:
# /mnt/yadisk/db_backup/2017-01-01/mybigdatabase-2017-01-01-12-23-34.sql.gz
log() {
echo "[$(date +$FMT_DT_LOG)] $*"
}
is_dir() {
[ -d "$1" ]
}
# Начало процесса
echo "[--------------------------------[$(date +$FMT_DT_LOG)]--------------------------------]"
log $LOCALPATH
if ! is_dir $LOCALPATH; then # Если нет папки за сегодня
sudo mkdir -p $LOCALPATH # создаём её, ошибки игнорируем
[ $? -eq 0 ] && log "New directory: $LOCALPATH"
fi
log "Generate a database dump: '$DBNAME'..."
mysqldump \
-q \
--user=$DBUSER \
--host=$DBHOST \
--password=$DBPASS \
--opt \
--default-character-set=$DBCHARSET $DBNAME \
> $LOCALFILE
exit
if [[ $? -gt 0 ]]; then
# если дамп сделать не удалось (код завершения предыдущей команды больше нуля) - прерываем весь скрипт
log "Dumping failed! Script aborted."
exit 1
else # иначе - упаковываем его
log "Dumping successfull! Packing in GZIP..."
gzip $LOCALFILE # Упаковка
if [[ $? -ne 0 ]]; then # Если не удалась
log "GZipping failed! SQL-file will be uploaded."
GZIP_FAILED=1 # Создаём флажок, что упаковка сорвалась
else
log "Result file: $LOCALFILEGZ"
fi
if [[ $CLOUDUSE -eq 1 ]]; then # Если задано копирование в облако - делаем всякое такое
mount | grep "$CLOUDMNT" > /dev/null # Проверяем примонтировано ли уже у нас облако (вывод не важен)
if [[ $? -ne 0 ]]; then # Если нет
mount $CLOUDMNT # значит монтируем
fi
if [[ $? -eq 0 ]]; then # если монтирование успешно - копируем туда файл
log "Cloud: successfully mounted at $CLOUDMNT"
log "Cloud: copying started => $CLOUDFILEGZ"
if ! [[ -d $CLOUDPATH ]]; then # Если в облаке нет папки за сегодня
mkdir $CLOUDPATH 2> /dev/null # создаём её, ошибки игнорируем
fi
if [[ -f $LOCALFILEGZ && GZIP_FAILED -ne 1 ]]; then # Если у нас архивирование выше не сорвалось
cp -R $LOCALFILEGZ $CLOUDFILEGZ # Копируем архив
else
cp -R $LOCALFILE $CLOUDFILE # Иначе - копируем большой тяжёлый дамп
fi
if [[ $? -gt 0 ]]; then # Если не скопировался - просто сообщаем
log "Cloud: copy failed."
else # Если скопировался - сообщаем и размонтируем
log "Cloud: file successfully uploaded!"
umount $CLOUDMNT # Размонтирование облака
if [[ $? -gt 0 ]]; then # Сообщаем результат размонтирования (если необходимо)
log "Cloud: umount - failed!"
fi # Конец проверки успешного РАЗмонтирования
fi # Конец проверки успешного копирования
else # если монтирование НЕуспешно - сообщаем
log "Cloud: failed to mount cloud at $CLOUDMNT"
fi # Конец проверки успешного монтирования
fi # Конец проверки необходимости выгрузки в облако
fi # Конец проверки успешного выполнения mysqldump
log "Stat datadir space (USED): `du -h $LOCALPATH | tail -n1`" # вывод размера папки с бэкапами за текущий день
log "Free HDD space: `df -h /home|tail -n1|awk '{print $4}'`" # вывод свободного места на локальном диске
log "All operations completed!"
exit 0 # Успешное завершение скрипта
+55
View File
@@ -0,0 +1,55 @@
#!/bin/bash
# https://gist.github.com/anthonyaxenov/c16e1181d4b8a8644c57ec8a1f6cf21c
#########################################################################
# #
# Set display resolution #
# #
# Author: Anthony Axenov (Антон Аксенов) #
# Version: 1.0 #
# License: WTFPL #
# #
#########################################################################
# #
# Using this script you can change your display resolution #
# to any one you need. Just adjust some vars below and run script #
# (chmod +x needed). #
# #
#########################################################################
# Set display name to work with. You can get it via 'xrandr --listactivemonitors'
display="HDMI-2"
# Set width of this display in px
width=1600
# Set height of this display in px
height=900
# Sometimes cvt and gtf generates different modelines.
# You can play around and look which of them gives best result:
modeline=$(cvt ${width} ${height} | grep "Modeline")
# modeline=$(gtf ${width} ${height} 60 | grep "Modeline")
# Some important data needed to xrandr:
modename="${width}x${height}_my"
params=$(echo "$modeline" | sed "s|^\s*Modeline\s*\"[0-9x_.]*\"\s*||")
echo "Set resolution ${width}x${height} on display $display:"
echo "$modename $params"
# Simple logic:
# 1. Switch display to safe mode which always exists (I believe) to avoid errors
xrandr --output $display --mode 640x480
# 2. If display aready have our mode -- we must delete it to avoid errors
if $(xrandr | grep -q "$modename"); then
# 2.1. Detach mode from display
xrandr --delmode $display $modename
# 2.2. Remove mode itself
xrandr --rmmode $modename
fi
# 3. Create new mode with freshly generated parameters
xrandr --newmode $modename $params
# 4. Attach mode to our display
xrandr --addmode $display $modename
# 5. Switch display to this mode immidiately
xrandr --output $display --mode $modename