Skip to content

Instantly share code, notes, and snippets.

@maesitos
maesitos / DDNS_linode.rb
Created August 19, 2016 20:01
Stupid and simple Dynamic DNS script based on Linode
require 'open-uri'
require 'json'
require 'net/http'
API_KEY = "YOUR API KEY HERE"
DOMAINID = "Your DomainID"
RESOURCEID = "The AAA resource ID already created in the DNS dashboard"
TARGET = "[remote_addr]" # Drop the brackets when using literal IPs. With [remote_addr] Linode will use the IP from where the request is received
# Uncomment this line if the SSL certificate is complaining. Disclosure:This is not a safe method
@maesitos
maesitos / gist:c0239c06cd3bf5cbf6bf7c9cf686e668
Created December 31, 2016 10:56 — forked from 13k/gist:3086739
Capybara in Rails Console
# rails console test
# # or
# RAILS_ENV=test rails console
require 'capybara/dsl'
Capybara.app = app.instance_variable_get("@app")
cap = Object.new.instance_eval { extend Capybara::DSL; self }
# cap.visit '/'
# cap.page.find 'h1'
@maesitos
maesitos / gist:2b487af512e2c17607d53066bccfcd2b
Last active September 8, 2022 20:29
Back-up routine for backing up git into synology
# !/bin/bash
# Put here all the repos you want to back up
declare -a repositories=("repo_name")
# Path to repos
repo_path=/volume1/git/
for repo in "${repositories[@]}"; do