Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@jasperf
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
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
#http://tools.dynamicdrive.com/password/
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
</Files>
#Dreamhost required this directive above WP directive
@jasperf
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
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
jasperf / .htaccess-seo-tweaks
Last active Aug 29, 2015
.htacess snippets to expire headers, add cache control header, gzip #seo Gzip check here http://www.feedthebot.com/tools/gzip/
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
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
jasperf / remove-files-current-dir
Last active Aug 29, 2015
Remove all files in current directory from the command line #unix #linux #osx
@jasperf
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 http://www.commandlinefu.com/commands/view/4345/remove-security-limitations-from-pdf-documents-using-ghostscript
View remove-pdf-sec-limitations
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -c .setpdfwrite -f INPUT.pdf
@jasperf
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
jasperf / chmod_files_and_dirs.sh
Created Jul 7, 2014 — forked from infolock/chmod_files_and_dirs.sh
# Recursively find all files in the current directory and change to access of 644 and for directories to 755
View chmod_files_and_dirs.sh
# 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 {} \;