Skip to content

Instantly share code, notes, and snippets.

View 7rin0's full-sized avatar

SEVERINO, Luis 7rin0

  • Lyon, France
View GitHub Profile
@7rin0
7rin0 / Drupal_fix_drush_entup_database.sql
Created May 16, 2017 14:11
"Base table or view not found: 1146 Table field_dummy_drupal_8_2_3 doesnt exist ..."
/** Connect to database and generate dummy tables to fix this issue. **/
CREATE TABLE `node__field_dummy_drupal_8_2_3` (`fid` int(11) NOT NULL AUTO_INCREMENT,
`uuid` varchar(128) CHARACTER
SET ascii NOT NULL,
`pid` varchar(50) NOT NULL,
`url` varchar(191) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`metadata` longtext,
`created` int(11) DEFAULT NULL,
`deleted` int(11) DEFAULT NULL,
@7rin0
7rin0 / gist:9fcae69e46b6538617669212dbad5aa5
Last active May 16, 2017 02:27
Project XYZ Drupal 8 - GEOS / PHP7 Mod / GD Image lib
# Install GEOS lib and GEOS php mod on PHP7
# http://www.saintsjd.com/2014/06/05/howto-intsall-libgeos-with-php5-bindings-ubuntu-trusty-14.04.html
# /etc/php/7.0/mods-available/geos.ini
apt-get install -y apache2 php5 libapache2-mod-php5 php5-dev phpunit
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
tar -xjvf geos-3.4.2.tar.bz2
cd geos-3.4.2/
./configure --enable-php
make
sudo make install
@7rin0
7rin0 / gist:2a5153acafc30afd002498a2a1b8bc3c
Created May 12, 2017 01:02
Machine time, operation, rewrite , log
#/bin/bash
# Go back in time and apply some tests to
# obtain enough data to check project evolutions (QA, Perf, etc)
# i in range of desired days i.e: 0-70
for i in {0..70}
do
# Change directory to targeted project
cd ~/some/project/using/git
@7rin0
7rin0 / gist:3484706b42ddbda0b73bf37057d5fd6f
Created May 10, 2017 10:28
ERROR: failed to allocate gateway (172.95.63.1): Address already in use ...
# Not a really a solution, just a reminder to how "reset" docker network
rm -rf /var/lib/docker/network/files/local-kv.db
@7rin0
7rin0 / find_rename_pattern.sh
Created May 9, 2017 08:26
Find and rename by pattern
#!/bin/bash
rename 's/word_a/word_b/' $(find * -name "*word_a*")
@7rin0
7rin0 / request_post_custom.js
Created May 7, 2017 10:10
Node.js simple and custom post request
// http://stackoverflow.com/a/6432824
var request = require('request');
request.post({
headers: {'content-type' : 'application/x-www-form-urlencoded'},
url: 'http://localhost/test2.php',
body: "mes=heydude"
}, function(error, response, body){
console.log(body);
});
@7rin0
7rin0 / find_exclude_remove.sh
Created May 1, 2017 15:17
Remove found file list updated last 5 minutes and exclude directory from results
rm -rf $(find ./ -maxdepth 1 -mmin -5 -not -path './.git')
@7rin0
7rin0 / find_files_by_time.sh
Created May 1, 2017 15:07
Find files by modified time
# Move found files modified the 5 minutes before, depth level 1, to "DIR" directory ...
mv $(find ./ -maxdepth 1 -mmin -5) DIR/
@7rin0
7rin0 / open_block_links_tidbit.js
Created April 30, 2017 10:33
Open all links inside an element using jQuery/JS
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(