How to fix difference of hours in timezone settings [ gnome timer ] - timezone

It is generally known that Bangkok have UTC+7.
But unfortunately my gnome timer shows UTC+4 for Bangkok
When I checking it by console I see
timedatectl status
Local time: śro 2023-02-08 10:59:07 +07
Universal time: śro 2023-02-08 03:59:07 UTC
RTC time: śro 2023-02-08 03:59:07
Time zone: Asia/Bangkok (+07, +0700)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
So problem is probably with gnome timer.
I found issue describing this problem but it is closed. And 7 open issues connected with time zone for gnome clock.

Related

Crunchy Postgres log messages

I am new to Crunchy Postgres, and recently I installed a Crunchy PostgresCluster on an openshift environment. After the cluster was started, I had a look at the container log messages.
I also checked script startup.sh , which is called during Postgresql startup. In this shell script, there are some lines (begin with echo_info) used for log messsages, for example:
echo_info "Starting PostgreSQL.."
But I could not see this message in the logs.
NAME READY STATUS RESTARTS AGE ROLE
demo-instance1-4vtv-0 5/5 Running 0 7h36m replica
demo-instance1-dg7j-0 5/5 Running 0 7h36m replica
demo-instance1-f696-0 5/5 Running 0 7h36m master
:~$ oc logs -f demo-instance1-f696-0 -c database | more
2022-07-08 07:42:31,064 INFO: No PostgreSQL configuration items changed, nothing to reload.
2022-07-08 07:42:31,068 INFO: Lock owner: None; I am demo-instance1-f696-0
2022-07-08 07:42:31,383 INFO: trying to bootstrap a new cluster
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf-8".
The default text search configuration will be set to "english".
Data page checksums are enabled.
fixing permissions on existing directory /pgdata/pg14 ... ok
creating directory /pgdata/pg14_wal ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/usr/pgsql-14/bin/pg_ctl -D /pgdata/pg14 -l logfile start
2022-07-08 07:42:35.953 UTC [92] LOG: pgaudit extension initialized
2022-07-08 07:42:35,955 INFO: postmaster pid=92
/tmp/postgres:5432 - no response
2022-07-08 07:42:35.998 UTC [92] LOG: redirecting log output to logging collector process
2022-07-08 07:42:35.998 UTC [92] HINT: Future log output will appear in directory "log".
/tmp/postgres:5432 - accepting connections
/tmp/postgres:5432 - accepting connections
2022-07-08 07:42:37,038 INFO: establishing a new patroni connection to the postgres cluster
2022-07-08 07:42:37,334 INFO: running post_bootstrap
2022-07-08 07:42:37,754 INFO: initialized a new cluster
2022-07-08 07:42:38,039 INFO: no action. I am (demo-instance1-f696-0), the leader with the lock
2022-07-08 07:42:48,504 INFO: no action. I am (demo-instance1-f696-0), the leader with the lock
2022-07-08 07:42:58,476 INFO: no action. I am (demo-instance1-f696-0), the leader with the lock
2022-07-08 07:43:08,497 INFO: no action. I am (demo-instance1-f696-0), the leader with the lock

highcharts-export-server always produces blank PNG

I'm trying to use highcharts-export-server in command-line/batch mode. I've installed the latest version (2.0.28). I'm running Windows 10 with Node 12.
I'm running it from the command line using the following command:
highcharts-export-server --nologo 1 --logLevel 4 --options chart.json --outfile chart.png --type png --width 500
The console output says:
starting highcharts export server v2.0.28...
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] attaching exit listeners to the process..
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] Pool started:
maxWorkers: 1
initialWorkers: 1
workLimit: 60
listening to process exit: true
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] phantom 1 - spawning worker
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] starting export
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] attempting to export from raw input
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] phantom - received work, finding available worker
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] phantom - found available worker
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] phantom 1 - starting work
Fri Sep 25 2020 15:07:52 GMT+0100 (British Summer Time) [notice] phantom worker 1 finished work ??? in 3562 ms
Fri Sep 25 2020 15:07:52 GMT+0100 (British Summer Time) [notice] phantom worker 1 - process was closed
Fri Sep 25 2020 15:07:52 GMT+0100 (British Summer Time) [notice] terminating, killing all running phantom processes
...but although a chart.png file is created and has the correct width, it's blank (transparent):
This is the content of the chart.json file, which I took from one of the examples on the Highcharts website:
{
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
}
Note: I'll mention that when I first tried to install highcharts-export-server I hit a different problem which was that I couldn't run it at all (it failed with uncaughtException: TypeError: "file" argument must be a non-empty string). After some googling I found some blog posts suggesting that I needed to install PhantomJS first, and to use the --unsafe-perm option. So, the commands I actually used to install it was:
npm install phantomjs --unsafe-perm
npm install highcharts-export-server --unsafe-perm
Oh, and it wasn't until some time later that I realised I might have to install Highcharts itself :-) So I did that too (npm install highcharts), but it didn't actually seem to make a difference.
In case this helps anyone else, here is the full conversation about this issue on the Highcharts Forum.
In summary, it turned out that the NPM package was improperly installed (due to a firewall issue).
This wasn't apparent from the installation logs, but the effect was that in the node_modules/highcharts/export-server/phantom/export.html file there was a script block that should have contained minified JavaScript but that actually contained only lines saying undefined;.
The fix in my case (to work around the firewall issue) was to specify an http URL for the CDN when installing Highcharts Export Server, rather than the default URL which uses https. Once I'd done that, the export.html did contain the minified JS code, and the tool worked correctly.

Rails isn't applying daylight saving time

My server's clock is set to London time (I'm currently living in the GMT+0 zone). The output of timedatectl status gives me this:
Local time: Mon 2016-05-23 08:13:06 BST Universal time: Mon 2016-05-23 07:13:06 UTC
RTC time: Mon 2016-05-23 07:13:06
Timezone: Europe/London (BST, +0100)
NTP enabled: yes NTP synchronized: no RTC in local TZ: no
DST active: yes Last DST change: DST began at
Sun 2016-03-27 00:59:59 GMT
Sun 2016-03-27 02:00:00 BST Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2016-10-30 01:59:59 BST
Sun 2016-10-30 01:00:00 GMT
And in my application.rb file I set the timezone:
config.time_zone = 'London'
Locally, it works right:
Time.now.dst?
# true
Time.now.hour
# 8
But in production it doesn't seem that DST is on.
Time.now.dst?
# false
Time.now.hour
# 7
I am not sure if it's a Rails thing or a server misconfiguration, but for me it seems right.
If this application is running within a docker container, the timezone of the host server may not be applied to the containers. You can probably set the TZ environment variable to whatever timezone you'd like and ruby will pick it up.
I highly recommend not using non-UTC timezone for your application/database, as it will almost certainly cause problems down the line.
Full disclosure: I am one of the dokku maintainers.

Timeout error when doing a search in a web page using protractor

I've done a lot of searching on the web for this issue and haven't found a solution. I am using Protractor to drive a web test and perform a search query in the UI. The results take a while to come back (approximately 8 minutes). I added the 'allScriptsTimeout' argument to my config file for 10 minutes, but it doesn't seem to help. The timeout error appears every time at the 5 minute mark, regardless. Any ideas on what else I can try in order to bypass this seemingly hard-set timeout? The error I am getting is this (partial):
ScriptTimeoutError: timeout: Timed out receiving message from renderer: 299.988
(Session info: chrome=36.0.1985.143)
(Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86) (WARNI
NG: The server did not provide any stacktrace information)
Command duration or timeout: 300.13 seconds
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_67'
Session ID: dc370ac53e9afba8a2f69e82e0c42d0b
Driver info: org.openqa.selenium.chrome.ChromeDriver
....
Try to also specify setScriptTimeout and pageLoadTimeout to 20 minutes like this:
browser.manage().timeouts().setScriptTimeout(60*20*1000);
// Warning: Below option is not supported in Safari webdriver
browser.manage().timeouts().pageLoadTimeout(60*20*1000);

ConnectionFailure using mongo in rails 3.1

I have an app setup with Rails 3.1, Mongo 1.4.0, Mongoid 2.2.4.
What I am experiencing is this:
Mongo::ConnectionFailure: Failed to connect to a master node at localhost:27017
I've had this problem before, but it went away on a computer restart... this time it does not.
I don't understand, I didn't do anything. I just put my computer in sleep mode, went home and woke it up, then there it was.
Here is the output of sudo mongod
Fri Nov 25 21:47:14 [initandlisten] MongoDB starting : pid=1963 port=27017 dbpath=/data/db/ 64-bit host=xxx.local
Fri Nov 25 21:47:14 [initandlisten] db version v2.0.0, pdfile version 4.5
Fri Nov 25 21:47:14 [initandlisten] git version: 695c67dff0ffc361b8568a13366f027caa406222
Fri Nov 25 21:47:14 [initandlisten] build info: Darwin erh2.10gen.cc 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40
Fri Nov 25 21:47:14 [initandlisten] options: {}
Fri Nov 25 21:47:14 [initandlisten] journal dir=/data/db/journal
Fri Nov 25 21:47:14 [initandlisten] recover : no journal files present, no recovery needed
Fri Nov 25 21:47:15 [websvr] admin web console waiting for connections on port 28017
Fri Nov 25 21:47:15 [initandlisten] waiting for connections on port 27017
And I am able to connect with mongoin terminal.
After 2 hours of Googling I hope the competence of SOs community are able to figure this out.
Please, if you need more information about my app-setup just ask.
Thanks!
What you see is that the connection times out... that happens either after a long period of inactivity, or if you put your computer to sleep.
You can change / increase the timeout value, but this way you can't get rid of the connection timing out eventually.
Some MongoDB drivers allow to set :timeout => false , but Mongoid seems to still have problems with that
(see last 3 links in the list)
Hope this helps.
See also:
Mongodb server goes down, how to prevent Rails app from timing out?
MongoDB: What is connection pooling and timeout?
https://github.com/mongodb/mongo-ruby-driver
How can I query mongodb using mongoid/rails without timing out?
http://groups.google.com/group/mongoid/browse_thread/thread/b5c94e7047b42f8a
https://github.com/mongoid/mongoid/issues/455
Try to change localhost to 127.0.0.1!

Resources