- Exportar la db en local y ponerla en una carpeta, ir a esa carpeta en la terminal para copiarla via ssh
- Copia el archivo usando el siguiente comando
scp -r walk.sql [email protected]:/var/www/html/
tener presente el nombre del archivo y que debe ir en el directorio public o html - conectarse al droplet via ssh y ejecutar el siguiente comando para importar la db
mysql -u wordpress -p wordpress < walk.sql
donde el primer parametro es el nombre de usuario, el segundo el nombre de la db y el tercero el archivo q acabamos de importar, esta info la puedes obtener asi:nano wp-config.php
ogrep 'define' wp-config.php
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
# in the folder where is the files do - Change 104.248.34.58 for you ip | |
scp -r walk.sql.gz [email protected]:/var/www/html/wp-content |
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
// install filezilla | |
sudo apt-get update | |
sudo apt-get install filezilla | |
// Crear Alias .zshrc | |
alias knito="ssh -tp 22 [email protected] 'cd ../var/www/html; bash'" | |
//Permisos | |
sudo chown -R www-data:www-data /var/www/html |
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
//obtain pages or post who added a relationship item - Reverse relationship posts | |
$tasks = get_posts(array( | |
'post_type' => 'task', | |
'meta_query' => array( | |
array( | |
'key' => 'task_parents', // name of custom field | |
'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234" | |
'compare' => 'LIKE' | |
) |
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
alias cl="clear" | |
alias dev="ssh -tp 22 [email protected] 'cd webapps; bash'" | |
alias rc1="ssh -tp 22 [email protected] 'cd webapps; bash'" | |
alias rc2="ssh -tp 22 [email protected] 'cd webapps; bash'" | |
alias rc3="ssh -tp 22 [email protected] 'cd webapps; bash'" | |
alias rc4="ssh -tp 22 [email protected] 'cd webapps; bash'" | |
alias rc5="ssh -tp 22 [email protected] 'cd webapps; bash'" | |
alias rc6="ssh -tp 22 [email protected] 'cd webapps; bash'" | |
alias sp5="ssh -tp 22 [email protected] 'cd apps; bash'" | |
alias sp3="ssh -tp 22 [email protected] 'cd apps; bash'" |
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
add_filter('gform_field_value_emailto', 'add_job_email'); | |
function add_job_email($value) | |
{ | |
global $post; | |
$id = $post->id; | |
$email = get_field('email_to', $id); | |
return $email; | |
} |
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
add_filter("gform_pre_submission_1", "obtainsumvaluesfield", 1); | |
function obtainsumvaluesfield($form) | |
{ | |
// get all entries in this form | |
$entry = GFFormsModel::get_current_lead(); | |
$all = 0; | |
foreach ($form["fields"] as &$field) | |
if ($field->type == 'checkbox') { |
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
add_action('gform_after_submission', 'set_post_content', 10, 2); | |
function set_post_content($entry, $form) | |
{ | |
//vars | |
$id = $entry['form_id']; | |
if ($id == '3' || $id == '1' || $id == '10' || $id == '16') { | |
$date = new DateTime(); | |
$date->setTimezone(new DateTimeZone('America/Chicago')); |
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
10k e951 | |
10mp e952 | |
11mp e953 | |
12mp e954 | |
13mp e955 | |
14mp e956 | |
15mp e957 | |
16mp e958 | |
17mp e959 | |
18mp e95a |
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
test |
NewerOlder