Metar URL in binary??!! What a rookie mistake!

Talking about the core development, vent steam ... censoring free but no guarantee, "they" will listen.
User avatar
Sanni
Posts: 52
Joined: Sat Sep 26, 2015 7:39 pm

Re: Metar URL in binary??!! What a rookie mistake!

Postby Sanni » Wed Aug 24, 2016 10:24 pm

I'm using 2016.2.1 with Linux. The address is in a binary called 'metar'.
And it doesn't matter if I use the old or the new address with singel or double backslashes -- metar isn't working.....
Can anyone tell me what's wrong?!?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Metar URL in binary??!! What a rookie mistake!

Postby IAHM-COL » Wed Aug 24, 2016 10:26 pm

The address is in a binary called 'fgfs' :D

If you can do a binary editing (see here: )
Then you can try fixing this yourself.

IH-COL

See: https://forum.flightgear.org/viewtopic. ... 36#p291851
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
Sanni
Posts: 52
Joined: Sat Sep 26, 2015 7:39 pm

Re: Metar URL in binary??!! What a rookie mistake!

Postby Sanni » Wed Aug 24, 2016 10:34 pm

Editing 'fgfs' with emacs and searching for 'observations': failing I-search :(
but found it in 'metar'!

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Metar URL in binary??!! What a rookie mistake!

Postby IAHM-COL » Wed Aug 24, 2016 11:09 pm

:(
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

KL-666
Posts: 1610
Joined: Mon Sep 28, 2015 8:42 am

Re: Metar URL in binary??!! What a rookie mistake!

Postby KL-666 » Wed Aug 24, 2016 11:26 pm

You better search for "noaa", as that is a quite distinguishing feature of the url.

Kind regards, vincent

User avatar
Sanni
Posts: 52
Joined: Sat Sep 26, 2015 7:39 pm

Re: Metar URL in binary??!! What a rookie mistake!

Postby Sanni » Thu Aug 25, 2016 10:11 pm

You can find 'noaa' so many times ....
...'observations' is part of both links.

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Metar URL in binary??!! What a rookie mistake!

Postby IAHM-COL » Thu Aug 25, 2016 10:23 pm

Hi Sanni
Read simpler alternative solution below


I am going to dare a rather cryptic solution below. Note that I HAVE NOT TESTED THIS since I compiled myself the corrected binary 2016.3.
I believe it can work on Linux systems.
* Need to replace /path/to/bin with whatever is the proper binary path in your system (where fgfs is stored); if in doubt, check

Code: Select all

which fgfs


1. Backup!

beware we are risking the binary with the following steps

Code: Select all

cd ~/               #best executed as regular user at home
cp /path/to/bin/fgfs ./fgfs.bk -vi
cp /path/to/bin/fgfs ./fgfs -vi


With this step above you created the file fgfs.bk which is the safe backup of the fgfs binary. If we mess up you can restore like

Code: Select all

sudo cp fgfs.bk /path/to/bin/fgfs


2. Edit the binary
We will hexdump the binary first (hexdump), then replace (sed), and then restore the binary (xxd)

Note1: It is a single command
Note2: You really want to use the copy/paste method here, since this is not typo-friendly --beside looking like chicken-scratch.

Code: Select all

hexdump -ve '1/1 "%.2X"' fgfs | \
sed "s@http://weather.noaa.gov/pub/data/observations/metar/stations/@http://tgftp.nws.noaa.gov/data/observations/metar//stations//@g" | \
xxd -r -p > fgfs.patched


3. Replace the binary
Now you have 3 fgfs files. The original (fgfs) the backup (fgfs.bk) and the edited (fgfs.patched)
Simply replace the original with the edited, and try your patched file

Code: Select all

sudo cp fgfs.patched /path/to/bin/fgfs -vi
fgfs


Let us know if this gets you back in byzz.

IH-COL
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Metar URL in binary??!! What a rookie mistake!

Postby IAHM-COL » Thu Aug 25, 2016 11:32 pm

@Sanni: A simpler alternative


**ONLY LINUX**


Hi Sanni, The commands above maybe scary. (they are)
I created an script that I think maybe able to do the job in any linux FlightGear.

https://github.com/FGDATA/chatter.patch/blob/master/fixmetar

After download the script fixmetar above, give it executable permissions:

To download

Code: Select all

wget https://raw.githubusercontent.com/FGDATA/chatter.patch/master/fixmetar


To authorize

Code: Select all

chmod 755 fixmetar


Then execute with sudo permissions

Code: Select all

sudo ./fixmetar



That can do it.

IH-COL
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
Sanni
Posts: 52
Joined: Sat Sep 26, 2015 7:39 pm

Re: Metar URL in binary??!! What a rookie mistake!

Postby Sanni » Mon Sep 12, 2016 7:06 pm

Your script doesn't work :(
So I did it manually: No live weather..... 8|
I will wait to the next FG version :)

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Metar URL in binary??!! What a rookie mistake!

Postby IAHM-COL » Mon Sep 12, 2016 10:16 pm

Sanni wrote:Your script doesn't work :(
So I did it manually: No live weather..... 8|
I will wait to the next FG version :)



Oh OK
It was worth the try
Anyways, no much longer wait.
The release Rio 2016.3 is out today

Safe flight Sanni,
IAHM-COL

http://thejabberwocky.net/viewtopic.php ... 549#p13549

https://sourceforge.net/projects/flightgear/files/release-2016.3/
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?


Return to “Core Development”

Who is online

Users browsing this forum: No registered users and 2 guests