This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Creating admin user account for WordPress using PhpMyAdmin. | |
Please make the following changes and then run this SQL. | |
*** Change the Database name 'yourdbname'. | |
*** Change table names 'wp_users' and 'wp_usermeta' and also change 'wp_capabilities' and 'wp_user_level' according to table prefix. | |
*** Change username 'palpalani' and password 'password' | |
*** Change ID to whatever you need | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Monitor CentMinMod (https://community.centminmod.com/) server using Monit | |
//Mmonit 5.14 - http://mmonit.com/monit/ | |
//How to: http://mmonit.com/wiki/Monit/HowTo | |
//Real-world configuration examples - http://mmonit.com/wiki/Monit/ConfigurationExamples | |
//Pushover notifications - http://mmonit.com/wiki/MMonit/Notification | |
//About Monit | |
Monit is a helpful program that automatically monitors and manages server programs to ensure that they not only stay online consistently, but that the file size, checksum, or permissions are always correct. Additionally monit comes with a basic web interface through which all of the processes can be set up. This tutorial will cover the most basic setup and configuration. | |
//Install Monit on CentOS 6.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# WordPress Sandbox | |
# palPalani | |
# m3webware.com | |
# requires wp-cli | |
# usage: wordpress-sandbox | |
# or: ./wordpress-sandbox.sh | |
# Download WordPress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shell script to backup MySql database | |
# To backup MySql databases file to /backup directory and later pick up by your | |
# script. You can skip few databases from backup too. | |
# For more info please see (Installation info): | |
# http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/01/mysql-backup-script.html | |
# Last updated: Nov - 2013 | |
# -------------------------------------------------------------------- | |
# This is a free shell script under GNU GPL version 2.0 or above | |
# Copyright (C) 2004, 2005 nixCraft project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A UNIX / Linux shell script to backup dirs to tape device like /dev/st0 (linux) | |
# This script make both full and incremental backups. | |
# You need at two sets of five tapes. Label each tape as Mon, Tue, Wed, Thu and Fri. | |
# You can run script at midnight or early morning each day using cronjons. | |
# The operator or sys admin can replace the tape every day after the script has done. | |
# Script must run as root or configure permission via sudo. | |
# ------------------------------------------------------------------------- | |
# Copyright (c) 1999 Vivek Gite <[email protected]> | |
# This script is licensed under GNU GPL version 2.0 or above | |
# ------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* If you, by any chance, want to limit the number of posts an user can create in your multi author WordPress blog, there is a nice way to do it. Add the following code in your theme’s functions.php file | |
*/ | |
add_action("load-post-new.php","limit_user_by_post_count"); | |
function limit_user_by_post_count(){ | |
$user = get_current_user_id(); | |
if (!current_user_can( 'manage_options')) { | |
//not an admin - so impose the limit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Here is the function, drop it in your functions.php file | |
*/ | |
function auto_login( $user ) { | |
$username = $user; | |
if ( !is_user_logged_in() ) { | |
$user = get_userdatabylogin( $username ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $db; | |
$upload_dir = get_misc_data('upload_directory'); | |
$thumb_dir = get_misc_data('upload_thdirectory'); | |
$link_id = $this->_vars['link_id']; | |
$sql = sprintf("SELECT file_name FROM " . table_prefix . "files WHERE file_link_id='%d' AND file_size='240x650' AND file_comment_id=0", $link_id); | |
if ($thumbnail = $db->get_var($sql)) { | |
echo "<img src='". my_pligg_base . $thumb_dir ."/$thumbnail'> "; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li><a href="http://www.acunetix.com/websitesecurity/wordpress-security-plugin/" target="_blank">Acunetix Wordpress Security Plugin</a>. Check <a href="http://wordpress.org/support/plugin/wp-security-scan" target="_blank">support forum</a> for any issues.</li> | |
<li><a href="http://wordpress.org/plugins/sucuri-scanner/" target="_blank">Sucuri Security Malware Scanner</a>. Check <a href="http://wordpress.org/support/plugin/sucuri-scanner" target="_blank">support forum</a> for any issues.</li> | |
<li><a href="http://wordpress.org/plugins/akismet/" target="_blank">Akismet</a>. Check <a href="http://wordpress.org/support/plugin/akismet" target="_blank">support forum</a> for any issues.</li> | |
<li><a href="http://www.seoegghead.com/software/wordpress-firewall.seo" target="_blank">Wordpress Firewall</a></li> | |
<li><a href="http://wordpress.org/plugins/crayon-syntax-highlighter/" target="_blank">Crayon Syntax Highlighter</a>. Check <a href="http://wordpress.org/support/plugin/crayon-syntax-highlighter" target= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Have you ever needed to share an email address in your WordPress blog or website? | |
You most likely have, and if you ever cared about not getting caught by spam robots which crawl the web for email addresses, telephone numbers and things like that, you've searched for a solution to hide the email addresses from those tiny evil robots. | |
I know I have, and little did I know, there was already a core WordPress function for it: antispambot(). | |
Usage | |
The usage of the function is pretty simple: |