Skip to content

Instantly share code, notes, and snippets.

View danilobatistaqueiroz's full-sized avatar

Danilo Batista de Queiroz danilobatistaqueiroz

View GitHub Profile
@danilobatistaqueiroz
danilobatistaqueiroz / debug_php_with_brackets.md
Created October 26, 2017 19:31
debugging php code with brackets
@danilobatistaqueiroz
danilobatistaqueiroz / mongodb_tips.md
Last active November 5, 2017 03:34
MongoDB Tips

MongoDB Tips

Some characteristics

Auto-sharding

Index on any attribute

Conversion/mapping of application objects to database objects not needed.

configuring php extension for mongodb

download the PECL extension:

https://pecl.php.net/package/mongodb

download and unpack the file: mongodb.dll or mongodb.so in the directory ext

open php.ini and configure the extension:

extension=php_mongodb.dll

@danilobatistaqueiroz
danilobatistaqueiroz / rewrite_subfolders.md
Last active November 6, 2017 02:24
Rewrite urls on subdirectories on apache

Rewriting Urls on Apache2

Supose you have a directory structure like that:

directories

and on httpd.conf you have:

DocumentRoot c:\www

@danilobatistaqueiroz
danilobatistaqueiroz / php_code_lint.md
Last active November 12, 2017 02:26
Tutorial Php Lint Coding Standards Fixer

Tutorial Php Lint Coding Standards Fixer

PHPMD

install phpmd:

composer require phpmd/phpmd

run phpmd:

@danilobatistaqueiroz
danilobatistaqueiroz / connection_on_ubuntu_using_windows.md
Last active November 12, 2017 02:27
Connection on Ubuntu using Windows 7

Remote Accessing an Ubuntu using Windows 7

Add an iptables rule: iptables -A INPUT -p tcp -m multiport --destination-ports 3350 -i lo -j ACCEPT

Install ssh server: sudo apt-get install openssh-server

Inside dconf-tools - remote-access - Uncheck the option: require-encryption

An excelent client for Windows: MobaXterm

@danilobatistaqueiroz
danilobatistaqueiroz / ubuntu_qemu.md
Last active November 24, 2017 00:28
Virtualizing Ubuntu with QEMU for Windows

Virtualizing Ubuntu with QEMU for Windows

download the latest version:
https://qemu.weilnetz.de/w64/

unpack

create a virtual disk:
qemu-img create ubuntu.img 20G

@danilobatistaqueiroz
danilobatistaqueiroz / mysql_tips.md
Last active November 24, 2017 00:29
Mysql Tips

Mysql Tips

open MySql Shell

mysqlshell

digit:

\sql
\c root@localhost

@danilobatistaqueiroz
danilobatistaqueiroz / postgresql_tips.md
Last active November 24, 2017 00:29
Postgresql Tips

Postgres Tips

jdbc_url: jdbc:postgresql://localhost:5432/databasename

showing all databases:

SELECT datname FROM pg_database WHERE datistemplate = false;

This lists tables in the current database

@danilobatistaqueiroz
danilobatistaqueiroz / configuring_phpunit.md
Last active November 24, 2017 00:30
configuring phpunit

Configuring phpunit

to use phpunit you can download the phpunit.phar:

phpunit.phar file

After downloading, copy phpunit.phar file into a folder

(you can download in a folder that is mapped on %PATH% environment variable, or in the project folder)