Skip to content

Instantly share code, notes, and snippets.

@liamcmitchell
liamcmitchell / local_dns.txt
Last active November 16, 2021 18:45
Minimum configuration for a local DNS server to handle the top level domain [dev]
# Install bind.
sudo apt-get install bind9
# Add DNS servers to forward unknown queries to.
# These could be your router, ISP or other public DNS servers.
# /etc/bind/named.conf.options
forwarders {
8.8.8.8;
@liamcmitchell
liamcmitchell / remove-prefix.php
Created January 2, 2013 07:46
Drush script to remove table aliases from a Drupal 6 site. Usage: drush php-script remove-prefix.php [pretend]
<?php
/**
* Drush script to remove table aliases from a Drupal 6 site.
* Usage:
* drush php-script remove-prefix.php [pretend]
*/
$arg = drush_shift();
$pretend = $arg == 'pretend' ? TRUE : FALSE;
@liamcmitchell
liamcmitchell / repair-files-table.php
Last active December 12, 2015 02:08
Drush script to repair a Drupal 6 files table that has mixed file directory paths. This usually happens when the files dir is never set and the site is moved or access from more than one path via symlinks. Do not use if the files are actually in mixed directories. Usage: drush php-script repair-files-table.php
#!/usr/bin/env drush
<?php
// Check site is bootstrapped
$self_record = drush_sitealias_get_record('@self');
if (!empty($self_record)) {
$count = 0;
$regex = '|^sites/(.*)/files|';
$files_dir = file_directory_path();
# Card model
App.Models.Card = Backbone.Model.extend(
urlRoot: "/cards"
defaults: ->
revisions: 0
initialize: ->
@kanji = @get("kanji")