I use vps with debian 9, mariadb 10.3.x, php7.0 (standard LAMP).
I had to do the update all packages. After remove and install and import database all charcters its look like: "Tch�rzewski"
I check encoding in database (is it set to utf8_general_ci) and all table have that same. In database i have of course correct version of strings.
I also check locale this is output:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=pl_PL.UTF-8
LANGUAGE=
LC_CTYPE="UTF-8"
LC_NUMERIC="UTF-8"
LC_TIME="UTF-8"
LC_COLLATE="UTF-8"
LC_MONETARY="UTF-8"
LC_MESSAGES="UTF-8"
LC_PAPER="UTF-8"
LC_NAME="UTF-8"
LC_ADDRESS="UTF-8"
LC_TELEPHONE="UTF-8"
LC_MEASUREMENT="UTF-8"
LC_IDENTIFICATION="UTF-8"
LC_ALL=UTF-8
I check every file (have meta utf-8) and in php in files i have ini_set('default_charset', 'utf-8')
I try with
header("Content-Type: text/html; charset=utf-8");
but this didnt help
What can i do now? I can reinstall server but I dont want to waste a lot of time for that
I am solved problem with add to PDO mysql-attr_init_command. Now all pdo commands looks like:
$db = new PDO('mysql:host='._DBHOST_.';port=8889;dbname='._DBNAME_, _DBUSER_, _DBPASS_,
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"));
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Related
Official site of elasticsearch says the default config file exists in /home/username/.curator/curator.yml
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/command-line.html
But there is no such folder.
Also, I tried creating curator.yml and give path using --config option. But, it throws me error
curator --config ./curator.yml
Error: no such option: --config
Installation was done using apt
sudo apt-get update && sudo apt-get install elasticsearch-curator
Help me create a config file as I want to delete my log-indexes
Please note that the documentation does not say it that file exists after creation, it says:
If --config and CONFIG.YML are not provided, Curator will look in ~/.curator/curator.yml for the configuration file.
The file must be created by the end user.
Also, if you installed via:
sudo apt-get update && sudo apt-get install elasticsearch-curator
but did not add the official Elastic repository for Curator, then you installed an older version. Please check which version you are running with:
$ curator --version
curator, version 5.4.1
If you do not see the current version (5.4.1 at the time this answer was added), then you do not have the appropriate repository installed.
The official documentation provides an example client configuration file here.
There are also many examples of action files in the examples
Yes, one needs to create both the curator.yml as well as action.yml files.
Since I am on centos 7, I happened to install curator from RPM, and in its default /opt/elastic-curator' I could follow up this good blog (but badly formatted!) : https://anchormen.nl/blog/big-data-services/monitoring-aws-redshift-with-elasticsearch/ to ge the files as follows(you may modify according to your needs) :
curator.yml
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
client:
hosts:
- <host1>
- <host2, likewise upto hostN >
port: 9200
url_prefix:
use_ssl: False
certificate:
client_cert:
client_key:
ssl_no_validate: False
http_auth:
timeout: 30
master_only: False
logging:
loglevel: INFO
logfile: /var/log/curator.log
logformat: default
blacklist: []
and an action.yml as follows :
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: rollover
description: Rollover the index associated with index 'name', which should be in the form of prefix-000001 (or similar),or prefix-YYYY.MM.DD-1.
options:
disable_action: False
name: redshift_metrics_daily
conditions:
max_age: 1d
extra_settings:
index.number_of_shards: 2
index.number_of_replicas: 1
2:
action: rollover
description: Rollover the index associated with index 'name' , which should be in the form of prefix-000001 (or similar), or prefix-YYYY.MM.DD-1.
options:
disable_action: False
name: redshift_query_metadata_daily
conditions:
max_age: 1d
extra_settings:
index.number_of_shards: 2
index.number_of_replicas: 1
On my server I did a search with sudo find . -name "application_controller.rb". There's so many files of that name. Which one should I edit so the changes will be reflected on my server?
./home/myapp/apps/myapp/releases/20140208000704/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140116094931/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140114154804/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140117124202/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140120094758/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140116102758/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140117125636/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140116123905/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140116115403/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140117090645/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140121091622/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140212214841/app/controllers/application_controller.rb
./home/myapp/apps/myapp/releases/20140205001541/app/controllers/application_controller.rb
./home/myapp/apps/myapp/shared/cached-copy/app/controllers/application_controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/best_in_place-1.1.2/test_app/app/controllers/application_co ntroller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/sass-rails-3.2.5/test/fixtures/sass_project/app/controllers /application_controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/sass-rails-3.2.5/test/fixtures/engine_project/app/controlle rs/engine_project/application_controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/sass-rails-3.2.5/test/fixtures/engine_project/test/dummy/ap p/controllers/application_controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/sass-rails-3.2.5/test/fixtures/scss_project/app/controllers /application_controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/devise-2.0.6/test/rails_app/app/controllers/application_con troller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/rest-graph-2.0.1/example/rails3/app/controllers/application _controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/rest-graph-2.0.1/example/rails2/app/controllers/application _controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/generators/rails/app/templates/app /controllers/application_controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/railties-3.2.3/guides/code/getting_started/app/controllers/ application_controller.rb
./home/myapp/apps/myapp/shared/bundle/ruby/1.8/gems/gmaps4rails-1.5.6/spec/dummy/app/controllers/application_co ntroller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/best_in_place-1.1.2/test_app/app/controllers/application_controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/email_spec-1.2.1/examples/rails3_root/app/controllers/application_contr oller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/sass-rails-3.2.5/test/fixtures/sass_project/app/controllers/application _controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/sass-rails-3.2.5/test/fixtures/engine_project/app/controllers/engine_pr oject/application_controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/sass-rails-3.2.5/test/fixtures/engine_project/test/dummy/app/controller s/application_controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/sass-rails-3.2.5/test/fixtures/scss_project/app/controllers/application _controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/devise-2.0.6/test/rails_app/app/controllers/application_controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/rest-graph-2.0.1/example/rails3/app/controllers/application_controller. rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/rest-graph-2.0.1/example/rails2/app/controllers/application_controller. rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/railties-3.2.3/lib/rails/generators/rails/app/templates/app/controllers /application_controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/railties-3.2.3/guides/code/getting_started/app/controllers/application_ controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails3.0/app/controllers/application_control ler.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails3.2/app/controllers/application_control ler.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails2.3/app/controllers/application_control ler.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails4.0/app/controllers/application_control ler.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails3.1/app/controllers/application_control ler.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails_apps/2.3/empty/app/controllers/applica tion_controller.rb
./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails_apps/2.3/mycook/app/controllers/applic ation_controller.rb
myapp#myapp:/$ sufo nano ./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails_apps/ 2.3/mycook/app/controllers/application_controller.rb
-bash: sufo: command not found
myapp#myapp:/$ sudo nano ./home/myapp/.rvm/gems/ruby-1.8.7-p374/gems/passenger-4.0.14/test/stub/rails_apps/ 2.3/mycook/app/controllers/application_controller.rb
myapp#myapp:/$
You shouldn't change any of them. Really.
./home/myapp/apps/myapp/releases suggests you are using something like Capistrano to deploy your application. You should update your source code, commit, and deploy it.
If that's not an option, then you should see if ./home/myapp/apps/myapp/current/app/controllers/application_controller.rb exists and edit that. If not, pick the most recent version in `./home/myapp/apps/myapp/releases.
Once edited you'll need to restart the web server for it to pick up the changes.
Again.. I would highly suggest not doing this unless you have no other option.
Windows 10
Elixir 1.3.1
Per the advice in this article, I've tried to modify my config files to use the "${ENV_VAR}" syntax. But then when I try to compile the code Elixir complains about the values of the configuration settings. So I tried the syntax directly in iex and it doesn't seem to work.
iex(1)> "${PATH}"
"${PATH}"
iex(2)> System.get_env("PATH")
"C:\\Program Files\\erl8.0\\erts-8.0\\bin;C: . . ." (rest omitted for brevity's sake)
I'd really like to use the "${ENV_VAR}" notation because it'd be nice to not have to hand-edit the sys.config file. Am I doing something wrong or is this just a Windows specific issue?
Here's part of my config file (even though, as I say, it seems I can reproduce the behavior in iex):
config :riismi, ecto_repos: [Riismi.Repo]
config :riismi, Riismi.Mailer,
adapter: Bamboo.SMTPAdapter,
server: "smtp.gmail.com",
port: 465,
username: "${RMI_MAIL_SERVERUSER}",
password: "${RMI_MAIL_SERVERPWD}",
tls: :if_available, # can be `:always` or `:never` or `:if_available`
ssl: true, # can be `true`
retries: 3
As I say, I realize this is likely to be a Windows issue--just wanted to insure that I'm not missing something otherwise.
I try to run this command to build model in my symfony project(1.4) :
php symfony propel:build-model( or all )
I have this error :
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 20 bytes) in /home/sfprojects/jobeet/lib/vendor/symfony/lib/util/sfClassManipulator.class.php on line 176
I searched before asking people here so I changed memory_limit = 64M in my php.ini to 128M , 510M , 1024M ... but I have the same error that really get me crazy!
I'm using Ubuntu with apache2,php5...
Make sure you edited your php.ini file for php-cli and not for Apache.
In /etc/php5/cli/php.ini for your Ubuntu.
Edit: Sorry, this was meant as a response to How can I increase the allowed memory size in Symfony? (I had both open at the same time.)
You probably have something like this in your composer.json:
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
Replace it by
"scripts": {
"auto-scripts": {
"php -dmemory_limit=512M bin/console cache:clear": "script",
You should avoid putting dump in loops in your
Controllers
or in your twig templates with
{% for row in rows %}
{{ dump(row) }}
{% endfor %}
However this wont probably solve it, in your .htaccess of your project root folder (/web), add the following line:
php_value memory_limit 1024M
Pay attention to what Bruno-P already told you, make sure that you are already changing the right php.ini file for your symfony project. If you have more than one php installation its possible that you are changing an old file.
Make sure also you are typing it right in your php.ini:
Symfony 1.4: PHP Fatal error: Allowed memory size of 33554432 bytes exhausted
Clear symfony cache (symfony cc), close the web server and execute the command again:
symfony propel:build-model
You may also check your php configuration for your memory values limit set. Make a new file in your project with the content:
<?php
phpinfo();
?>
Install Symfony from the oficial page.
symfony composer update
symfony composer = Runs Composer without memory limit
Try putting:
<?php ini_set('memory_limit', '3G'); ?>
at the top of your ./symfony file.
in rails 3 sendmail_settings, there is a option :location which represent the location of the sendmail executable (Defaults to /usr/sbin/sendmail). In my ubuntu OS machine, there is no such file under /usr/sbin, how can I get /usr/sbin/sendmail executable then?
If you want to override options for the :sendmail delivery method then you can use sendmail_settings. You can override these setting in your environment file.
config.action_mailer.sendmail_settings = {
:location => '/usr/sbin/sendmail',
:arguments => '-i -t'
}
sudo apt-get install sendmail-bin. You should have done a search using a package manager. It's ubuntu.. Also it looks like gzipped executables can be found all over the web.