Posts

Showing posts from January, 2022

Necessary But Not Sufficient

A Sanity Factor or Sanity Check is something that is Necessary But Not Sufficient for something else. For example, money for happiness. After a certain point, it doesn't really help and will even harm. But it is required up to a point. It's surprising that this concept isn't more formally defined, since it's a very basic concept in a lot of situations. There's a book with the title - Necessary But Not Sufficient . But it's not clear if it's actually about this concept. Sanity Checks appear to be a programming concept . Perhaps that's why it's not more commonly defined. It's basically a check to see if the essentials are in place. Here's a great example how this is a key missing conceptual framework, when considering the correlation of IQ against various outcomes. Quoted: "It is quite plausible that one can obtain a university degree through conscientiousness despite modest cognitive aptitudes. There are many such ind

Change Transient Hostname

There are three 3 types of hostnames: static pretty transient   Check what your current hostname is: hostnamectl The transient hostname comes from the reverse DNS. To change: sudo reboot This should fix the name in Undelivered Mails : "This is the mail system at host xxx"

PayPal Checkout Setup

PayPal's original checkout customization can be hard to find because of the two different sets of UI - new and old. Here's the link to the original checkout setup page . The way to get there through the new UI is using the PayPal buttons link.

Drupal Commerce Update License

 <?   // update commerce_license set expires = expires + 15552000 where license_id =  2050; $license_id = 0; $expires = 0; $incr_ts = 0; if (isset( $_GET['license_id'])) $license_id = $_GET['license_id']; if (isset( $_GET['expires'])) $expires = $_GET['expires']; if (isset( $_GET['incr_ts'])) $incr_ts = $_GET['incr_ts']; $num_updated = 0; // To prevent accidental reruns if (($license_id > 0) && ($expires > 0)) {     $num_updated = db_update('commerce_license')     ->expression('expires', 'expires + :incr_ts', array(':incr_ts' => $incr_ts))     ->condition('license_id', $license_id)     ->condition('expires', $expires)     ->execute(); } else if (($license_id > 0) && ($expires == 0)) { $expires = db_select("commerce_license", "cl")   ->fields("cl", array("expires"))     ->condition('license_id', $

Drupal Delete Spam Accounts

 <? // Since when did mysql start supporting subqueries $result = db_query('select uid from users where uid not in ( 7077,8842,8304,8558,3975,5756 ) and uid not in ( select distinct uid from node ) and uid not in ( select distinct uid from comment ) and uid not in ( select distinct uid from users where picture > 0 ) and uid not in ( select distinct uid from profile_value ) and uid not in ( select distinct uid from commerce_order ) and uid not in ( select distinct entity_id from field_data_field_stock_watchlist )'); foreach ($result as $record)    if ($record->uid > 6) user_delete($record->uid); ?>