Skip to content

Instantly share code, notes, and snippets.

View alekstrust's full-sized avatar

Javier Távara alekstrust

View GitHub Profile
@alekstrust
alekstrust / mem.sh
Created October 3, 2016 16:34 — forked from sayem314/mem.sh
processs memory check on linux
#!/bin/bash
ps -C $1 -O rss | awk '{ count ++; sum += $2 }; END {count --; print "Number of processes =",count; print "Memory usage per process =",sum/1024/count, "MB"; print "Total memory usage =", sum/1024, "MB" ;};'
@alekstrust
alekstrust / confluence-to-gdrive.sh
Last active August 26, 2017 03:01
Confluence to Google Drive
#!/bin/bash
# This is a script to take a MySQL dump and upload to Google Drive.
# Uses gdrive https://github.com/prasmussen/gdrive. See the gdrive readme first.
# The path to the gdrive binary
GDRIVE_BIN=/usr/sbin/gdrive
# Use "gdrive list" to get the id of the directory where you want to upload the files
BACKUP_DRIVE_DIR=
sudo sysctl -w net.inet.ip.forwarding=1
sudo sysctl -w net.inet.ip.fw.enable=1
-- delete any usermeta specific to the other subsites
delete from wp_usermeta where meta_key regexp '^wp_([0-9]+)_';
-- duplicate the wp_usermeta structure in a working data table,
-- but add a unique index for filtering out duplicates
create table _fix_usermeta like wp_usermeta;
-- fix to allow larger keys on InnoDB
set global innodb_large_prefix = 1;
set global innodb_file_format = BARRACUDA;
alter table _fix_usermeta ENGINE=InnoDB;
@alekstrust
alekstrust / wp-clearfy-options.json
Last active July 29, 2018 13:14
Wordpress Clearfy extension best configuration.
{"wbcr_clearfy_attachment_pages_redirect":"0","wbcr_clearfy_attachment_pages_redirect_is_active":"1","wbcr_clearfy_change_login_errors":"1","wbcr_clearfy_comment_text_convert_links_pseudo":"1","wbcr_clearfy_comment_text_convert_links_pseudo_is_active":"1","wbcr_clearfy_content_image_auto_alt":"0","wbcr_clearfy_content_image_auto_alt_is_active":"1","wbcr_clearfy_disable_admin_bar":"enable","wbcr_clearfy_disable_admin_bar_is_active":"1","wbcr_clearfy_disable_admin_bar_logo":"1","wbcr_clearfy_disable_admin_bar_logo_is_active":"1","wbcr_clearfy_disable_admin_notices":"0","wbcr_clearfy_disable_admin_notices_is_active":"1","wbcr_clearfy_disable_auto_correct_dangit":"0","wbcr_clearfy_disable_auto_correct_dangit_is_active":"1","wbcr_clearfy_disable_auto_paragraph":"0","wbcr_clearfy_disable_auto_paragraph_is_active":"1","wbcr_clearfy_disable_embeds":"0","wbcr_clearfy_disable_embeds_is_active":"1","wbcr_clearfy_disable_emoji":"1","wbcr_clearfy_disable_emoji_is_active":"1","wbcr_clearfy_disable_feed":"0","wbcr_clearfy_d
@alekstrust
alekstrust / collections.js
Created December 12, 2017 22:08
Select DSpace collection handles from Community list using browser
$('#ds-body > ul > li.ds-artifact-item.community.odd > ul').find('.collection a').each(function(i,e){
var tokens = $(this).text().split('- ');
var coltype = tokens[tokens.length - 1].trim();
console.log('<name-map collection-handle="' + $(this).attr('href') + '" form-name="' + coltype + '" />');
});
@alekstrust
alekstrust / php-fpm.conf
Created January 4, 2018 00:17
PHP-FPM configuration for Apache HTTP 2.4
# This configuration requires httpd 2.4 with support for UDS (Unix domain
# sockets). This was added upstream in version 2.4.10, and was also backported
# to 2.4.6 in EL7.
# The following lines prevent .user.ini files from being viewed by Web clients.
<Files ".user.ini">
Require all denied
</Files>
# Allow php to handle Multiviews.
@alekstrust
alekstrust / php-fpm.conf
Created January 7, 2018 16:46
PHP-FPM configuration for Nginx
# PHP-FPM FastCGI server
# network or unix domain socket configuration
upstream php-fpm {
server 127.0.0.1:9000;
#server unix:/run/php-fpm/www.sock;
}
@alekstrust
alekstrust / config-update.sh
Created April 3, 2018 17:29
Updates configuration from dspace-source
cd /home/dspace/source-5.5/dspace
mvn package -P !dspace-jspui,!dspace-sword,!dspace-swordv2,!dspace-rdf
cd /home/dspace/source-5.5/dspace/target/dspace-installer
ant update_configs
@alekstrust
alekstrust / varnishlog-purge.sh
Created March 17, 2020 14:06 — forked from dnunez24/varnishlog-purge.sh
Varnish View Logged Purge Requests
varnishlog -g request -q 'ReqMethod eq "PURGE"'