webmonkeying
Webmonkey notes - rails command not working after successful rails install
Saturday, 5 April 2014 @ 1:15pm
Latest ruby:
sudo brew update sudo brew install ruby
OSX developer command line tool thingies:
xcode-select --install
Read the EULA and agree if you agree.
Latest sass:
sudo gem install sass -V
Rails:
sudo gem install rails -V
Why yes I do like to see what’s going on.
Edit ~/.bash_profile to include:
export PATH=/usr/local/Cellar/ruby/2.1.1/bin:$PATH
so that the system doesn’t have a cry about Rails not being installed after it just told you it successfully installed it.
Drupal 7 notes - forms with file field reloading page without going through form validation
Tuesday, 11 March 2014 @ 1:09pm
I had a problem shortly after setting up ownCloud and Piwik where forms on all of the Drupal sites on my server mysteriously stopped working.
But not all of them, only the ones with a file field. When hitting the submit button on those forms (and it didn’t matter what the form was, the presence of a file field was enough) the form validate wouldn’t trigger, the page would simply reload.
Webmonkey notes setting ssl piwik and owncloud under subdomains linode
Monday, 3 March 2014 @ 10:28pm
As per usual part tutorial and mostly notes for me and anything with ridiculous names (e.g. username and domain) means replace with your information.
Ingredients 1 Linode (this one has my referral attached because I’m a bastard like that) or equivalent 1 copy of Piwik 1 copy of ownCloud Server (grab clients for your devices while you’re there if you like) 1-2 ssl certificates (depending on whether you can use wildcard certificates and are going to be running Piwik and ownCloud from the same domain, I like StartSSL but any certificate from anywhere will work) I downloaded Piwik directly to the Linode (saves two steps of downloading it and then uploading it, plus my upload speed is crap) and ownCloud conveniently has many packages.
Have you tried turning it off and then on again?
Thursday, 28 November 2013 @ 10:43pm
This morning, when I crawled out of bed and tackled the morning coffee sites to be followed by 3d work before our busy day commenced, I noticed that my server was slow.
There goes my 3d time again, sigh. Now I would have quickly investigated, if it hadn’t taken FOR FREAKING EVER to log into the server, and I had to leave before it had logged in, and unsurprisingly the pipe had broken and annoyingly the problem hadn’t resolved itself when I was able to tackle it again later in the day.
Drupal 7 install profile stuff that everyone else magically knows
Wednesday, 9 October 2013 @ 11:38pm
Seeing as I found little to nothing when searching for how to configure individual role permissions, editor settings and enabling contrib filters with an install profile, I made something on the off-chance it helps some other poor sap like me who doesn’t automagically know where to look for these things.
Enabling filters provided by contrib modules Search in the .module files for _filter_info. Some modules use the same format as Drupal filters of $filters['modulename_filter'], others don’t. Typogrify doesn’t:
Drupal 7 notes: node or page template by path
Tuesday, 5 February 2013 @ 6:55pm
Because I always seem to manage to completely forget how to do something this basic.
template.php in theme_preprocess_page(&$variables) or theme_preprocess_node(&$variables)
<?php $path = drupal_get_path_alias(); if (strpos($path, 'part_of_url') !== false) { $variables['theme_hook_suggestion'] = 'page__whatever'; // or node__whatever if using in a node preprocess } ?> This work has been marked as dedicated to the public domain
Drupal 7 upgrade from HELL
Monday, 17 December 2012 @ 8:41am
Modded to be slightly more useful as I wrote the other one while slightly delirious.
upgrade to latest D6 drush arb default --destination="wherever/you/like" mysql update systemsetstatus='0' where filename like 'sites%' delete 6.x, retain /files and /sites directories, remember any mods to .htaccess drop in 7.0 files drush updb if no error, press y if error occurs, make a note of what you need to do to fix it. If this is a repeat run, fix all errors noted rename/move your Drupal directory (or delete it but in the event you need it later) from above where the Drupal directory should be, drush arr [backup-filename-without-square-brackets].tar repeat from 3 til everything works drush up -y go do all the other little bits and pieces you need to do with the theme and modules Problems I hit managed file duplicates: mysql select * from `files` where `filepath` like `%string%'; delete from `files` where `fid`='number'; I only had a handful to deal with at any one time so didn’t mind doing them one by one, you’ll probably want a script if you have a lot :) comment stupidity: drop index comment_uid on comments; drop index last_comment_uid on node_comment_statistics; This work by ryivhnn is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License
Drupal notes: backup process with drush
Thursday, 27 September 2012 @ 11:11pm
There’s probably a script for this. Or maybe drush is the script. Is all good, some things are done much faster with commandline :)
drush vset maintenance_mode 1 drush cc all drush arb default --destination=../[site]-[date].tar And if there’s updates to be done:
drush up -y
At the end:
drush vset maintenance_mode 0
This work has been marked as dedicated to the public domain
Blog updates, or mile long sidebars
Monday, 3 September 2012 @ 1:04pm
I can’t even count in miles.
I was a touch concerned about adding anything else to the sidebar as it’s already quite long. Then I had a look at the sidebars some of my friends and other miscellaneous people have on their blogs and I don’t feel too bad adding a couple of blocks. Then of course there was a mental kerfuffle about folds and whether blocks should be above or below them. I eventually decided to keep “About” up the top as it summarises the silly blog, and drop everything else in under it.
Sharing is...
Saturday, 1 September 2012 @ 11:58pm
…privacy concerning if you’re one of those people that object to things like tracking you around the internet, and not a big deal if you’re not.
It bugs me a little bit (especially as I realised recently that I’d forgotten to mention tracking cookies and scripts etc that would have been coming from the share module I was using in my privacy thing) so in the event it bugs anyone who happens to drop by I’ve replaced the module I was using for sharing with [Social Share Privacy](Social Share Privacy). Anywhere you see +1/Like/Pin/Tweet/etc buttons on a website, it’s set scripts and cookies and things in your browser already (unless you have a Fortified Firefox). What this module does is load the button image for the socnet in question but doesn’t set the cookie or the scripts etc. Your first click will activate the button so it can plant its cookies and scripts and do its little tracking thing. Your second click will launch the sharing thing.