Skip to content

Instantly share code, notes, and snippets.

View rdlmda's full-sized avatar

Rudá Almeida rdlmda

  • Federal University of Rio de Janeiro
  • Rio de Janeiro, Brazil
  • 19:37 (UTC -03:00)
View GitHub Profile
@rdlmda
rdlmda / Clean filenames
Last active December 10, 2019 23:58
Rename or remove files with special chars on Linux
Sometimes you end up with a filename that is hard to address on the command line because it has special characters in its name.
In some cases you can get away with prepending a ./ or quoting, or escaping with backslash. When those don't work, this can get you out of trouble.
@rdlmda
rdlmda / Basic MySQL
Last active August 23, 2016 19:07
Some very basic MySQL operations
Some very basic MySQL operations
@rdlmda
rdlmda / WP SQL Queries
Last active August 29, 2015 13:56
WP SQL Queries - A few SQL queries for manipulating posts, pages, users and comments directly
A few SQL queries for manipulating posts, pages, users and comments directly
Context-agnostic WP-CLI, Drush and Drupal running each on a Docker container and interacting with other containers
@rdlmda
rdlmda / remote-export-single-wpmu-site.sh
Last active August 23, 2016 21:00
Export and backup a single site from a WordPress Multisite install
#!/bin/bash
# A função deste script é realizar o backup do banco de dados e das pastas de um site isolado
# de uma instalação WordPress Multisite, independente dos outros sites presentes na mesma
# instalação. Para isso é utilizado o "wp db export", bem como o rsync das pastas com a ID
# do site (hardcoded, no futuro melhorar isso).
#
# Este script deve ser colocado na máquina que hospeda o multisite e executado
# periodicamente via cron. A máquina destino deve possuir as credenciais de acesso.
@rdlmda
rdlmda / wp-upgrade.sh
Last active July 8, 2017 03:12
Upgrade everything WordPress via WP-CLI
#!/bin/bash
export PATH="/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/root/bin"
wp cli update --yes --allow-root
wp core update --path=/var/www/html/[path] --allow-root
wp plugin update --all --path=/var/www/html/[path] --allow-root
wp theme update --all --path=/var/www/html/[path] --allow-root
@rdlmda
rdlmda / Dockerized WordPress and Drupal
Last active January 13, 2017 13:49
Dockerized WordPress and Drupal
Running CMS's like WordPress and Drupal in dockerized instances.
<?php
/*Plugin Name: Força atulização
Description: Ativa atualização automática do core e dos plugins
Author: Rudá Almeida
Version: 0.1
*/
add_filter( 'auto_update_core', '__return_true' );
add_filter( 'auto_update_plugin', '__return_true' );
@rdlmda
rdlmda / gist:267b548372c1673d49b1bf749363623e
Created May 3, 2019 14:13
Generate a bcrypt hashed password
php -r "echo password_hash('ThePassword', PASSWORD_BCRYPT, ['cost' => 13]) . PHP_EOL;"
# It will output something like: $2y$13$7mBTrD0lgdgBxt1.YbdvOOeSOrPUYOBfeC1Ra2osPs9lpCHdplw1m
@rdlmda
rdlmda / README.md
Created September 19, 2020 20:04 — forked from sevein/README.md
mbox extractor

mboxext

mboxext is a Mbox mailbox message extractor.

Example

$ python mboxext.py -v /home/vagrant/Sent.mbox /home/vagrant/output/

2015-10-01 17:54:46,060 [mboxext] INFO - Target directory already exists and it's not empty

2015-10-01 17:54:46,061 [mboxext] INFO - Opening Mbox mailbox: /home/vagrant/Sent.mbox