Skip to content

Instantly share code, notes, and snippets.

View deadbok's full-sized avatar

Martin Bo Kristensen Grønholdt deadbok

  • Denmark
View GitHub Profile
@deadbok
deadbok / dirdiff.sh
Last active August 9, 2016 11:36
Scan for changed and suspucious files on WordPress sites.
# Set this to the directory where the script is installed.
# Make sure the script is saving the files in a sane place
# when running as a cron job.
ROOT=.
#Directory to scan
DIR=/home/*/web/*/public_html/
if [ ! -f ${ROOT}/dirdiff.lst ];
then
touch ${ROOT}/dirdiff.lst
@deadbok
deadbok / htaccess
Last active August 1, 2016 08:50
Better .htaccess for WordPress on VestaCP
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
,*.php *.bak .htaccess
wp-admin,*.php
wp-admin/css,*.css
wp-admin/css/colors,*.css *.scss
wp-admin/css/colors/blue,*.css *.scss
wp-admin/css/colors/coffee,*.css *.scss
wp-admin/css/colors/ectoplasm,*.css *.scss
wp-admin/css/colors/light,*.css *.scss
wp-admin/css/colors/midnight,*.css *.scss
wp-admin/css/colors/ocean,*.css *.scss
@deadbok
deadbok / linux_cheat_sheet.md
Last active November 28, 2016 14:27
Linux command prompt cheat sheet

Linux command prompt cheat sheet

Terminology

Everything enclosed in * characters are placeholders for the arguments that you need in your particular case.

Mount, mount point. etc

To make a drive, actually a partition on a physical drive, available in

@deadbok
deadbok / gist:155bd5906b30bc34b75180b240e326ac
Created February 3, 2017 23:41
Fabric file for deploying a flask installation including mongodb.
# -*- coding: utf-8 -*-
# Fabric file for deploying a flask installation including mongodb.
#
# Interesting tasks are:
#
# * purge: Remove everything but the application and the git repository.
# * purge_conf: Purge configurations.
# * purge_dep: Uninstall all packages.
# * deploy: Deploy the flask application to "/home/flask/*project_name*".
@deadbok
deadbok / wpconfig.py
Created February 18, 2017 18:13
Python class to work with Wordpress wp-config.php
# -*- coding: utf-8 -*-
"""
Manipulate a wp-config.php file.
MIT License
Copyright (c) 2017 Martin Bo Kristensen Grønholdt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@deadbok
deadbok / py2puml.py
Last active March 5, 2022 08:44
Program to create UML class diagrams from python files.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <martin.groenholdt@gmail.com> wrote this file. As long as you retain this notice
# you can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. Martin B. K. Grønholdt
# --------------------------------------------------------------------------------
# Program to parse Python classes and write their info to PlantUML files
# (see http://plantuml.com/) that can be used to generate UML files and GraphViz
#### Contents of the preconfiguration file (for jessie)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_GB
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
@deadbok
deadbok / kernel-4.9.6-gentoo-r1-ppc.config
Created April 9, 2017 10:45
Linux kernel configurtion for Gentoo on a PowerBook6,2 ppc.
#
# Automatically generated file; DO NOT EDIT.
# Linux/powerpc 4.9.6-gentoo-r1 Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
@deadbok
deadbok / README.md
Created May 14, 2017 23:48
Directory tree in a nice MarkDown unordered list.

MarkDown tree

tree command that outputs the tree in a nice MarkDown unordered list.