LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2010, 02:01 AM   #1
epicseeds
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Rep: Reputation: 0
Create my own direct download link


Hey first post and going to start off with a noob question: How do I make it so I can do an:
Code:
"wget http://blahblah.blah.com"
...with my own file?

I have tried to upload a .tar file to multiple hosting sites such as drop.io and dropbox that don't make you insert a captcha before you get to dl the file. When I do an "wget URL" it downloads a weird file that doesn't remotely resemble the file I uploaded.

I am thinking the best way to overcome this problem is to host a file on one of my servers and just wget the path name? there's got to be some easier way that that?!

The reason I ask is to partially avoid another problem that maybe you guys could help me with. I have been writing some shell scripts to do various commands on my debian seedbox - mainly just creating users and directories among other things. I use Notepad++ in Windows and when I copy and paste into xtern via nano editor the spacing gets all messed up. It looks like it doesn't recognize new lines, looks something like this:
Code:
#comment a command;
When it should be like this:
Code:
#comment
a command;
How can I overcome this? In notepad I tried going to Edit/EOL Conversion/UNIX format but no dice.

Any help would be much appreciated!

Last edited by epicseeds; 04-28-2010 at 02:57 AM.
 
Old 04-28-2010, 02:13 AM   #2
ripp3r
Member
 
Registered: Feb 2010
Location: Switzerland
Distribution: Slackware 13.0 x64
Posts: 71

Rep: Reputation: 15
Maybe this can help:

http://www.debian.org/doc/manuals/ap....html#contents
 
Old 04-28-2010, 02:22 AM   #3
epicseeds
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ripp3r View Post
Is this one of those "the answer is here, find it yourself" response...or are you just providing a possible source of information? Because I can't find an answer to neither of my questions there!
 
Old 04-28-2010, 02:46 AM   #4
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
Quote:
The reason I ask is to partially avoid another problem that maybe you guys could help me with. I have been writing some shell scripts to do various commands on my debian seedbox - mainly just creating users and directories among other things. I use Notepad++ in Windows and when I copy and paste into xtern via nano editor the spacing gets all messed up. It looks like it doesn't recognize new lines, looks something like this:
Code:
#comment a command;
When it should be like this:
Code:
#comment
a command;
How can I overcome this? In notepad I tried going to Edit/EOL Conversion/UNIX format but no dice.

Any help would be much appreciated!
Can't help on the apt-get part as I use SUSE which uses RPM.

For the editing, why are you using notepad++ which is a windows program to edit linux files? Just curious. Whay you might try is copying the entire file to linux and run the command "dos2unix" on it, then the file would have the correct formatting to paste into nano.
 
Old 04-28-2010, 02:50 AM   #5
epicseeds
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
i have read briefly about this dos2unix command...do i need to install it first?

but it still goes back to the original problem. i cant access a custom file by me without first downloading it to the box through an wget command because it wont let me FTP with root (i dont have a user created yet, because that is what my script will be doing for me).

also, im assuming when you say suse uses RPM, that means its just a different command of wget? if so, the fact that you don't use the wget command shouldn't matter as it is still the same concept right?

EDIT: just realized I have been saying apt-get when it should be wget

Last edited by epicseeds; 04-28-2010 at 02:54 AM.
 
Old 04-28-2010, 03:04 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
i have read briefly about this dos2unix command...do i need to install it first?
Yes, you do. But it is easier just to use a linux editor to create your files. (Windows handles newlines differently from linux / unix)

As for offering files over the network, take a look at woof
 
Old 04-28-2010, 03:23 AM   #7
ripp3r
Member
 
Registered: Feb 2010
Location: Switzerland
Distribution: Slackware 13.0 x64
Posts: 71

Rep: Reputation: 15
Quote:
Originally Posted by epicseeds View Post
Is this one of those "the answer is here, find it yourself" response...or are you just providing a possible source of information? Because I can't find an answer to neither of my questions there!
I think that you COULD find information about "how to compile".

Just a suggestion
 
Old 04-28-2010, 01:00 PM   #8
epicseeds
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
Yes, you do. But it is easier just to use a linux editor to create your files. (Windows handles newlines differently from linux / unix)

As for offering files over the network, take a look at woof
Is there anyway to get Notepad++ to handle linux files? I thought that is what the EOL setting was for, but guess not.

will woof work if it's not over the network? because my linux box is half way across the world
 
Old 04-28-2010, 01:18 PM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
Is there anyway to get Notepad++ to handle linux files? I thought that is what the EOL setting was for, but guess not.
I know nothing about "notepad". Sorry.

Quote:
will woof work if it's not over the network? because my linux box is half way across the world
What do you mean by "not over the network" if your linux box is distant, you are already using "the network"? woof works over any network: LAN, Internet, it doesn't care.

If you have a firewall between your LAN and the internet, then you'll have to open the port woof is using, and forward it to the PC woof is running on. Then the distant computer just connects to it, by connecting to your modem/router which forwards the request to the PC running woof.

