Skip to content

Instantly share code, notes, and snippets.

View flusher's full-sized avatar

Florian Cathala flusher

View GitHub Profile
@flusher
flusher / mount_partition_from_block_image.txt
Created February 10, 2023 09:51
Mount a partition from a block dd-generated disk image
losetup --partscan --find --show disk.img
mount /dev/loop0p1 /mnt
@flusher
flusher / absolute_to_relative_menu_items.sql
Created April 18, 2023 14:03
Massively convert absolute links to relative links with in menu items in Drupal 8+ (SQL)
UPDATE menu_link_content_data SET rediscover=1,changed=unix_timestamp(),link__uri = REPLACE(link__uri, 'https://www.example.com', 'internal:');
UPDATE menu_link_content_field_revision SET changed=unix_timestamp(),link__uri = REPLACE(link__uri, 'https://www.example.com', 'internal:');
# /!\ Do not forget to clear cache (drush cr) !