Skip to content

Instantly share code, notes, and snippets.

View calvez's full-sized avatar
🏠
Working from home

calvez calvez

🏠
Working from home
  • Budapest, Hungary
View GitHub Profile
@calvez
calvez / essential-wp-plugins.sh
Last active January 29, 2019 13:14
essential-wp-plugins
wp plugin install disable-comments maintenance wordpress-seo wordpress-importer developer fakerpress theme-test-drive theme-check log-viewer
@calvez
calvez / artist-sidebar-links.php
Last active May 25, 2017 09:55
strm.hu sidebar links

#source https://drupal.stackexchange.com/a/223785/56193

You can install drush to latest version or specified version. I prefer drush 7, you can make this, first uninstall the current version of drush of your server.

i use debian, then i install with

sudo apt-get install drush and you need remove

@calvez
calvez / fail2ban-allstatus.sh
Created April 16, 2017 15:28 — forked from kamermans/fail2ban-allstatus.sh
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done
@calvez
calvez / wp-query-ref.php
Created April 11, 2017 09:28 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
drush pml --no-core --type=module --status=enabled --pipe | xargs drush -y dis
@calvez
calvez / fix-drupal-permissions.sh
Last active April 6, 2017 08:55
Drupal - Bash shell script to fix Drupal permissions
#!/bin/bash
path=${1%/}
user=${2}
group="www-data"
help="nHelp: This script is used to fix permissions of a drupal installationnyou need to provide the following arguments:nt 1) Path to your drupal installationnt 2) Username of the user that you want to give files/directories ownershipnNote: "www-data" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this scriptnnUsage: (sudo) bash ${0##*/} drupal_path user_namen"
if [ -z "${path}" ] || [ ! -d "${path}/sites" ] || [ ! -f "${path}/modules/system/system.module" ]; then
echo "Please provide a valid drupal path"
echo -e $help
@calvez
calvez / mysql.sh
Last active April 5, 2017 15:19
Virtualhost script I dunno, but Mysql - # Bash script written by Saad Ismail - [email protected] - thanks guys
#!/bin/bash
# Bash script written by Saad Ismail - [email protected]
# If /root/.my.cnf exists then it won't ask for root password
if [ -f /root/.my.cnf ]; then
echo "Please enter the NAME of the new WordPress/Drupal database! (example: database1)"
read dbname
echo "Please enter the WordPress database CHARACTER SET! (example: utf8_general_ci, utf8, for hungarian wordpress you can use utf8_hungarian_ci...)"
read charset
echo "Creating new WordPress/Drupal database..."
@calvez
calvez / wp-max-post-loop.php
Created March 29, 2017 09:55
wordpress snippets
<?php
global $query_string;
query_posts( $query_string . '&posts_per_page=4' );
?>
@calvez
calvez / header.html
Created March 9, 2017 14:05
autoversion
<link href="<?php autoversion('/path/to/theme.css'); ?>" rel="stylesheet">