KMZ do not show of my icons - kml

Earlier, I tried to put the file on the host kml. My question here Not showing the path in KML. Now I created new file kmz on the recommendations of Google. File here: http://tourist-sweden.se/transport/map/sthlm/t-11-1.kmz . Calling map: http://tourist-sweden.se/transport/map/sthlm/t-11-bana.html
Now maps show only the path but do not show of my icons. What a mistake again in my maps? Are there any robust and simple alternative to kml?

Your KMZ file is not correct. If you zip up the t-11 directory, it works:
It currently looks like this:
[lross#JJ kmz]$ unzip -l t-11-1.kmz
Archive: t-11-1.kmz
Length Date Time Name
-------- ---- ---- ----
0 07-07-13 12:06 t-11/
3655 07-07-13 12:43 t-11/t-11-bana.kml
0 07-07-13 12:08 t-11/files/
1039 07-04-13 21:21 t-11/files/subway-blue.png
If you create it from the t-11 directory so it looks like this, it works:
[lross#JJ t-11]$ unzip -l t-11-1a.kmz
Archive: t-11-1a.kmz
Length Date Time Name
-------- ---- ---- ----
0 07-07-13 12:08 files/
3655 07-07-13 12:43 t-11-bana.kml
1039 07-04-13 21:21 files/subway-blue.png
http://www.geocodezip.com/v3_GoogleEx_layer-kml_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/kmz/t-11-1a.kmz

Related

Get a value from xml file inside a war file without extracting

I want to read a line from a jsp file present in my war file. The path of the jsp file is always the same, so I know where exactly to look for. How do I grep the line from the jsp inside the war file, without extracting the whole war file? I don't want to extract because it would take at least couple of minutes to finish, and I just want to get the version value (1.2.3.210) from that line. This is how the structure looks like -
war file name --> final.war
jsp location inside the war file --> folder1/folder2/version.jsp
line inside the jsp file --> <param><value>version=1.2.3.210</value></param>
A .war file is just a zip file, so we can use unzip to do what you want. Let's say I have a file sample.war with the following content:
Archive: ../sample.war
Length Date Time Name
--------- ---------- ----- ----
376 07-30-2007 16:26 hello.jsp
0 07-30-2007 16:26 images/
1441 07-30-2007 16:26 images/tomcat.gif
636 07-30-2007 16:26 index.html
0 07-30-2007 17:18 META-INF/
106 07-30-2007 17:18 META-INF/MANIFEST.MF
0 07-30-2007 16:26 WEB-INF/
0 07-30-2007 16:26 WEB-INF/lib/
813 07-30-2007 16:26 WEB-INF/web.xml
0 07-30-2007 16:26 WEB-INF/classes/
0 07-30-2007 16:26 WEB-INF/classes/mypackage/
1480 07-30-2007 16:26 WEB-INF/classes/mypackage/Hello.class
--------- -------
4852 12 files
I can use unzip to extract the file index.html to stdout like this:
unzip -p sample.war index.html
To get a particular line from the output, you can just pipe it into sed. For example, to extract the line containing <title>:
$ unzip -p sample.war index.html | sed -n '/<title>/p'
<title>Sample "Hello, World" Application</title>
This worked for me. I did not have to install jar, as it was already available in CentOS
jar -xf final.war folder1/folder2/version.jsp

Zip archive contain files without names, how to unzip it?

I have a ZIP archive with some photos in it.
Problem is, I am not able to unzip all files from this archive.
Unzip command:
unzip archive.zip
Archive: archive.zip
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
mapname: conversion of failed
List of file inside ZIP archive (each file is without is name ...):
unzip -l archive.zip
Archive: archive.zip
Length Date Time Name
--------- ---------- ----- ----
61684 03-07-2019 10:01
55901 03-07-2019 10:01
71678 03-07-2019 10:01
69684 03-07-2019 10:01
57131 03-07-2019 10:01
95984 03-07-2019 10:01
69633 03-07-2019 10:01
73401 03-07-2019 10:01
79661 03-07-2019 10:01
53126 03-07-2019 10:01
68691 03-07-2019 10:01
66707 03-07-2019 10:01
--------- -------
823281 12 files
Unzip testing command:
unzip -t archive.zip
Archive: archive.zip
testing: OK
testing: OK
testing: OK
testing: OK
testing: OK
testing: OK
testing: OK
testing: OK
testing: OK
testing: OK
testing: OK
testing: OK
If I try pipe command of unzip, then I have one JPEG file which contains all photos of archive.
unzip -p archive.zip | cat > $(date +%s%3N).jpeg
Please, is any chance for unzip archive like this?
UPDATED
When show ZIP archive in the HEX editor, then I see archived files has not set the names. On the image is end of ZIP file, it contain informations about each files of archive. Selected Bytes on the image represent information container of one archived file.
First your locale in the shell should not be ASCII, I think as simple Linux user.
locale
It could the archive's encoding. UTF-16/UTF-32 big endian springs to mind, as for ASCII letters a preceding nul byte would account for an empty string.
unzip -O UTF-16BE -l archive.zip
unzip -O UTF-16BE archive.zip
Some programming required otherwise, either patching the names or iterating through the entries and picking your own name to store every file. Java ZipInputStream would do.
I think this is the case, someone programmed to zip a directory but forgot to set the entry's file name.

Zipping a folder in linux gives different size with different user

I have a folder which i want to create tgz file and compute its sha256:
The folder is converted to tgz using following command
"tar -c -C #{Shellwords.escape dir} #{Shellwords.escape basename} " \
"--owner=0 --group=0 --mtime='2000-01-01 00:00:00' | gzip -n > #{Shellwords.escape file}"
Now i ran the above process using 2 separate users and it gave me 2 files: 1 and 2
Both tgz files differ in sizes:
-rw-r--r--# 1 myuser \Domain Users 9024 Jul 31 14:28 1.tgz
-rw-r--r--# 1 myuser \Domain Users 9037 Jul 31 14:29 2.tgz
If i try to compute diff between files i dont see any diff.Diff was obtained using following command.
diff <(tar -tvf 1.tgz | sort) <(tar -tvf 2.tgz | sort)
If i compute sha256 using ruby of these 2 files , then it differs.
The question is : Why do i get difference in tgz files when running from different users.
the differences are in the headers, the header of each file in a tar contains the user and group id. see https://en.wikipedia.org/wiki/Tar_(computing)#Header .
Also modern tar adds additional data called Ustar to the header: https://en.wikipedia.org/wiki/Tar_(computing)#UStar_format
which contains also the owner username.
try:
diff <(gunzip -c 1.tgz | xxd) <(gunzip -c 1.tgz | xxd)
and you'll see the difference

Ftp backup folder download as files,, i cant find .tar.gz files

i create backup folder in ftp server , and send all my .tar.gz file into /backup folder
using (put file.tar.gz backup)
while i retrieve backup,, i get backup folder as backup files. ,, how to convert the file to folder ..
ftp server
ls
227 Entering Passive Mode (10,21,131,105,76,56)
150 Accepted data connection
drwxr-xr-x 6 100 ftpgroup 7 Oct 20 19:57 .
drwxr-xr-x 6 100 ftpgroup 7 Oct 20 19:57 ..
-r-------- 1 100 ftpgroup 84 Oct 21 11:15 .banner
drwxrwxrwx 3 100 ftpgroup 4 Oct 20 18:28 backup
drwxrwxrwx 2 100 ftpgroup 3 Oct 20 19:45 dailybackup
drwxrwxr-x 2 100 ftpgroup 3 Oct 20 19:57 hi5songs
drwxrwxr-x 2 100 ftpgroup 3 Oct 20 19:49 whole
226-Options: -a -l
226 7 matches total
i tried :
ftp> mget backup``
mget .? y
227 Entering Passive Mode (10,21,131,105,62,8)
550 I can only retrieve regular files
mget ..? y
Warning: embedded .. in .. (changing to !!)
227 Entering Passive Mode (10,21,131,105,46,39)
550 Can't open !!: No such file or directory
mget backup? y
227 Entering Passive Mode (10,21,131,105,72,24)
550 I can only retrieve regular files
mget cpanelbackup? y
227 Entering Passive Mode (10,21,131,105,73,69)
550 Can't open cpanelbackup: No such file or directory
while
i use (get backup home)
it successfully retrieve but as files shown below
server:
'root#azar [/home]# ls
./ backup.2* .cpan/ dailybackup hi5songs.4 oldeserver
../ backup.3* cPanelInstall/ hi5songs/ hi5songs.5 oldserver/
0_README_BEFORE_DELETING_VIRTFS backup.4* .cpanm/ hi5songs.1 home quota.user
backup/ backup.5* .cpcpan/ hi5songs.2 latest virtfs/
backup.1* .banner cpeasyapache/ hi5songs.3 lost+found/ whole'
i got that backup with green color executable file like backup.1* ( note: i cant open those file and extract those files) what to do
how to get my .tar.gz file back
please guide me,,
advance thanks,,
Updated Answer
If you want to get all files from /some/place on your server, to /home/here on your local machine, you would either do this:
cd /home/here # change directory before starting FTP
ftp server ... # connect
cd /some/place # go to desired folder on server
bi # ensure no funny business with line-endings
mget * # get all files
or you can change directory locally, within FTP like this:
ftp server ... # connect
cd /some/place # go to desired folder on server
lcd /home/here # LOCALLY change directory to where you want the files to 'land'
bi # ensure no funny business
mget * # get all files
Original Answer
I cannot understand your question at all, but you are doing some things wrong.
You cannot use GET or MGET to get a folder (directory) like you are trying to do with mget backup. You can only GET a file. Now your file may be a tar-file with more than one file in it, but it is still a file.
If you are getting tar-files and binary files, you should use BINARY mode to ensure line-end characters that may occur in binary files are not translated between Windows and Unix line-endings. So, as a matter of course, you should issue BI command before you get files.
If you have several files in your backup directory, you should probably do cd backup then bi
then mget *

linux unzip excluding everything in the folder and underneath

Hi I have to unzip a file that could have a Directory and I want to exclude everything within that directory, I tried lot of options and looked here as well, but doesn't seem to find any good solution.
These are the contents of the zip file:
Please note the depth of EXCLUDE folder is unknown, but we have to exclude everything
$unzip -l patch2.zip
Archive: patch2.zip
Length Date Time Name
--------- ---------- ----- ----
0 2013-10-29 17:42 EXCLUDE/
0 2013-10-29 17:24 EXCLUDE/inner/
0 2013-10-29 17:24 EXCLUDE/inner/inner1.txt
0 2013-10-29 15:45 EXCLUDE/file.txt
0 2013-10-29 15:44 patch.jar
0 2013-10-29 15:44 system.properties
--------- -------
0 6 files
I tried this command, which only extract the files within it, but not the folder and its contents:
$unzip -l patch2.zip -x EXCLUDE/*
Archive: patch2.zip
Length Date Time Name
--------- ---------- ----- ----
0 2013-10-29 17:42 EXCLUDE/
0 2013-10-29 17:24 EXCLUDE/inner/
0 2013-10-29 17:24 EXCLUDE/inner/inner1.txt
0 2013-10-29 15:44 patch.jar
0 2013-10-29 15:44 system.properties
--------- -------
0 5 files
Thanks for the help.
You need to quote the exclude pattern so that it is passed to unzip. Otherwise it will be expanded by the shell before being passed to unzip.
Try:
unzip patch2.zip -x "EXCLUDE/*"
#dogbane answer is right.
But I still add another [I hope] interresting option, as you are on linux:
mc
(aka: Midnight Commander)
Start it, and then : on the Right panel, navigate to where you want your files to end up, and on the Left panel, navigate "inside" the ZIP file, and at that first level select + copy the things you need (ie, select all, and unselect the EXCLUDE folder, for example)
mc is VERY flexible and nice to use, especially to tar/untar/zip/move/delete/rename files... (on windows, an equivalent is TotalCommander, and I use its "synchronise" option very often to keep backups and origin in sync). It allow you to navigate archives as if they were uncompressed (trying to minimize the actual decompression to just the "navigating" part so you don't uncompress them twice).

Resources