Skip to content

Instantly share code, notes, and snippets.

@cmilanf
cmilanf / gandi_script_mikrotik.rsc
Last active February 15, 2024 04:12
Mikrotik RouterOS GANDI dynamic DNS update script
# ----- Gandi.net LiveDNS dynamic DNS multi domain and subdomain write by Massimo Ciani ------
# Put the following script on "system script" as new script with policy "read, write, test" and name "LiveDNS_DDNS".
# If you use pppoe connection, go to ppp profile and click the profile that pppoe use. In the field "on up" put this
# line "/system script run LiveDNS_DDNS". without quotes.
#--------------- Change Values in this section to match your setup ------------------
# Your LiveDNS API KEY
:local apikey "your API KEY"
# Set the domain and subdomain to be updated.
@Mygod
Mygod / export-ble-infos.py
Last active April 22, 2024 17:14
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Copyright 2021 Mygod
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@Berdir
Berdir / gist:3bfdb91e664e325004ba
Created April 30, 2015 09:43
Update redirect source fields
/**
* Update the {redirect} table.
*/
function np8_update_update_8004() {
// Drop the title column.
if (db_field_exists('redirect', 'redirect_source__title')) {
db_drop_field('redirect', 'redirect_source__title');
}
// We assume there are no options stored and just rename it to query.
if (db_field_exists('redirect', 'redirect_source__uri')) {
@davereid
davereid / custom_local.drush.inc
Created July 24, 2012 16:40
Helpful local Drush commands
<?php
/**
* Implements hook_drush_command().
*/
function custom_local_drush_command() {
$items['files-fix-permissions'] = array(
'description' => 'Fix file permissions',
'options' => array(
'owner' => "The name of the user to assign ownership of all files with chown(). Defaults to \$USER.",
@davereid
davereid / custom.admin_menu.inc
Last active September 29, 2015 07:18
Useful D7 custom functions
<?php
/**
* @file
* Administration menu integration for the custom module.
*/
/**
* Implements hook_admin_menu_cache_info().
*/