Skip to content

Instantly share code, notes, and snippets.

@xezpeleta
xezpeleta / gist:93abfabfc2e9163202b50b2f4cb728ff
Created May 30, 2017 10:16 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>

Keybase proof

I hereby claim:

  • I am xezpeleta on github.
  • I am xezpeleta (https://keybase.io/xezpeleta) on keybase.
  • I have a public key whose fingerprint is D700 BAE6 3388 E984 9736 D5E9 5587 BA86 CB39 64F9

To claim this, I am signing this object:

@xezpeleta
xezpeleta / bash-on-windows.ps1
Last active December 1, 2016 15:13
Bash on Windows powershell script (work in progress)
# =====================================================================
# Bash on Windows installator
# @author: Xabi Ezpeleta <[email protected]>
# References:
# - https://msdn.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development#use-group-policies-or-registry-keys-to-enable-a-device
# - https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
# =====================================================================
# Enable Developer Mode
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
@xezpeleta
xezpeleta / bash-on-windows-uninstall.bat
Last active December 1, 2016 16:11
Bash on Windows installer script (work in progress)
REM Uninstall Bash on Windows
lxrun /uninstall /full /y
REM TODO: Disable WSL feature
REM TODO: Disable Developer Mode
REM debugging-pause
pause
@xezpeleta
xezpeleta / reboot-when-required
Last active May 29, 2017 12:21
Ubuntu server: reboot on "system restart required" with CRON
#! /bin/sh -e
#
# File: /etc/cron.daily/reboot-when-required
# Description: reboots the machine if its required
if [ -f /var/run/reboot-required ]; then
shutdown -r +5 "Reboot required. System will be restarted in 5min."
fi
#! /bin/bash -e
#
# Usage:
# ./eb-installer.sh [OPTIONS]
# [-f customconfigfile] [-h dbhost] [-u dbuser]
# [-U dbadminuser] [-p dbpass] [-P dbadminpass]
# [-n dbname] [-v version] [-y] [-d] [-I]
# Config
#! /bin/sh
##
# update-drupal.sh It will update your Drupal installation using the utility Drush http://www.drush.org
# To keep your Drupal updated, you can copy this script into your /etc/cron.daily directory
# Don't forget to add execution right and remove ".sh" extension from the filename.
##
cd /var/www/mydrupalsite
drush up -y
@xezpeleta
xezpeleta / mantis-users-survey.php
Last active November 4, 2015 11:54
It sends a satisfaction survey to the Mantis user when the bug is closed
#! /usr/bin/php
<?php
##
# mantis-users-survey.php: Asebetetze inkestaren esteka bidaltzen zaio erabiltzaileari, bere matxura
# itxi ostean. Horretarako, script hau egunero exekutatu behar da CRON bitartez.
# Adibidez:
# 55 23 * * * /root/scripts/mantis-users-survey.php >> /root/scripts/mantis-survey.log
##
@xezpeleta
xezpeleta / update-wordpress.sh
Last active April 29, 2016 11:07
Keep your WordPress installations updated
#! /bin/sh
##
# update-wordpress.sh It will update your WordPress installation using the utility wp-cli http://wp-cli.org
# To keep your WP updated, you can copy this script into your /etc/cron.daily directory
# Don't forget to add execution right and remove ".sh" extension from the filename.
##
WPDIR=/var/www/myblog
@xezpeleta
xezpeleta / add_ga_code.py
Last active November 3, 2015 08:34
Set up Google Analytics web tracking code
#! /usr/bin/python
'''
Python script to set up GA web tracking code, usually in static web files (in PHP files, you can use a simple 'include' or 'require_once').
add_ga_code.py <file> <track-id>
Example: add_ga_code.py /var/www/index.html UA-557744-10
To add the tracking code in multiple files, use a oneliner. Example: