Cannot unpack .tgz mongodb distribution on OSX - mongodb

I grab the tgz file via
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-2.6.12.tgz
yes I want mongodb version 2.6.12... :(
and I try to unzip it using:
tar -xvzf mongodb-osx-ssl-x86_64-2.6.12.tgz
but I get:
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
anybody know what might be wrong?

The file didn't download property, so even though it was a .tgz file on the filesystem it was incomplete or corrupted. To get a proper download I had to drop the ssl
before:
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-2.6.12.tgz
after:
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.6.12.tgz
then unpacking with tar worked. √

Related

tar: Error opening archive: Failed to open 'wekaUT.tar.gz' in Command Line Windows 10

I want to extract a tar file that I obtained at tar.gz file. However, when I try: tar -xzvf wekaUT.tar.gz
I get the following error:
tar: Error opening archive: Failed to open 'wekaUT.tar.gz'
I see the file in my directory as wekaUT.tar.gz.
Any help would be much appreciated.
Just commenting here as I ran into the same issue. In windows "tar xfv .tar.gz" should work if you open the command prompt as administrator.
In my case, I was building the file to untar dynamically using a variable like
tar -xzvf "$SOME_TEMP_DIR/a_cool_file.tar.gz"
And encountered this error because of the quotes. If I updated it to:
tar -xzvf $SOME_TEMP_DIR/a_cool_file.tar.gz
It worked :)
In windows compand promt use quotation marks ("") when specifying the path. It will work properly
Exaple : tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz" -C "C:/PATH/TO/FOLDER/EXTRACTION"
tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz"

Cloud Ubuntu server(Ubuntu 16.04) tar: This does not look like a tar archive

I used the cloud Ubuntu server(Ubuntu 16.04).
I used the following command to get data following the instruction from this link(https://pjreddie.com/darknet/yolo/ Get The Pascal VOC Data ).
The Linxu command is shown as following:
curl -O http://pjreddie.com/media/files/VOCtrainval_11-May-2012.tar
curl -O http://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar
curl -O http://pjreddie.com/media/files/VOCtest_06-Nov-2007.tar
tar xf VOCtrainval_11-May-2012.tar
but there is error:
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
and
$ file VOCtest_06-Nov-2007.tar
VOCtest_06-Nov-2007.tar: HTML document, ASCII text, with CRLF line terminators
Could you tell me how to solve it, thanks!
ah, this may have resulted from the move from http -> https. I fixed it on the site, replace http with https and it'll work

wget corrupted file .zip file error

I am using wget to try and download two .zip files (SWVF_1_44.zip and SWVF_44_88.zip) from this site: http://www2.sos.state.oh.us/pls/voter/f?p=111:1:0::NO:RP:P1_TYPE:STATE
when I run:
wget -r -l1 -H -t1 -nd -N -np -A.zip -erobots=off "http://www2.sos.state.oh.us/pls/voter/f?p=111:1:0::NO:RP:P1_TYPE:STATE/SWVF_1_44.zip"
I get a downloaded zip file that has a screwed up name (f#p=111%3A1%3A0%3A%3ANO%3ARP%3AP1_TYPE%3ASTATE%2FSWVF_1_44) and it cannot be opened.
Any thoughts on where my code is wrong?
There's nothing "wrong" with your code. Wget is simply assuming you want to save the file in the same name that appears in the url. Use the -O option to specify an output file:
wget blahblahblah -O useablefilename.zip

aapt can't find 9Patch Images

I want to certificate an Android project just with cmd. Now Im stocked at the creation of the .apk file. aapt says he cant find the pictures with the .9. ending. If i rename this pictures and delete the .9. ending then everything works fine without the correct size of the pictures in the app.
ettings
I figured out that I have to "crunch" this pictures, like what he says at the page: Ant Build AAPT Crunch is stripping draw9 information from Library resource images but Im not sure how this works correctly.
I tried this command:
aapt crunch -v -S res -C bin/res
It works with my .9.png files but I still dont get it how I can run it, that it creates the .apk file. How can I use it in the following command ?
aapt package -v -f -A \assets -M \AndroidManifest -S \res -I \android.jar -F \Projectname.unsigned.apk \bin
Just this command gives me the following error:
activity_settings.xml:2: error: Error: No resource found that matches the given name (at 'sound' with value '#drawable/btn_sound_active_pressed')
This file is an .9.png file.
With eclipse everything runs fine.
So i figured it out: I have to "crunch" all picture in the res folder first:
aapt crunch -v -S \res -C \bin\res
And then I pointed as a source folder to the res dir and to the bin\res dir. Also added --no-chrunch --generate-dependencies
aapt package --no-crunch --generate-dependencies -v -f
-M \AndroidManifest.xml"
-S \bin\res
-S \res
-A \assets
-I \android.jar
-F \bin\APPNAME.unsigned.apk \bin
Now Its working perfectly. Also with the .9.png 9patch pictures.

Windows command line tar "cannot connect to d: resolve failed" with Chef Knife

Using Windows Command line with cygwin, chef and ruby installed. When trying
knife cookbook site install mysql
returns the following error
Begin output of tar zxvf D:/path/to/chef-repo/cookbooks/mysql.tar.gz
STDOUT:
STDERR: tar<child>: Cannot connect to D: resolve failed
gzip: stdin: undexpected end of file
tar: Child returned status 128
tar: Error is not recoverable: exiting now</code>
How can I remedy this issue? I can manually unzip using
tar zxvf mysql.tar.gz
but this is less than ideal. I believe this has to do with the colon in filename but how can I change that in the knife or chef preferences?
The reason is that tar interprets colons (:) in file names as meaning it is a file on another machine. You can disable this behavior by using the flag --force-local.
This is from an answer from here.
I don't know a complete answer but have been seeing this on Linux machines lately:
$ date > today
$ tar -czf - today > to:day.tgz
$ tar -tzf to:day.tgz
ssh: connect to host to port 22: Connection refused
tar (child): to\:day.tgz: Cannot open: Input/output error
tar (child): Error is not recoverable: exiting now
gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error is not recoverable: exiting now
$ tar -tzf - < to:day.tgz
today
$
It appears that tar wants to do some sort of remote file processing because of the colon in the file name and you can fake it out by using some form of redirection or piping - for both reading and writing a tarball. I would still like to find an option or something to tell tar not to behave this way.
Will the tar command work if ran from cmd? Also what if the output is to a local drive. Something else try this,
tar zxvf "D:/path/to/chef-repo/cookbooks/mysql.tar.gz"