Create alias when tired of opening customer site in particular browser

Submitted by clemens on Thu, 2020年08月20日 - 12:27pm

For this to work you need to have your Drush aliasses configured

You also need the path to your Browser app.

alias customer_test_dir='cd path-to/customer_dir'
alias customer_test='customertest_dir ; open -a /Applications/Chromium.app `drush @tst uli --mail=clemens@build2be.nl --no-browser`'

What location aliasses are available for drush rsync

Submitted by clemens on Wed, 2015年05月20日 - 7:43pm

What are the values for drush rsync in %notation?


drush @site.prd php-eval "return _core_path_aliases()"
array(
'%root' => '/home/my-site',
'%site' => 'sites/default',
'%modules' => 'sites/all/modules',
'%themes' => 'sites/all/themes',
'%files' => 'sites/default/files',
'%private' => 'sites/default/files/private',
'%temp' => '/tmp',
)

fetch json and pretty print

Submitted by clemens on Mon, 2014年02月17日 - 3:54pm

While working on Deploy RestWS for D7 project issue JSON I needed a pretty print for the node.json and scanner done for Drush Issue Queue Commands Fix for the new json structure on d.o D7. Both issues as still open so help needed.

Doing some research I learned about the PHP context or more specific the HTTP stream context

Can you dig it. Drupal nested array that is.

Submitted by clemens on Fri, 2013年11月15日 - 12:14pm

I sometime need to check arrays for their values dispersed around. Just dumping the array is OK when interested in a particular key or value. But what about those big info arrays from hook_token_info, hook_menu etc. This is what I did.

Drush entity support (patch needs review)

Submitted by clemens on Mon, 2011年11月07日 - 9:44am
Can you tell the field display weights of all your entities with one command? Or edit a node through the command-line?
drush --yaml entity-type-read node --fields=**/display/**/weight --include-fieldapi
drush entity-update node 12 --json
Watch the video on http://www.youtube.com/watch?v=cVGZzWjdDh8 and get convinced you want to know more of these entity internals.

Upgrade from D6 in 7 steps? Hell no!!!

Submitted by clemens on Fri, 2011年07月22日 - 1:36pm
Sooo ... I've finally upgraded my own site. I thought it would be easy. A simple drupal site only using images. And yes I'm not reading READMEs that often. I trust drush somehow to handle this for me. But drush only sooth the 'pain'. This blog contains my bash script which does some staging from production onto my laptop where I update the site to the latest D6 then upgrade to D7. The script is generic enough to adapt for other upgrades.

How to get that site on localhost?

Submitted by clemens on Mon, 2011年05月23日 - 12:20pm

Make sure you have your drush aliases file setup properly. Below a snippet from my b2b.aliases.drushrc.php

$aliases['dev'] = array(
 'uri' => 'http://build2be.dev', 'root' => '/Users/clemens/Sites/build2be.dev/www/',
 'path-aliases' => array(
  '%dump-dir' => '/Users/clemens/Sites/build2be.dev/store',
  '%files' => '/Users/clemens/Sites/build2be.dev/www/sites/build2be.dev/files',
 ),
);

Now we can run

drush rsync @b2b.prd @b2b.dev

update module with a twist

Submitted by clemens on Tue, 2011年02月15日 - 11:46am

I just did an upgrade from the calendar and date module of which calendar needed to move from 6.x-2.x-dev to 6.x-2.4 version which seemed a pitb exercise. I hope I missed some skills :-p

The following command was not working

drush upc calendar-6.x-2.4

So what I did was download the latest version offsite. Then diff the module trees.

cd /tmp
drush dl calendar-6.x-2.4
cd /my-site/sites/all/modules/calendar
cp -r /tmp/calendar/* ./

free form:

Who is currently online

Submitted by clemens on Thu, 2011年01月13日 - 11:06am

I want to run svn up on the site but I need to offline it first. So who is online?

SELECT name, mail, (unix_timestamp()-access)/3600 AS hours
 FROM users
 HAVING hours < 1
 ORDER BY access;

Or for short

drush sql-query "select name, mail, (unix_timestamp()-access)/3600 as hours from users having hours < 1 order by access;"

Using cron to update a site and prepare the backup

Submitted by clemens on Fri, 2010年10月15日 - 8:49am

For a site on my VM I needed an svn sync and the backup files on my developer site.

I initially didn't want to install backup_migrate module. This was partly due to my arcane workflow which is of course by hand and unfamiliarity with back_migrate module.

So this is what I deviced

test_site@serverVM:~$ crontab -l
# m h dom mon dow  command
*/7 * * * * wget -O - -q -t 1 http://test-site.com/cron.php
*/5 * * * * /home/test_site/svn-up 2>&1 > /home/test_site/svn-up.log
* */1 * * * /home/test_site/ant-backup 2>&1 > /home/test_site/ant-backup.log

free form:

AltStyle によって変換されたページ (->オリジナル) /