Skip to content

Instantly share code, notes, and snippets.

@idimopoulos
idimopoulos / a2createsite
Last active January 25, 2022 17:17
a2createsite
#!/bin/bash
# ======= Variables ========
# Set the path to your localhost
CDPATH=/var/www/html/
apache_config=/etc/apache2/sites-available
host_name_suffix=test
# ======= /Variables ========
@idimopoulos
idimopoulos / mysql_create_user_db
Last active September 17, 2017 11:49 — forked from ainsofs/drupal mysql commands
Usefull scripts
#!/bin/bash
# Creates a database and a user and grants all previleges
# to the user. The name of the database, the user and the
# password are all passed as the first argument in the
# script.
# In order to run the script below, the root user must
# be able to login without password or the password
# must be set in the ~/.my.cnf file of the user that
@idimopoulos
idimopoulos / update_drupal_core.sh
Last active November 20, 2016 13:57
Update Drupal 7 core files without drush
#!/bin/bash
# Update Drupal core for an existing Drupal 7 installation.
# Change directory to the web root and run this through there.
# No root rights needed.
#
# From the update, 'sites' folder and '.htaccess' file are excluded.
#
# WARNING: There might be security updates to the .htacess file. Make sure that
# the security updates are merged in.
# For ubuntu 16.04, ppa:ondrej/php repository also includes openssl > 1.1.0 which is incompatible with virtuoso.
# To build virtuoso, version 1.0.2 is needed which exists in the default ubuntu repos.
# Remove the repo above with
# sudo add-apt-repository --remove ppa:ondrej/php
# and re install openssl 1.0.2. After the compilation of virtuoso, you can upgrade the openssl version without breaking
# Virtuoso.
sudo apt-get update
sudo apt-get install autoconf automake libtool flex bison gperf gawk m4 make openssl libssl-dev
sudo apt-get install git wget curl libreadline-dev
# Instructions to setup Hortonworks hadoop server and rstudio.
## Login as su
```
sudo su
```
## Setup java
<?php
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
/**
* Implements hook_permission().
*/
function payment_report_permission() {
return [