Skip to content

Instantly share code, notes, and snippets.

yan-foto / 0-README.txt
Last active Feb 17, 2021
DeDRM Adobe Digital Edition Books
View 0-README.txt
Convenient DeDRM Scripts
**NOTE**: read to find out what this gist is good for.
* ./ extracts Adobe Digital Editions private key and required files to DeDRM.
* ./dedrm: removes DRM from given ebook (pdf/epub)
If you are using this for the first time, make sure that you have authenticated your Adobe Digital Editions (ADE) and run './'. Import any DRM-protected file into ADE and run '':
yan-foto /
Last active Dec 25, 2020
Migrating managed Wordpress instances to NGINX + PHP-FPM
set -euo pipefail
err() {
>&2 echo "$1"
exit 1
main() {
yan-foto /
Created Apr 23, 2018
Delete all git tags (remote and local) older than a given date [Linux/MacOS]
# Make sure date is given
if [ $# -eq 0 ]
printf "Usage:\n bash 2018-04-23"
exit 1
# date command has different syntax for Linux and Mac
yan-foto / OpenWRT | OpenVPN | PIA -
Last active Jan 5, 2020
OpenWRT configurations to run OpenVPN client | Private Internet Access -
View OpenWRT | OpenVPN | PIA -

This gist contains all the OpenWRT configuraion files needed to connect to Private Internet Access (PIA) VPN servers. The following files are included:

  • network: contains configuration to add a virtual network device (i.e. tun1366) and custom DNS servers
  • openvpn: OpenVPN configuration file to connect to PIA VPN servers
  • firewall: firewall configuration which passes all traffic through VPN and rejects any request when OpenVPN is down

NOTE: there are a number of other files required to be available under /etc/openvpn for this approach to work:

  • pia.auth: VPN credentials in two lines, first the username and the second the password
yan-foto /
Created Sep 19, 2015
Vagrant shell provision to solve `No X-Jenkins-CLI2-Port` (Ubuntu guest)
# This is a simple example of a shell script which is used as a Vagrant provision
# It can be used as: 'config.vm.provision "shell", path: "./"'
# inside a Vagrantfile.
# The logic is simple and the implementation as well. Any suggestions/improvements
# are highly welcome.
# Default values
yan-foto / logger.js
Last active Aug 29, 2015
Simple JavaScript logger with log level and (graceful) fallback
View logger.js
Logger = function(level) {
this.level = level || 0;
methods = ["trace", "debug", "info", "warn", "error"];
levels = {};
this.log = function() {
(console.log === undefined) ? function() {} : console.log.apply(console, arguments);