Skip to content

Instantly share code, notes, and snippets.

View keopx's full-sized avatar

Ruben Egiguren keopx

View GitHub Profile
@keopx
keopx / fstrim.sh
Last active October 16, 2015 12:15
System fstrim
#/bin/bash
sudo fstrim -v /boot
sudo fstrim -v /
## See: http://www.muylinux.com/2015/10/08/ssdcrontrim-unidades-ssd
## See: http://chmatse.github.io/SSDcronTRIM/
## See: http://blog.neutrino.es/es/2013/howto-properly-activate-trim-for-your-ssd-on-linux-fstrim-lvm-and-dmcrypt/
@keopx
keopx / Check_connections.sh
Created October 15, 2015 13:32
Check connections
netstat -alpn | grep :80 | awk '{print $5}' |awk -F: '{print $(NF-1)}' |sort | uniq -c | sort -nr

Download DrupalConsole

curl -LSs http://drupalconsole.com/installer | php

Make DrupalConsole globaly accesible

mv console.phar /usr/local/bin/drupal
@keopx
keopx / ajax_call.js
Created September 24, 2015 12:39
Drupal ajax call with values
function get_data_info() {
jQuery.ajax({
url: 'mymodule/api/data',
type: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
dataType: "json",
data: {
'data': data
@keopx
keopx / install_mysql.sh
Last active September 15, 2015 17:34 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@keopx
keopx / mysql_optimize_tables.sh
Created September 11, 2015 12:39
MySQL OPTIMIZE all tables
mysqlcheck -o --all-databases
mysqlcheck -u [username] -p[password] -o [database name]
@keopx
keopx / install_package.sh
Last active August 26, 2015 11:58
Image optimization for web
sudo apt-get install libjpeg-progs pngcrush
@keopx
keopx / mymodule.php
Last active August 29, 2015 14:27 — forked from juampynr/mymodule.php
Database update with Batch API template
<?php
/**
* @file mymodule.install
* Install hooks for mymodule.
*/
/**
* Description of what the database update does. Do not use "Implements..." since it adds
* zero information and makes reading the list of pending database updates in Drush harder
* to read.
@keopx
keopx / symfony-drupal.md
Last active August 29, 2015 14:27 — forked from jmolivas/symfony-drupal.md
Drupal related tools based on modern PHP development and Symfony components
@keopx
keopx / import_gzip_drush.sh
Created July 16, 2015 18:36
Import gzipped sql using Drush
gunzip -c database.sql.gz | drush sqlc