terça-feira, 2 de outubro de 2018

cURL with FTP

To download certain file: curl -u [username]:[password] 'ftp://[hostname]/[filePath]' -O

To list a directory: curl -s -l -u [username]:[password] 'ftp://[hostname]/[dirPath]'

segunda-feira, 1 de outubro de 2018

Padrões de Endereços

Brasil: [Tipo do Logradouro] [Nome do Logradouro], [Número do Lote], [Complemento (se houver)] - [Nome do Bairro], [Cidade]-[UF] [CEP]

US: [Responsável pela Casa] Se o destinatário não for o responsável pela casa: c/o [Destinatário] Se tem o [PO box code]: [PO box code] Senao: [numero] [Rua], [complemento] [Cidade], [Estado], [ZIP code] AddressLine 1: [numero] [Rua],[Cidade], [Estado abreviado], [ZIP code] AddressLine 2: [complemento]

quinta-feira, 10 de agosto de 2017

Doctrine 2 command sheet

orm:schema-tool

  • vendor/bin/doctrine orm:schema-tool:create: creates database's tables and their columns from scratch according the Entities Metadata.
  • vendor/bin/doctrine orm:schema-tool:update [--dump-sql] [--force]: update database's tables and their columns according the Entities Metadata.

orm:convert-mapping

  • vendor/bin/doctrine orm:convert-mapping [--from-database] [destination metadata type] [destination folder path]: convert Entities Metadata files from the current format to [destination metadata type] format and save them on [destination folder path].
    • The available values for [destination metadata type] are: xml, yaml and annotation.
    • If the param [--from-database] was suplied the input Metadata used to produce the output Metadata will be the current database's tables, instead of current Metadata infos. This is a great way to reverse ingeneer a database to Entities.

orm:generate

vendor/bin/doctrine orm:generate:entities [destination folder path]: generate Entities Classes files from the current Metadata files.

source: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/tools.html

quarta-feira, 19 de julho de 2017

MySQL Backup and Restoration Scripts

#!/bin/bash
PASSWORD=XXXXXX
HOST=XXXXXX
USER=XXXXXX
DATABASE=databasename
DB_FILE=dump.sql
EXCLUDED_TABLES=(
table1
table2
table3
table4
tableN   
)

IGNORED_TABLES_STRING=''
for TABLE in "${EXCLUDED_TABLES[@]}"
do :
   IGNORED_TABLES_STRING+=" --ignore-table=${DATABASE}.${TABLE}"
done

echo "Dump structure"
mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} --single-transaction --no-data ${DATABASE} > ${DB_FILE}

echo "Dump content"
mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} ${DATABASE} --no-create-info ${IGNORED_TABLES_STRING} >> ${DB_FILE}

Original source: https://stackoverflow.com/questions/425158/skip-certain-tables-with-mysqldump/425172

quarta-feira, 12 de julho de 2017

Restrict users from changing the wallpaper in Windows

Navigate to the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Policies\System
Create a new string value called "Wallpaper" and set it to the full path and filename of the image.
Additionally, to specify the display style, create a new string value called "WallpaperStyle" and set it to either "0", "1" or "2" according to the list below.
  • 0 - Centered (Default)
  • 1 - Tiled
  • 2 - Stretched
NOTE: You may need to restart Windows for the changes to take effect.
Original Source: https://support.microsoft.com/en-us/help/555429

terça-feira, 27 de setembro de 2016

Laravel command sheet

  • php artisan make:controller [ControllerName]: creates a new Controller called [ControllerName].

segunda-feira, 12 de setembro de 2016

Receita Bolo de Queijo


Ingredientes:
  • 3 ovos;
  • 100 ml de óleo de soja;
  • 1 colher de sopa margarina;
  • 2 xícaras de fécula de mandioca;
  • 1 xícara de farinha de trigo com fermento;
  • 1 xícara de leite;
  • sal à gosto (eu ponho uma colher chá);
  • 150g de queijo coalho;
  • 7 fatias de queijo mussarela. 3 para forrar a forma e 4 para misturar com os demais ingredientes;
Modo de preparo:
  •  Bata todos os ingredientes no liquidificador (lembre-se de deixar 3 (das 7) fatias de queijo mussarela para forrar a forma. Obs: para evitar sobrecarregar o liquidificador, bata os ingredientes em duas porções.
  • Unte a forma com manteiga e farinha e forre-a com as 3 fatias de queijo mussarela. Obs: usei uma forma com dimensões de 16cm X 26cm X 4cm.
  • Despeje a massa na forma e leve ao forno por aproximadamente 40 minutos à temperatura de 240 à 270 º C.