Skip to content

Instantly share code, notes, and snippets.

@spolischook
Last active July 20, 2020 08:37
Show Gist options
  • Save spolischook/f829b47dc69b3a46a66af670e7bb242e to your computer and use it in GitHub Desktop.
Save spolischook/f829b47dc69b3a46a66af670e7bb242e to your computer and use it in GitHub Desktop.
#!/bin/bash
apt update
apt upgrade
# setup apple keyboard
echo 2 > /sys/module/hid_apple/parameters/fnmode
echo "options hid_apple fnmode=2" >> /etc/modprobe.d/hid_apple.conf
update-initramfs -u -k all
# install packages
apt install -y zsh vim git curl wget nginx mysql-server htop ncdu tree \
git-gui pavucontrol chromium-browser clipit gimp shutter guake cups sqlitebrowser arandr moc phatch gdisk libreoffice \
calibre filezilla libnotify-bin
# patch phatch O_o)))
sudo sed -i "s/tostring/tobytes/g" "/usr/share/phatch/phatch/lib/pyWx/wxPil.py"
sudo sed -i "s/fromstring/frombytes/g" "/usr/share/phatch/phatch/lib/pyWx/wxPil.py"
# add php 7.4
add-apt-repository -y ppa:ondrej/php
apt-get update
apt install -y php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-fpm php7.4-gd php7.4-imap php7.4-bcmath \
php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-bz2 \
php7.4-pgsql php7.4-soap php7.4-sqlite3 php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-xsl php7.4-zip
apt remove -y abiword abiword-common
# install viber
curl http://download.cdn.viber.com/cdn/desktop/Linux/viber.deb -o /tmp/viber.deb
sudo apt install gstreamer1.0-pulseaudio
sudo dpkg -i /tmp/viber.deb
sed -i -e 's/^;date.timezone.*$/date.timezone = Europe\/Kiev/g' /etc/php/7.4/cli/php.ini
sed -i -e 's/^max_execution_time =.*$/max_execution_time = 500/g' /etc/php/7.4/cli/php.ini
sed -i -e 's/^max_input_time =.*$/max_input_time = 500/g' /etc/php/7.4/cli/php.ini
sed -i -e 's/^error_reporting =.*$/error_reporting = E_ALL/g' /etc/php/7.4/cli/php.ini
sed -i -e 's/^;date.timezone.*$/date.timezone = Europe\/Kiev/g' /etc/php/7.4/fpm/php.ini
sed -i -e 's/^max_execution_time =.*$/max_execution_time = 500/g' /etc/php/7.4/fpm/php.ini
sed -i -e 's/^max_input_time =.*$/max_input_time = 500/g' /etc/php/7.4/fpm/php.ini
sed -i -e 's/^error_reporting =.*$/error_reporting = E_ALL/g' /etc/php/7.4/fpm/php.ini
sudo pecl install xdebug
XDEBUG_SO=$(find / -name 'xdebug.so' 2> /dev/null |head -n 1)
for PHP_INI in $(locate php.ini|grep /etc/php)
do
echo ";xDebug Configuration starts" >> ${PHP_INI};
echo "; zend_extension=${XDEBUG_SO}" >> ${PHP_INI};
cat >> ${PHP_INI} <<'endmsg'
xdebug.max_nesting_level=250
xdebug.var_display_max_depth=10
xdebug.remote_enable=true
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=127.0.0.1
xdebug.idekey=phpstorm-xdebug
xdebug.remote_autostart=1
;xDebug Configuration ends
endmsg
done
mysql_secure_installation
# Java8 install
add-apt-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
# nginx sites enabled
rm -rf /etc/nginx/sites-enabled && sudo ln -s /home/spolischook/.sites-enabled /etc/nginx/sites-enabled
service nginx reload
echo "
127.0.0.1 e.local
" >> /etc/hosts
sed -i -e 's/^user = .*$/user = spolischook/g' /etc/php/7.4/fpm/pool.d/www.conf
sed -i -e 's/^group = .*$/group = spolischook/g' /etc/php/7.4/fpm/pool.d/www.conf
systemctl restart php7.4-fpm.service
# Added key for skype
curl https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -
curl https://repo.skype.com/latest/skypeforlinux-64.deb -o /tmp/skype.deb
sudo dpkg -i /tmp/skype.deb
# Install SublimeText3
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
# Install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment