wget steam local time - timezone

When I wget any pages from Steam, the dates listed in them aren't my local time, which they are when I open them in a normal web browser instead. With wget, all the time stamps on the downloaded pages are several hours off, so it seems Steam-pages downloaded by wget assume the wrong time zone somehow.
Any idea how to fix this? I already tried
wget --header='Accept-language:xxx'
where xxx is a country code, but it didn't change the time zone/stamps, the only effect was that indeed the sites had a different language then.

Related

how to automaticly upload videos to youtube whit DSM synology and youtube-upload

I'm trying to automaticly upload video's to youtube on mine synology NAS (DS220+)
I've found this link to tokland youtube-upload.
All the steps on this github page I've done correctly (i think but obvious not :)
I think there is a auth problem whit Google and I'm not sure what I'm doing wrong or maybe there is a better way.
Steps I've taken:
-via SSH installed google-api-python-client and ofcourse youtube-upload-master.
-created a chanal and API credentials at youtube for clientsecrets.json
(Here I think I'm going wrong --> not shut what to put in the "Authorized redirect URIs" a.k.a. redirect_uris)
below you found mine client_secrets.json (ofcourse whitout the real client/project id's) but the redirect_uris and javascript_origins is legit (i think but posibly also the problem but realy don't know how to handle this)
{
"web":{
"client_id":"client-id",
"project_id":"project-id",
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"client_secret":"client-secret",
"redirect_uris":["http://localhost"],
"javascript_origins":["http://localhost"]
}
}
In the end I was hoping ( and maybe not even posible but I'm new at this and needed a goal in this corona time) making a simple batch script to call this script when a file apears in a folder and upload it to a chanel in youtube.
batch script:
youtube-upload \
--title="test title" \
--description="test description" \
--category="Music" \
--tags="mutter, beethoven" \
--recording-date="2011-03-10T15:32:17.0Z" \
--default-language="en" \
--default-audio-language="en" \
--client-secrets="/volume1/some/folder/client_secrets.json" \
test.mp4
When I run the above code via SSH on the synology I'm getting a question to enter a verification code.
whish i must get from the link above the question to "read in" the access token ( I think , again I'm new and trying to understand this langues)
When I follow the link I'm getting this site from google instead a code :
I'm realy stuck at this moment and open for some new insight.
All I want to do is upload a video to youtube in a scheduled automatic way from a synology NAS.
Doesn't sound very complicated when i started but couldn't find any good exmples to build on.
Does anybody know what I'm doing wrong or does a better way to do this?
EDIT (for future reference) :
Afther some playing around and help from #stvar I installed a new secrets file:
{
"installed":{
"client_id":"someclientid",
"project_id":"somecprjid",
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"client_secret":"somesecret",
"redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]
}
}
??? Afther this i got another error whish i thought i was creating ???? :
IOError: [Errno 2] No such file or directory: '/var/services/homes/usrname/.youtube-upload-credentials.json'
give it a shot ytb_up based selenium all you need is login into your google account and get a cookie json
https://github.com/wanghaisheng/ytb-up
features YOU MAY NEED
proxy support
auto detect whether need a proxy
2. cookie support
for those multiple channels under same google account
3. schedule time publish
you can explictly specify a date and time for each video or you can set publish policy and daily public count,for example,daily count is 4,you got 5 videos,then first 4 will be published 1 day after the upload date ,the other 1 will be 2 days after the upload date
4. fix google account verify

Change browser timezone in cypress.io (Windows) [duplicate]

I just wrote a little piece of code to show the server time in a webpage. At the moment I just have one machine so I cannot test if the code is working.
Is there a way to tell the browser to use a time configuration different from the one configured in the OS? I have used plugins for Firefox to test different locales, I wonder if there are similar options for time tests.
Thanks.
Create a new empty directory for a separate Chrome user profile. E.g. with
mkdir ~/chrome-profile
You specify the TZ environment variable. You can see the valid timezones for example here, in column TZ.
To start Chrome, use these commands:
for Mac OS X: TZ='US/Pacific' open -na "Google Chrome" --args "--user-data-dir=$HOME/chrome-profile"
for Linux: TZ='US/Pacific' google-chrome "--user-data-dir=$HOME/chrome-profile"
Unfortunately, JavaScript is only aware of the current time zone, as it is set by the operating system. There are no facilities to let the Date object use a different time zone in a particular context. There are some libraries to do time zone conversions, but that won't help for what you are asking.
On Linux, Mac OSX, and other *NIX systems, you can set the TZ environment variable. See Benedikt Köppel's answer for details.
However, there is no facility for this on Windows. Some Windows programs may pick up on the TZ environment variable, but those that do will not necessarily interpret it correctly, as they aren't wired up to support IANA time zone names. More on this here and here.
You don't need to change OS variables or extensions to do this in 2021.
Chrome Dev Tools > Hamburger Menu > More Tools > Sensors
On the Location section select your location or give it a timezone id (e.g. America/Chicago, America/New_York)
On popular demand (kidding!), the explanation.
Google Chrome reads the environment variables to get the timezone its running in. Apparently all instances of Chrome share the value (not tested). In order to force a timezone, we need to a) set the environment variable to the timezone we want, b) kill all existing instances of Chrome, c) Print the current timezone to confirm, and d) Start Chrome with the intended timezone.
The below shell script is tested with OS X but should work for others too.
export TZ='US/Pacific'
killall Chrome
date
open /Applications/Google\ Chrome.app
Chrome seems to update its TimeZone as soon as you change it in Windows. Firefox seems to store the timezone value of the system at startup.
With Visual Studio it looks like you can turn the trick on its head. It seems that the Timezone is only read when you first start the debug process. So In my case, what I did was set the TimeZone to, for example, Eastern Standard Time. Start the Visual Studio debugger. I then changed the TimeZone to, for example, Pacific Standard time. The server at this point remained in the Eastern timezone, while my browser was in the Pacific timezone. Now I was able to test the client browser behavior just fine.
If you wanted to test a client in Japan, then just update your TimeZone and the browser will follow it. As long as you don't restart the debug process your server timezone will not change. Also just changing the time (as opposed to the timezone) did not work.
There is a lot of time zone extensions available to spoof in browser level. I am using currently
After adding click option of the extension and check
Once both done, Go to any website and open developer tools and check by executing below command
new Date().toLocaleTimeString()
Old question, but I had a similar issue and I'll throw my fix in anyways.
What I did was run my server in a virtual machine, set the network settings to bridged so that I'd be able to access the server from my host OS as the client easily.
I then changed time settings in the VM so that there was whatever difference I wanted between the client and server.
Maybe it will help someone. You can change time zone for Windows 10 using this steps:
Open Settings.
Click on Time & Language.
Click on Date & time.
Change time zone to your need.
P.s. According to the #Oscar Acevedo comment this answer is not quite correct. It's suitable for testing different time zones.
This an easies way I tried to chang time zone and test it for windows 7 ^
I use tzutil
tzutil /s "Eastern Standard Time"
and save it to suitable .bat file e.g Eastern_Standard_Time_zone.bat and use default_time_zone.bat conain your original system time zone to get it back after finishin tesing . this will change your time zone in blink .
reference
If you are into reproducibility, I suggest that you use an e2e environment, i.e. tooling that can automate browsers and allows to manipulate their time zone.
That way you won't have to fiddle around with the system time zone and you can add tests, that specifically do use different time zones, i.e. you can test your code in different time zones.
Two of the most recent popular libraries for browser automation, Puppeteer and Playwright explicitly allow setting the time zone. Using Playwright you get the ability to automate setting the time zone for all major evergreen browsers (Safari, Firefox and Chrome / ChromeEdge):
for Puppeteer you have to use page.emulateTimezone
for Playwright you have to use a newContext
You're probably better off leaving your computer timezone intact and changing your server settings to reflect a timezone ahead or behind of you. This is usually pretty easy to do depending on the server you're using.

Centos 6 Wrong timezone displaying on Web Page when pulling from server time

I'm currently having an issue with the wrong timezone displaying on a web page. I support a Linux environment for a small app development team. Currently we are testing a particular app. For test purposes we have a simple web page showing that the app is live and working. The page itself displays the project title and server time.
This issue is that the web page displays the incorrect timezone, however the time itself is correct.The text displayed is "The time on the server is April 5, 2018 7:18:04 AM CDT." For context I've included a screen shoot.
time zone issue
Nothing special going on here. As I said the time is technically correct, but it's displaying Central time when I need it to show Eastern, because the people using the app will be located in the Eastern timezone.
I support the environment itself and am not a developer. However, after speaking with them they ensure me that whatever method is being called is pulling from the server time. I've tested this successfully and am able to manually change the time on the server that it is hosted on, and the web page will reflect that.
Within the environment we are using CentOS 6. Based on my research the timezone information is handled by the file "localtime" within the "etc" directory. I've used several methods to alter this file.
I've tried the following command:
cp /usr/share/zoneinfo/Eastern /etc/localtime
I've also tried variations of the command. The server shows the correct time and timezone, but the timezone displayed on the web page never changes.
We have two servers to host apps. The interesting this is that apps that are hosted on the other server are being displayed correctly with the Eastern timezone. I've also tried simply taking the "localtime" file on the correct server, and copying it to the other server within the /etc/ directory. With each attempt doing a server restart.
I realize this is a simple issue, but after trying multiple methods with no success I thought I would seek assistance. Any help is appreciated.

Testing with JPM Run is Extremely Slow

I just recently switched from using the outdated cfx to jpm for developing my Firefox add-ons. Every time I make a change to my code and want to test it again, I have to use the "jpm run" command it literally takes 3 to 5 minutes to launch the browser with the new code inside. This makes it pretty much impossible to develop my add-on because, every time I want to test a new line of code, I have to wait several minutes.
This kind of problem doesn't occur in Chrome so I'm not sure what the people at Mozilla are thinking. Do they want to make it nearly impossible to develop add-ons for their browser?
What are other Firefox add-on developers doing to test their code? Do they just spend hours launching and relaunching the browser very very slowly? Or is there a workaround?
You can use jpm watchpost together with the extension auto-installer instead to auto-reload the extension in a running firefox session.
But even without that it should not not take minutes, only seconds.
As the8472 has mentioned, you can test Add-on SDK extensions without the need to restart the browser using jpm by using jpm watchpost. Using this appears to take a bit of configuring. I have not used this, as I would find having the add-on automatically updated upon every write to a file a bit annoying. I often change multiple files, or make multiple writes to the same file between the times I run the add-on to test. Basically, I want to maintain more control as to when the add-on is reloaded than to have it automatically done each time a file is changed.
There is a way to load temporary add-ons which works for both unpacked add-ons and .xpi files. The problem is that prior to running jpm, your add-on is not actually a complete Firefox add-on. jpm adds wrappers around the contents of your add-on to make it a normal bootstrapped add-on. Without those wrappers, your add-on will not function. One possibility would be to run jpm xpi each time you want to test a new version: Once you have initially loaded the add-on as a temporary add-on, you would run jpm xpi, then click on the "Reload" button for your add-on in about:debugging.
[This method will have issues which you will need to work through]: Alternately, you could unpack the .xpi file and continue your development from the files contained in the resulting directories while using the temporary add-on method of installing your add-on (click on any file in the directory where you unpacked the files to install as a temporary add-on). However, this method may prevent you from using jpm at all with your add-on. In addition, jpm performs somewhat different actions when packaging your add-on into an .xpi file depending on the contents of your add-on. If so, things may start to break if you significantly change your add-on's functionality (e.g. changes in package.json won't propagate to install.rdf). With this method, you would, probably, need to use a "normal", non-jpm method of creating an .xpi file when you want to publish your add-on.

"Warm Up Cache" on deployment

I am wondering if anyone has any plugins or capistrano recipes that will "pre-heat" the page cache for a rails app by building all of the page cached html at the time the deployment is made, or locally before deployment happens.
I have some mostly static sites that do not change much, and would run faster if the html was already written, instead of requiring one visitor to hit the site.
Rather than create this myself (seems easy but it lowwwww priority) does it already exist?
You could use wget or another program to spider the site. In fact, this sort of scenario is mentioned as one of the uses in its manual page:
This option tells Wget to delete every single file it downloads, after having done so. It is useful for pre-fetching popular pages through a proxy, e.g.:
wget -r -nd --delete-after http://whatever.com/~popular/page/
The -r option is to retrieve recursively, and -nd to not create directories.
I use a rake task that looks like this to refresh my page cached sitemap every night:
require 'action_controller/integration'
ActionController::Base::expire_page("/sitemap.xml")
app = ActionController::Integration::Session.new
app.host = "notexample.com"
app.get("/sitemap.xml")
See http://gist.github.com/122738
I have set integration tests that confirm all of the main areas of the site are available (a few hundred pages in total). They don't do anything that changes data - just pull back the pages and forms.
I don't currently run them when I deploy my production instance, but now you mention it - it may actually be a good idea.
Another alternative would be to pull every page that appears in your sitemap (if you have one, which you probably should). It should be really easy to write a gem / rake script that does that.
Preloading this way -- generally, with a cron job to start at 10pm Pacific to and terminate at 6am Eastern time -- is a nice way to load-balance your site.
Check out the spider_test rails plugin for a simple way to do this in testing.
If you're going to use the wget above, add the --level=, --no-parent, --wait=SECONDS and --waitretry=SECONDS options to throttle your load, and you might as well log and capture the header responses for diagnosis or analysis (change the path from /tmp if desired):
wget -r --level=5 --no-parent --delete-after \
--wait=2 --waitretry=10 \
--server-response \
--append-output=/tmp/spidering-`date "+%Y%m%d"`.log
'http://whatever.com/~popular/page/'

Resources