Skip to content

Instantly share code, notes, and snippets.

View PontusTideman's full-sized avatar

Pontus Tideman PontusTideman

  • Sweden
View GitHub Profile
@rjekic
rjekic / wp.sh
Last active June 16, 2022 12:18 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script using wp-cli
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
# Gathering database login credentials from user input
read -p "Database Host: " dbhost
read -p "Database Name: " dbname
read -p "Database User: " dbuser
<?php
//Scripts(em WP-CLI) para automação de criar ou deletar rapidamente sites em Wordpress em localhost.
//Crie um arquivo php:
//Confere se WP-CLI está disponível e se sim adiciona 'installer' aos comandos do qual há 2 subcomandos :install e uninstall
if ( defined( 'WP_CLI' ) && WP_CLI ) {
WP_CLI::add_command( 'installer', ‘WP_CLI_Installer’, array( ‘when’ => ‘before_wp_load’ );
}
/**
@frankIT
frankIT / switchphpto
Last active January 22, 2024 11:05
coexistence of multiple php versions on debian stretch
#!/bin/bash
# https://deb.sury.org/
VERSION=$1
# unmount all php apache modules
for version in $(ls /etc/php); do
sudo a2dismod php$version
done
@frankIT
frankIT / webp2png.sh
Last active April 30, 2022 03:46
batch convert webp to jpg
#!/bin/bash
# apt-get install webp
for f in *.webp
do dwebp $f -o "$f.png"
done;
wp post update $(wp post list --post_type='page' --post_status='publish' --format=ids) --post_status='publish' --defer-term-counting
@whiolf
whiolf / php_unserialize.sh
Created February 2, 2016 11:19
Just a quick shell script to unserialize php. If you don't send the string as an argument, it tries OS X clipboard.
#!/usr/bin/env bash
if [[ $1 ]];
then
php -r " echo var_dump(unserialize('"$1"')); echo \"\\n\";"
else
STRING=`pbpaste`
php -r " echo var_dump(unserialize('"$STRING"')); echo \"\\n\";"
fi
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "