Skip to content

Instantly share code, notes, and snippets.

@ghazlewood
ghazlewood / cloudflare-DNS-bulk-update.sh
Created August 15, 2024 10:37 — forked from chuanliang/cloudflare-DNS-bulk-update.sh
A bash script to bulk change all IP addresses of A record in all domains in one cloudflare account
#!/bin/bash
old_ip="111.111.111.111"
new_ip="222.222.222.222"
email="my@cloudflare.com"
api_token="0123456789abcdefghijklmnopqrstuvwxyz1234"
zone_id_list=( $(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/?per_page=500" -H "X-Auth-Email: $email " -H "Authorization:Bearer $api_token " -H "Content-Type: application/json"| jq -r '.result[].id') )
for zone_id in "${zone_id_list[@]}"
@ghazlewood
ghazlewood / ZOE-Widget.js
Last active July 1, 2021 20:05 — forked from mountbatt/ZOE-Widget.js
Scriptable iOS widget that displays the status of your Renault ZOE on your iPhone and iPad.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: light-gray; icon-glyph: car;
// version 2021-02-10
// add your my-renault account data:
let myRenaultUser = "user" // email
let myRenaultPass = "pass" // password
// set your ZOE Model (Phase 1 or 2) // bitte eingeben!
@ghazlewood
ghazlewood / README.md
Last active March 13, 2019 13:51 — forked from ispiropoulos/shelly.py
Shelly Switch Home Assistant Component

Support for The Shelly Wifi switch.

Save the below file inside ".homeassistant/custom_components/shelly" as switch.py (create the folders if not present), create an empty init.py file in that folder too, and restart HASS.

usage example:

switch:
  - platform: shelly
 switches:
#!/bin/bash
#set -o verbose
#set -x
#set -v
#sed -e :a -e '$!N;s/ \n/,/;ta'
#start the file over and erase contents
echo '' > details.csv
#write the column headings
<?php
/**
* Add content type to the class of the row.
*/
function MODULE_preprocess_semanticviews_view_unformatted(&$vars, $hook) {
if ($hook == 'semanticviews_view_unformatted__package__node_content_1') {
// The index in the field array is the simple field name and is consistent
// across joins. e.g. when the field is 'type', the field alias could be
// 'node_node_data_field_package_content_type' if it's at the end of a