Skip to content

Instantly share code, notes, and snippets.

View vremy's full-sized avatar

Vincent Remy vremy

  • The Netherlands
View GitHub Profile
@vremy
vremy / .tigrc
Created January 17, 2017 10:41
Tig theme (location: ~/.tigrc)
# vim: set expandtab sw=4 tabstop=4:
# *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
# general
color default 15 0
color cursor 15 241
color title-focus 242 221
color title-blur 242 221
color delimiter 213 default
color author 156 default
@vremy
vremy / gist:9955fb9eb6b69ad17ad371ddf4a4cd28
Created May 4, 2016 14:45
Show filedescriptors opened by the given process
dtrace -p PROCESS_ID -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'
@vremy
vremy / findExecutables.sh
Created August 5, 2015 21:12
Find all executable files
find YOURDIRECTORY/ -type f -perm /u=x,g=x,o=x -exec ls -l {} \;
@vremy
vremy / cleanup.sh
Created July 28, 2015 08:09
Remove files greater than one MB
find . -size +1M -exec rm -f {} \;
@vremy
vremy / equalizer.js
Last active August 29, 2015 14:22
equalizer.js
/**
* Equalizer by Geo
* Equalizer all div heights inside a div
*/
function equalizer(cssPath) {
var element = $(cssPath);
var maxHeight = Math.max.apply(null, element.map(function() {
return $(this).outerHeight();
}).get());
@vremy
vremy / addSSHKey
Created May 19, 2015 06:37
Add the SSH key to automatically login to the server
cat .ssh/id_rsa.pub | ssh [email protected] "cat >> .ssh/authorized_keys"
@vremy
vremy / find.sh
Created December 5, 2014 13:22
Search recursive trough directory www/ for directories with the name .idea/ limited the search by directory depth
find www/ -maxdepth 2 -type d -name ".idea" -ls
@vremy
vremy / table_size_statistics.sql
Last active August 29, 2015 14:10
Useful mysql query to show the size in mb, total rows, data and index length in all tables from a database
SELECT TABLE_NAME, table_rows, data_length, index_length,
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB"
FROM information_schema.TABLES WHERE table_schema = "schema_name"
ORDER BY (data_length + index_length) DESC;
@vremy
vremy / allow.sql
Created November 18, 2014 15:35
Allow
grant all privileges on *.* to root@'%' identified by '';
@vremy
vremy / phpbrew-switcher.sh
Last active August 29, 2015 14:06
phpbrew version switcher
#!/bin/bash
if [ ! -z $1 ]; then
if [ $1 == 'list' ]; then
echo ''
echo 'Available PHP versions'
echo '----------------------'
ls -al /opt/phpbrew/php/ | grep php | cut -d '-' -f 4
echo ''
fi