Skip to content

Instantly share code, notes, and snippets.

View ShockwaveNN's full-sized avatar

Pavel Lobashov ShockwaveNN

View GitHub Profile
@ShockwaveNN
ShockwaveNN / update_zoom.sh
Last active February 8, 2022 12:59
Script for updating zoom
#!/bin/sh
wget https://zoom.us/client/latest/zoom_amd64.deb -O /tmp/zoom_amd64.deb
sudo dpkg -i /tmp/zoom_amd64.deb
rm /tmp/zoom_amd64.deb
@ShockwaveNN
ShockwaveNN / system_update.sh
Created December 8, 2020 06:59
Upgrade Ubuntu-based system
sudo apt -y update
sudo apt dist-upgrade
sudo apt autoremove
sudo snap refresh
flatpak update
@ShockwaveNN
ShockwaveNN / initial_setup.sh
Last active November 29, 2021 06:53
rastberry pi initial setup for rasbian os
#!/bin/sh
set -e
KODI_BACKUP_FILE=''
echo 'gpu_mem=256' | sudo tee -a /boot/config.txt
sudo raspi-config nonint do_boot_wait 0
# Restore kodi backup
@ShockwaveNN
ShockwaveNN / kodi-backup.sh
Last active November 16, 2020 08:57
script for making backup of kodi settings
#!/bin/bash
DATE=$(date '+%Y-%m-%d-%H-%M-%S')
BACKUP_NAME=kodi-backup-$DATE.tar.gz
TEMP_BACKUP_LOCATION=/tmp/backups/kodi
BACKUP_DIR=/home/pi/.kodi
ARCHIVE_DIR=/media/routher_share/Backup/kodi
mkdir -pv $TEMP_BACKUP_LOCATION
chmod 777 $TEMP_BACKUP_LOCATION
@ShockwaveNN
ShockwaveNN / master_update.sh
Last active January 24, 2022 14:59
master_update
#!/usr/bin/env bash
# https://gist.github.com/ShockwaveNN/a04d3419c3956aec556f759283a1556e/edit
master_branch_exists=$(git ls-remote --heads origin master)
if [[ -z ${master_branch_exists} ]]; then
git checkout main
else
git checkout master
fi
@ShockwaveNN
ShockwaveNN / DS_docker_after_release.sh
Last active September 5, 2024 07:38
after release check docker versions
docker pull onlyoffice/documentserver
docker run -itd -p 80:80 --name ds-release onlyoffice/documentserver
sleep 90
docker exec ds-release bash -c "dpkg -l | grep only"
docker exec ds-release supervisorctl start all
xdg-open http://localhost
docker stop ds-release
docker rm ds-release
docker rmi onlyoffice/documentserver
+ set -e
+ . /usr/share/debconf/confmodule
+ [ ! 1 ]
+ [ -z ]
+ exec
+ [ ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ DIR=/var/www/onlyoffice/documentserver
@ShockwaveNN
ShockwaveNN / install-docker.sh
Last active November 11, 2024 11:51
Offline install for docker on Centos 7
#!/usr/bin/env bash
wget --content-disposition https://nct.onlyoffice.com/sh/Xsy # Hello world image
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-1.el7_6.noarch.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-19.03.5-3.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-19.03.5-3.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.3.ce-1.el7.noarch.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
sudo systemctl restart network # Just for test purposes
sudo rpm -i container-selinux-2.107-1.el7_6.noarch.rpm
@ShockwaveNN
ShockwaveNN / docserverrun
Last active November 21, 2020 08:14
Snippet for easy run of documentserver
#!/usr/bin/env ruby
require 'securerandom'
`docker ps --format '{{.Names}}' | grep "^DocumentServer" | awk '{print $1}' | xargs -I {} docker stop {}`
container_name = "DocumentServer#{SecureRandom.uuid}"
`docker run -itd -p 80:80 -v /usr/share/fonts:/usr/share/fonts/custom --name #{container_name} onlyoffice/4testing-documentserver-ee:#{ARGV[0]}`
sleep 90
`docker exec -it #{container_name} supervisorctl start all`
print "\a"
@ShockwaveNN
ShockwaveNN / fstab
Created January 16, 2019 18:46
mediaplayer /etc/fstab entry for share
//192.168.1.1/My_Book /media/routher_share cifs rw,username=guest,password=,noperm,iocharset=utf8,file_mode=0777,dir_mode=0777,vers=1.0 0 0