Skip to content

Instantly share code, notes, and snippets.

Working from home

Jasper Frumau jasperf

Working from home
View GitHub Profile
jasperf / apache-disable-handlers
Last active Aug 29, 2015
Disallow the functioning / executing of PHP scripts in a folder / directory to avoid the adding of malicious files #apache #php #security
View apache-disable-handlers
// the following filetypes will not be executed
AddHandler cgi-script .php .pl .jsp .asp .sh .cgi
Options -ExecCGI
jasperf / wplogin-ht-auth
Last active Aug 29, 2015
.htaccess authentication to protect wp-login.php against brute force attacks without blocking the whole site #wordpress #security #htaccess
View wplogin-ht-auth
AuthType Basic
AuthName "Graag twee keer login invoeren en daarna standaaard WordPress login"
AuthUserFile /path/to/file/.htpasswd
<Files wp-login.php>
Require valid-user
#Dreamhost required this directive above WP directive
jasperf / wordpress-disable-plugins
Last active Aug 29, 2015
Disable the WordPress plugins manually from the backend with PHPMyAdmin #wordpress #plugins #phpmyadmin
View wordpress-disable-plugins
//Go to databaase > wp options
//find row active_plugins
// remove all serialized data
//save et voila
jasperf / group all files under same group automatically
Created Jun 3, 2014
Command to make all new files and directories created under the directory belong to the same group as that directory. #chown #unix
View group all files under same group automatically
#make all files within a directory belong to a group
chmod g+s
jasperf / .htaccess-seo-tweaks
Last active Aug 29, 2015
.htacess snippets to expire headers, add cache control header, gzip #seo Gzip check here
View .htaccess-seo-tweaks
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
# ExpiresByType text/css "access plus 2592000 seconds"
jasperf / unix-useradd-and-chroot
Last active Aug 29, 2015
Add a (ssh) user to unix or linux server, put the user in sudo users group and chroot the ssh/sftp user to a path of choice so it can only work from a certain directory #centos #chroot #unix
View unix-useradd-and-chroot
//check if port is in use
netstat -ln |grep 8080
//check what is using this port
netstat -tupln |grep 8080
jasperf / remove-files-current-dir
Last active Aug 29, 2015
Remove all files in current directory from the command line #unix #linux #osx
jasperf / remove-pdf-sec-limitations
Created Jun 27, 2014
Removing pdf security limitations so you can copy text or edit the pdf document with ghostscript. This is a really easy command line way to (re)gain control over a pdf's content #hacks #pdf
View remove-pdf-sec-limitations
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -c .setpdfwrite -f INPUT.pdf
jasperf / gist:a38d6d63f7b9c31d7f4a
Last active Aug 29, 2015 — forked from ifnull/gist:5055099
Show the permissions of (current) directory in numeric values like 777 or 755 depending on the setup. This is sometimes easier than looking at the rights with alphabets.
jasperf /
Created Jul 7, 2014 — forked from infolock/
# Recursively find all files in the current directory and change to access of 644 and for directories to 755
# Recursively find all files in the current directory and change to access of 644
find ./ -type f -exec chmod 644 {} \;
# Recursively find all directories in the current directory and change to access of 755
find ./ -type d -exec chmod 755 {} \;