Skip to content

Instantly share code, notes, and snippets.

View geraldvillorente's full-sized avatar

Stoick The Vast geraldvillorente

  • Philippines
View GitHub Profile
@geraldvillorente
geraldvillorente / migration.md
Last active March 7, 2018 03:12
External to Pantheon Drupal 7 and 8 Migration

Drupal Migration (External to Pantheon)

Drupal 7

Step 1: Click Migrate Existing Site

Step 2: Specify the existing URL and choose existing site CMS

Step 3: Create a tar (of the site you want to migrate). SSH to your site server and run this command.

drush ard --destination=sites/default/files/P0zG8ohjLKFBI6Y.tgz
@geraldvillorente
geraldvillorente / migration.md
Last active August 16, 2018 19:38
Pantheon to Pantheon Drupal 7 and 8 Migration

Drupal Migration (Pantheon to Pantheon)

Drupal 7

Step 1: Click Migrate Existing Site

Step 2: Specify the existing URL and choose existing site CMS

Step 3: Create a tar (of the site you want to migrate):

terminus drush gv-d7-learning-site.dev -- ard --destination=sites/default/files/P0zG8ohjLKFBI6Y.tgz
@geraldvillorente
geraldvillorente / solr.md
Last active March 5, 2018 04:30
Indexing Solr via Terminus and Drush

Example on how to run Solr indexing via Terminus and Drush on Pantheon platform.

Index a total of 200 items in batches of 50 on LIVE environment index-id 40 ("All Search Content"):

terminus remote:drush site.live -- search-api-index 40 200 50

Where:

  • 40 - is the index-id
  • 200 - is the total number of content to index
@geraldvillorente
geraldvillorente / test.md
Last active January 14, 2018 12:39
FB PHP
$fb = new \Facebook\Facebook([
        'app_id' => 'xxx',
        'app_secret' => 'xxx',
        'default_access_token' => 'xxx',
        'default_graph_version' => 'v2.11',
]);

try {
 $response = $fb->post(
@geraldvillorente
geraldvillorente / redis.md
Last active January 11, 2018 02:05
Redis useful commands

info commandstats - collect throughput metric values for all the commands run on the Redis server

info memory - collect all memory utilization metrics data for a Redis instance

Memory RSS (Resident Set Size) is the number of bytes that the operating system 
has allocated to Redis. If the ratio of ‘memory_rss’ to ‘memory_used’ is greater 
than ~1.5, then it signifies memory fragmentation. The fragmented memory can be 
recovered by restarting the server.
$modules = array();
$status = array('rc', 'dev', 'alpha', 'beta',);
foreach (system_rebuild_module_data() as $module) {
// We deal only with enabled modules.
if ($module->status != 1) {
continue;
}
// We deal only with contrib modules.
@geraldvillorente
geraldvillorente / snippet.md
Created October 26, 2017 04:59
Refresh local database from backup in Drupal using Drush.
drush sql-drop -y && gunzip -c /path/to/file.sql.gz | drush sqlc
@geraldvillorente
geraldvillorente / synergy.md
Created October 11, 2017 15:55
How to launch Synergy from a remote machine via SSH?

ssh -X remote_user@remote_host synergy &

Check /etc/ssh/sshd_config on the server side:

sudo nano /etc/ssh/sshd_config

Set the config the same as lines below:

@geraldvillorente
geraldvillorente / code.md
Created September 11, 2017 03:43
How to find connected WIFI password?

Supposed that you are connected to a wifi network but you don't the password is.

In Ubuntu just navigate to:

$ cd /etc/NetworkManager/system-connections/

And find sa SSID that you want to view the password.

@geraldvillorente
geraldvillorente / code.md
Created September 11, 2017 03:34
How to connect to wifi network via Ubuntu commandline.

To see list of saved connections:

$ nmcli c

To see list of available WiFi

nmcli d wifi list