Skip to content

Instantly share code, notes, and snippets.

[error] Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'field_job_location_country_code' at row 1: INSERT INTO {node__field_job_location} (entity_id, revision_id, bundle, delta, langcode, field_job_location_langcode, field_job_location_country_code, field_job_location_administrative_area, field_job_location_locality, field_job_location_dependent_locality, field_job_location_postal_code, field_job_location_sorting_code, field_job_location_address_line1, field_job_location_address_line2, field_job_location_organization, field_job_location_given_name, field_job_location_additional_name, field_job_location_family_name) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11,
https://forums.docker.com/t/docker-installation-on-ubuntu-in-virtualbox-cannot-pull-images/20268
It was a simple issue, undoubtedly documented somewhere but I missed it. I post an answer here in case someone else has the same.
The virtualbox os (ubuntu in my case) has to have a NAT network adapter and the NAT adapter has to have higher priority than a bridge adapter (if you have one). You don’t need a bridged adapter to run docker (but if you want the virtualbox to have an ip on your local network then you do need to add a bridged adapter.)
VirtualBox configuration examples that work to run docker:
VBox Adapter 1: NAT (eth0)
VBox Adapter 1: NAT (eth0), VBox Adapter 2: Bridged Adapter (eth1)
@jaryroxas
jaryroxas / gulp.js
Last active April 13, 2020 12:35
new gulp task
'use strict';
const { series, src, dest, watch } = require('gulp');
const sass = require('gulp-sass');
sass.compiler = require('node-sass');
function css() {
return src('./sass/**/*.scss', { sourcemaps: true })
.pipe(sass().on('error', sass.logError))
.pipe(dest('./css', { sourcemaps: '.' }));
@jaryroxas
jaryroxas / sample-pluginc.php
Created March 4, 2019 23:29
Sample Code - Simple plugin for drupal 8
<?php
/**
* Next service controller.
*/
namespace Drupal\next_service\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Class NsController.
*/
@jaryroxas
jaryroxas / sample-pluginb.php
Created March 4, 2019 23:28
Sample Code - wordpress plugin for event registration
<?php
/**
* Class to handle all database actions.
*/
class EventRegisterAPI {
protected $event_id;
public $wpdb;
public function __construct( int $event_id, $user_info ) {
@jaryroxas
jaryroxas / sample-plugin.php
Created March 4, 2019 23:24
Sample Code - Podio integration wordpress plugin
defined( 'ABSPATH' ) or die( 'outside script disabled' );
/**
* Podio integration details.
*/
define('PODIO_APP_ID','18713618');
@jaryroxas
jaryroxas / gist:2c8a1f7be45e913ebba5b8c062562530
Created November 25, 2018 09:33
Install winpty to cygwin
https://github.com/rprichard/winpty/releases/download/0.4.0/winpty-0.4.0-cygwin-2.5.2-x64.tar.gz ( save this )
copy wintpy.dll, winpty.exe, winpty-agent to /user/local/bin
##### Service
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable()
export class UserService {
constructor(private httpClient: HttpClient) { }
@jaryroxas
jaryroxas / drupal7-services3-upload-files-images.php
Created September 6, 2017 06:48 — forked from MuhammadReda/drupal7-services3-upload-files-images.php
Drupal 7 and Services 3 - How to Upload file / image
<?php
/**
* This is a code sample for how to upload file to drupal services.
*
* This code sample focuses on uploading files and assumes that you are successfully autheticated.
*/
$httpMethod = 'POST';
$resourceUrl = 'http://example.com/api/file';
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>