Mostrando postagens com marcador Windows. Mostrar todas as postagens
Mostrando postagens com marcador Windows. Mostrar todas as postagens

terça-feira, 19 de janeiro de 2016

MONGORESTORE - WINDOWS

The restore will restore the dump.

C:\MyData\TI\Software\DataBase\MongoDB\Course\chapter_1_introduction.a560c7cceb68\homework_1_1\hw1-1>mongorestore

segunda-feira, 28 de maio de 2012

Mudar o domínio localhost - Windows

Às vezes você precisa mudar o domínio da sua máquina, ou acrescentar outro além do localhost que você já tem.

Know-how:
C:\Windows\System32\drivers\etc\host

Abaixo acrescentei o domínio netdaniels.com.

Depois disso é só reiniciar a máquina e testar.


# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost

127.0.0.1 localhost
127.0.0.1 netdaniels.com


domingo, 27 de maio de 2012

Fatal error: Call to undefined function curl_init()

Veja bem,

estava eu trabalhando com o yii (framework php) e tomei este erro
Fatal error: Call to undefined function curl_init()
Obs: Estou usando o XAMPP

Como resolve?

Acesse o arquivo php.ini
xxxxxx\php\php.ini
descomente
;extension=php_curl.dll
tira o ponto e vírcula
extension=php_curl.dll
Reinicia a máquina.

Voilà!

Problemas com acentuação (a revanche)


Veja bem,

O conteúdo que vem do banco do MySql estava vindo perfeito. Entretanto os labels, das páginas PHP estava aparecendo com problemas.

Exemplo:

Arboriza��o *

Como resolvi:

$label_arborizacao = utf8_encode("Arborização");
echo $label_arborizacao;

Resultado

Arborização.

Voilà!

Problemas com acentuação


Veja bem,

depois de importar centenas de milhares de linhas para o meu banco MySql, descobri que a acentuação estava toda equivocada.

ã aparecia como este sinal |-

Como resolvi:

Estou usando o MySql.exe. Uso o prompt do DOS. A performance é melhor.

MySql.exe -u root -p
<b>&gt; charset Latin1</b>
source C:\xxx\xxx\xxx\arquivo.sql

Voilà!

Apesar do collation das tabelas estar
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

ao mudar o charset antes da importação, os acentos da nosso idioma não são afetados.

And that's it.

sábado, 26 de maio de 2012

Substituição de caracteres de arquivos via DOS


Achei uma bat para fazer replace de caracteres em arquivos muito grandes
O nome da bat é : BatchSubstitute.bat

Estou testando com um arquivo de 50 MB.


Visite : http://www.dostips.com/?t=batch.findandreplace 

Description:This batch allows string substitution in a text file. It parses each line of a text file for a particular string and replaces it with another string.
I.e. To replace all occurrences of "Yellow Submarine" in "color.txt" with "uboot" and put the output on the screen run:
BatchSubstitute.bat "Yellow Submarine" uboot color.txt
Or
type color.txt|BatchSubstitute.bat "Yellow Submarine" uboot

Optionally pipe the output into a new file, i.e.
BatchSubstitute.bat "Yellow Submarine" uboot color.txt>newfile.txt
Or
type color.txt|BatchSubstitute.bat "Yellow Submarine" uboot>newfile.txt
Note: Due to the nature of the FOR command and string substitution, the following known restrictions apply:
  • Lines starting with "]" character will end up empty
  • OldStr must not start with "*"
  • Lines must not contain any of the following characters within a quoted string: "&<>|^"


echo off
REM -- Prepare the Command Processor --
SETLOCAL ENABLEEXTENSIONS
SETLOCAL DISABLEDELAYEDEXPANSION

::BatchSubstitude - parses a File line by line and replaces a substring"
::syntax: BatchSubstitude.bat OldStr NewStr File
::          OldStr [in] - string to be replaced
::          NewStr [in] - string to replace with
::          File   [in] - file to be parsed
:$changed 20100115
:$source http://www.dostips.com
if "%~1"=="" findstr "^::" "%~f0"&GOTO:EOF
for /f "tokens=1,* delims=]" %%A in ('"type %3|find /n /v """') do (
    set "line=%%B"
    if defined line (
        call set "line=echo.%%line:%~1=%~2%%"
        for /f "delims=" %%X in ('"echo."%%line%%""') do %%~X
    ) ELSE echo.
)

sexta-feira, 25 de maio de 2012

MySQL - ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'db'

Veja bem,
Estava eu tentando connectar no MySQL via bin\MySQL.exe e recebia esta mensagem sem parar
Access denied for user ''@'localhost' to database 'db'
Isso acontece porque você não pode chamar o executável direto. Não seja uma anta como eu que demorou um tempão para descobrir que precisa passar um usuário e uma senha:
1 - Vá no prompt do DOS cmd
2 - Digite MySQL.exe -u root -p [digite aqui a password]
Se a sua password está vazia que nem a minha vai aparecer uma outra linha
password:
Apenas dê enter e pronto.
Tudo funcionará como mágica.