It is simple, and "just works". Try it on your LAN first, then branch out.
 
Old 04-28-2010, 04:18 PM   #10
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,029

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
not sure i understand this thread, but when i do remote administration i do it using ssh/ scp.
 
Old 04-28-2010, 05:30 PM   #11
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
but when i do remote administration i do it using ssh/ scp.
We all do, but the OP seems to want http://.... access. Not ssh or scp.

OK. He has been given the link(s) to enable this.

The OP was titled Create my own direct download link

I think that that is answered now.
 
Old 04-28-2010, 05:37 PM   #12
phunkymunky
Member
 
Registered: Aug 2003
Location: Glasgow, Scotland
Distribution: Slackware 14.0, Debian 7.0
Posts: 60

Rep: Reputation: 22
Quote:
Originally Posted by epicseeds View Post
I use Notepad++ in Windows and when I copy and paste into xtern via nano editor the spacing gets all messed up. It looks like it doesn't recognize new lines, looks something like this:
Code:
#comment a command;
When it should be like this:
Code:
#comment
a command;
How can I overcome this? In notepad I tried going to Edit/EOL Conversion/UNIX format but no dice.

Any help would be much appreciated!
I use Notepad++ for college and run it using wine(crossover) in linux at home just fine. There is also a setting (Settings -> Preferences -> New Document/Default Directory tab) to set the format to either mac, unix or windows. You could try setting it to unix and see if that sorts out the problem.
 
Old 04-28-2010, 08:23 PM   #13
epicseeds
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
@Phunkymunky - I think you are talking about EOL Conversion right? I have it set to unix already, that fixed the wierd characters for the spaces but isn't working for the new line problems

about woof - I will look into this. when you said network, for some reason i thought it could only be done over LAN

@schneidz - are you saying there is an easy way to transfer a file from your computer to a server via SSH (such as putty)?

thanks for all your help guys, i think i am in the right direction thanks to you all. it looks like i have the info on how to get a file on my remote server easily through the use of woof, but still am wondering how to easily copy code from a windows environment into a unix.
 
Old 04-28-2010, 10:18 PM   #14
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,029

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
you would need to use an scp client.

much the same way that ssh deprecates telnet due to security, scp deprecates ftp.

when i used to use windows, i had winscp for an scp client.

as for your text file conversions, can you please paste an example of what you are seeing so the rest of us can get a clue of what you are talking about. try running it thru od so we know what charecters are problematic like so:
Code:
od -x sample.txt
 
Old 04-29-2010, 12:50 AM   #15
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 331

Rep: Reputation: 59
You are running into the Windows vs Unix newline problem. Particularly if you are using ssh, I would suggest looking at using a text editor such as "vi". (Initially @$#%%$ then better than anything else)

From wikipedia:
Quote:
Common problems

The different newline conventions often cause text files that have been transferred between systems of different types to be displayed incorrectly. For example, files originating on Unix or Apple Macintosh systems may appear as a single long line on some Windows programs. Conversely, when viewing a file originating from a Windows computer on a Unix system, the extra CR may be displayed as ^M at the end of each line or as a second line break.

The problem can be hard to spot if some programs handle the foreign newlines properly while others do not. For example, a compiler may fail with obscure syntax errors even though the source file looks correct when displayed on the console or in an editor. On a Unix system, the command cat -v myfile.txt will send the file to stdout (normally the terminal) and make the ^M visible, which can be useful for debugging. Modern text editors generally recognize all flavours of CR / LF newlines and allow the user to convert between the different standards. Web browsers are usually also capable of displaying text files and websites which use different types of newlines.

...

Conversion utilities

...

On many Unix systems, the dos2unix (sometimes named fromdos or d2u) and unix2dos (sometimes named todos or u2d) utilities are used to translate between ASCII CR+LF (DOS/Windows) and LF (Unix) newlines. Different versions of these commands vary slightly in their syntax. However, the tr command is available on virtually every Unix-like system and is used to perform arbitrary replacement operations on single characters. A DOS/Windows text file can be converted to Unix format by simply removing all ASCII CR characters with

tr -d '\r' < inputfile > outputfile

or, if the text has only CRs, by converting CRs to LFs with

tr '\r' '\n' < inputfile > outputfile

...
Regards,
Stefan

Last edited by propofol; 04-29-2010 at 12:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Direct download link for Nctuns 4.0 simulator cute_kitty Linux - Newbie 3 02-16-2009 02:19 PM
Dreamlinux 3.5RC4_GNOME.iso now available as Direct Download SgDreamer Dreamlinux 2 01-20-2009 03:47 AM
CAN NOT seem to download a valid iso image, tried direct and torrent... misketanis Fedora 10 07-08-2008 06:05 PM
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 08:40 AM
anyone have a direct link for redhat enterprise oobe Linux - General 6 02-22-2004 09:39 AM


All times are GMT -5. The time now is 10:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration