Skip to content

Instantly share code, notes, and snippets.

View hannesbe's full-sized avatar
🏠
Working from home

Hannes Van de Vel hannesbe

🏠
Working from home
View GitHub Profile
@hannesbe
hannesbe / hass-poc-configurator-upgrade.sh
Last active February 13, 2018 07:53
Very basic update script for the Home Assistant Configuration UI (https://github.com/danielperna84/hass-configurator)
cd /home/homeassistant/.homeassistant
sudo mv configurator.py configurator.py-bak-$(date +%F-%T)
sudo wget https://raw.githubusercontent.com/danielperna84/hass-configurator/master/configurator.py
sudo wget -o settings.conf-dist https://raw.githubusercontent.com/danielperna84/hass-configurator/master/settings.conf
sudo chmod +x configurator.py
sudo chown homeassistant:homeassistant -R /home/homeassistant/.homeassistant
sudo systemctl restart [email protected]
@hannesbe
hannesbe / install-xau-zerotier.sh
Created January 23, 2018 04:58
Install Zerotier & join Xaurum network
sudo curl -s 'https://pgp.mit.edu/pks/lookup?op=get&search=0x1657198823E52A61' | gpg --import && \
if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
sudo zerotier-cli join a09acf02330557ac
@hannesbe
hannesbe / magento1-upgrade.sh
Last active December 10, 2017 02:44
Upgrade Magento 1.x to the latest version
sudo -u kayb-live n98-magerun.phar sys:maintenance
sudo -u kayb-live n98-magerun.phar cache:disable
sudo -u kayb-live mv magmi ../private
sudo -u kayb-live sed -i 's/#MAGE_PHP_BIN="php"/MAGE_PHP_BIN="\/opt\/plesk\/php\/5.6\/bin\/php"/g' ./mage
sudo -u kayb-live chmod +x ./mage
sudo -u kayb-live ./mage mage-setup .
sudo -u kayb-live ./mage config-set preferred_state stable
sudo -u kayb-live ./mage sync
sudo -u kayb-live ./mage install connect20.magentocommerce.com/community Mage_All_Latest --force
sudo -u kayb-live n98-magerun.phar index:reindex:all
@hannesbe
hannesbe / hass-upgrade.sh
Created December 4, 2017 06:00
Upgrade Home Assistant in virtualenv
function hass-upgrade {
echo "Stopping homeassistant"
sudo systemctl stop [email protected]
sudo -u homeassistant -H /bin/bash <<EOF
echo "Activating virtualenv"
source /srv/homeassistant/bin/activate
@hannesbe
hannesbe / reboot-into-windows.desktop
Created October 25, 2017 02:05
Update GRUB to reboot into Windows once
#!/usr/bin/env xdg-open
#
# save as ~/Desktop/reboot-into-windows.desktop
#
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=sh -c 'gksu "sudo grub-reboot 'osprober-efi-4C8A-18B4'" && gnome-session-save --shutdown-dialog'
@hannesbe
hannesbe / letsencrypt-rpi.sh
Created September 22, 2017 14:01
Let's Encrypt certbot Raspberry Pi
mkdir certbot
cd certbot
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
./certbot-auto certonly --standalone --standalone-supported-challenges http-01 --email [email protected] -d public.tower112.islet.be
@hannesbe
hannesbe / install-zerotier-connexeon.sh
Last active July 15, 2018 23:33
Install Zerotier & join Connexeon network
curl -s https://install.zerotier.com/ | sudo bash
sudo zerotier-cli join 17d709436cf4a2e0
@hannesbe
hannesbe / install-certificate-multidomain-snowplaza-2016.sh
Created August 9, 2017 11:58
Install multidomain certificate Spalder
#!/usr/bin/env bash
certname="snowplaza-multidomain-2016"
download="https://c.connexeon.com/s/JEEkVryAM0JC1JG/download"
apt-get install unzip
rm -f $certname.zip
rm -rf $certname/
wget $download
mv download $certname.zip
@hannesbe
hannesbe / Install.md
Created June 24, 2017 20:12 — forked from zhiephie/Install.md
Installing nginx, php7-fpm with opcache, memcached, phpredis and xdebug extension on Centos 7

run ./setup.sh

Install Nginx

# yum repository  
$ vim /etc/yum.repos.d/nginx.repo
  [nginx]
  name=nginx repo
  baseurl=http://nginx.org/packages/centos/7/$basearch/
 gpgcheck=0
@hannesbe
hannesbe / Reset-LXSSUserPwd.ps1
Created June 13, 2017 14:23
Resets the password for the default LXSS / WSL bash user
# Resets the password for the default LXSS / WSL bash user
$lxssUsername = (Get-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss).DefaultUsername
lxrun /setdefaultuser root
bash -c "passwd $lxssUsername"
lxrun /setdefaultuser $lxssUsername