Skip to content

Instantly share code, notes, and snippets.

View viswanathsai's full-sized avatar

Sai Viswanath viswanathsai

View GitHub Profile
@viswanathsai
viswanathsai / gist:6d4d212a3867c01206a728ff7e4bf2d7
Created February 21, 2019 05:10 — forked from yuezhu/gist:47b15b4b8e944221861ccf7d7f5868f5
Generate self-signed certificate for HAProxy
# Generate a unique private key (KEY)
sudo openssl genrsa -out mydomain.key 2048
# Generating a Certificate Signing Request (CSR)
sudo openssl req -new -key mydomain.key -out mydomain.csr
# Creating a Self-Signed Certificate (CRT)
openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt
# Append KEY and CRT to mydomain.pem
@viswanathsai
viswanathsai / fieldautovalue.module
Last active December 6, 2017 07:28 — forked from jonhattan/fieldautovalue.module
Hide a field in node edit form and provide its value programatically.
<?php
/**
* Implements hook_form_FORM_ID_alter() for node type 'test'.
*
* Hide field_texto.
*/
function fieldautovalue_form_test_node_form_alter(&$form) {
$form['field_texto']['#access'] = FALSE;
}