Unban IP blocked by fail2ban
July 26th, 2011
Login to the Server as root
Use to and search for the banned ip.
iptables -L -n
You’ll get something like
Chain fail2ban-pam-generic (1 references)
target prot opt source destination
RETURN all -- 0.0.0.0/0 0.0.0.0/0
Chain fail2ban-ssh (1 references)
target prot opt source destination
DROP all -- 193.xxx.2.142 0.0.0.0/0
DROP all -- 202.120.xxx.87 0.0.0.0/0
DROP all -- 88.xxx.223.148 0.0.0.0/0
RETURN all -- 0.0.0.0/0 0.0.0.0/0
Check which of the rules (e.g. fail2ban-pam-generic or fail2ban-ssh) the banned ip is targeted.
Now you can remove the ip from iptables:
iptables -D fail2ban-pam-generic -s -j DROP
Posted in Developer Blog, serverstuff
Disable Update for WordPress Plugin
April 18th, 2011
In order to prevent a User from updating a hacked WordPress Plugin, you should implement to following
add_filter('site_transient_update_plugins', 'ap_remove_update_nag');
function ap_remove_update_nag() { unset(--->response[ plugin_basename(__FILE__) ]);
return ;
}
Thanks to
hacksandmore.com
Posted in Developer Blog, Wordpress
Clear OS-X font cache
January 6th, 2011
I did it again. Messed up something after installing font. So after removing duplicate fonts I need to clear the font cache.
Its simple:
- Close all running applications.
- Type: sudo atsutil databases -remove into Terminal as Admin
- Restart immediatly
This removes all font cache files. (system and all user font cache files)
Posted in Developer Blog, osx
How to remove the depreceated target=”_blank” in WordPress TinyMCE?
August 29th, 2010
If you let your users set their Links in WordPress with TinyMCE editor, you might run into some validation Problem, because target=”_blank” is part of the XHTML-Strict Standard.
To remove the Options in TinyMCE you need to edit two Files:
in
wp-includes/js/tinymce/themes/advanced/link.htm remove the Table Row offering the Link Target:
<tr>
<td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>
<td><select id="target_list" name="target_list"></select></td>
</tr>
in
wp-includes/js/tinymce/themes/advanced/js/link.js comment out the the call to
fillTargetList() in the init-function.
If you still want to open external Links in new Windows (or Tabs) you can use this Little Javascript. Links to different Domains will be opened in a new Window.
/** Creating custom :external selector **/
$.expr[':'].external = function(obj){
return !obj.href.match(/^mailto\:/)
&& (obj.hostname != location.hostname);
};
// Add 'external' CSS class to all external links
$('a:external').bind( 'click', function(){
open(this.href);
return false;
});
Posted in Developer Blog, Wordpress
WORDPRESS: Add CSS to Tinymce Editor
August 28th, 2010
There is an easy way to add custom styles to the Editor Panel in WordPress.
- Create a custom CSS file in your Theme Folder
- Add the following function to the functions.php file of your theme
if ( ! function_exists('tdav_css') ) {
function tdav_css() {
.= ',' . get_bloginfo('stylesheet_directory') . '/css/tinymce.css';
return ;
}
}
add_filter( 'mce_css', 'tdav_css' );
I my Template I use a right Floatbox which can be Edited as a section:
div.tinymceSection + * {
padding-top: 2em;
border-top: 3px dashed #cc0000;
clear: both; /* avoid Images floating into the next section in tinymce textarea */
}
Posted in Developer Blog, Wordpress
Worpress Plug-in: Multilingual Contact Form
August 26th, 2010
With WordPress and the qtranslate plug-in it is easy to create multilingual websites for small business.
My favorite contact form plug-in was discontinued I needed some replacement, which is usable on a multilingual site.
Features:
- Simple and basic easy to use on any Page or Post
- Enter and edit all text for fields and error messages in the Backend
- Compatible with qtranslate and other multi-language Plugins
- XHTML/HTM5 standard compliant
Read the rest of this entry »
Tags: qtranslate, Wordpress, wp-plugins
Posted in Developer Blog, Wordpress, qtranslate
Make All in One SEO and qtranslate work together
April 30th, 2010
In the main Plugin file all_in_one_seo_pack.php on lines #709 and #711, the $title_attrib and $menulabel variables are not created as Multilingual Variables. In order to make them so you need to add __() around the variables:
#709 :
$filtered = '<li class="page_item page-item-'.$postID.$matches[2].'"><a href="'.$matches[3].'" title="'.__($title_attrib).'">'.__($menulabel).'</a>';
#679 :
$filtered = '<li class="page_item page-item-'.$postID.$matches[2].'"><a href="'.$matches[3].'">'.__($menulabel).'</a>';
Thanks t Karlsan at this Forum
Tags: All in One SEO, qtranslate, Wordpress, wp-plugins
Posted in All in One SEO, Developer Blog, Wordpress, qtranslate
Easy Jquery Syntax Highlighter
April 25th, 2010
Searching for a proper syntax-highlighter for my WordPress Blog is not an easy thing. Many of them support only a few browsers, mass around with XHTML standards or make extensive use of libraries like prototype I don’t want to add to my site. Finally I found a
jquery based syntax highlighter which requires only one file in the latest version. It is really easy to integrate into a WordPress template and doing it the smart way it is only loaded if you need it. After installing it to your website you just need to add the following to you jQuery document.ready function:
$(function ($) {
var SyntaxRoot = template_directory+"/jquery-syntax/";
if ($('.syntax').length) {
$.getScript(SyntaxRoot + "jquery.syntax.min.js", function () {
$.syntax({root: SyntaxRoot});
});
}
});
In order to use different jQuery Plugins I added my Template directory as a variable for javascript into the WordPress header:
<script type="text/javascript" charset="utf-8"><!--
var template_directory = "<?php echo get_bloginfo('template_directory'); ?>";
--></script>
In WordPress I use a php Plugin which enables to write php in every Post. With the following function in my Wordoress Theme template.php I can copy and paste my code right into a post by using
<?php codeIt('myWhateverCodeSnipplet(
echo \'Mind the quotes\'
)', 'javascript'); ?>
/* Highlight code */
function codeIt($text, $brush="html"){
echo '<pre class="syntax brush-'.$brush.'">'."\n".htmlentities($text)."\n".'</pre>'."\n";
}
I set the default brush to html (which recognizes basic <css…> and <script…> tags and optionally overwrite it with the used language.
The only drawback i need to quote all single
‘ with a Slash to
\’
Posted in Developer Blog, Wordpress, jquery
Same template for Category and Subcategory
April 20th, 2010
Using the same template file for a category and its children is not possible with WordPress. In order to do you need to use
Elevate Parent Category Template-Plugin.
If you using the Plugin you’ll be able to use some adittional template functions:
- get_category_child()
returns the current post child category ID.
- is_parent()
checks if the current post is at the parent category.
- get_category_title($id)
gets the title of the category that is $id.
- get_category_parent()
returns the current post’s parent category ID.
Posted in Developer Blog, Wordpress
jquery jcarousel circular with cache
April 19th, 2010
The
jcarousel is a nice jQuery plugin which allows you to easily create javascript based slideshows. Even if not fully implemented it has a option to run in a circular mode, by dynamically creating the slide objects from a javascript array. Sorgala made an good commented example, just check the
source.
The problem with this approach is that each object is inserted and removed into the dom on every slide move. Using it for larger images results in a new request each time the slideshow comes to the same element.
Another feature is the ability to preload the jcarousel images: I want them to be in cache already when it’s time to show up.
Read the rest of this entry »
Posted in Developer Blog, jquery
Migrating Drupal
March 27th, 2010
Locally I use MAMP on my Macbook to develop Themes for Drupal. There’s a nice module called backup & migrate which you can use to get the relevant tables from your Drupal installation.
Using admin/content/backup_migrate you can get and restore the Database quickly after after installing the module.
If there was some larger Work on files like a drupal core update was done on my on-line Testing Server I get a new copy of the whole htdocs-directory into a blank new working-directory (e.g. /georgia/4-2009) into the project folder within MAMP htdocs on the macbook.
If you safe the Database on the remote machine before downloading the files by ftp, the actual backup gets included. You can restore the database manually by locating the SQL file at /georgia/4-2009/htdocs/sites/yoursite/files/backup_migrate/manual/ and use PHPmydmin to restore.
The local domain name georgia.local has its own settings file. Database settings are stored in a site folder for the local domain /georgia/4-2009/htdocs/sites/georgia.local. You create an new Database with PHPmyAdmin according to your Version Folders Name and edit the Connection settings in the database accordingly. If something appears strange be sure to empty drupal cache at admin/settings/performance
and the testing servers have each their own settings file???
With MAMP-Pro I set up a working Domain (e.g. georgia.local) so I just need to change the disc location of the htdocs-directroy within my MAMP-Pro to the latest version.
Posted in Developer Blog, Drupal
Colormanagement in the internet
January 14th, 2010

Thesis and Lecture
Colormanagement according to the ICC-Standard has become common for pre-press within the past years. This document is an investigation on previous approaches for Colormanagement within world wide web and analyses recommendations for Colormanagement of the W3C in the field of cross-media publishing using XML-based documents.
Read the rest of this entry »
Posted in Colormanagement, Lectures, References, Webdevelopment