Jump to content

dnoland

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by dnoland

  1. neylitalo: Ok... so that was clearly me being very careless... leaving out the hostname at the end... $ ssh -L 24800:host:24800 host Does the trick... however $ ssh -p 24800 host Still dies... with ssh_exchange_identification: Connection closed by remote host So obviously something is configured incorrectly somewhere... but it seems obvious that I need to study ssh tunneling more to avoid this kind of thing in the future... Thanks... issue solved...
  2. rhodesa: I may look into using a different program like stunnel, but my school machines are using ssh and not stunnel, so even if that works for this problem, I would still like to be able to tunnel from school to home... thanks for the suggestion... neylitalo: The following is straight from the man page of ssh: Forgive me if I am confused, (I very likely am), but I would interpret this to mean that the L option is expecting 2 ports, the host name and *optionally* the "bind address" (hence the square brackets). Something about this does not make sense to me, because the host name should already define the IP address of the machine I am trying to connect to. Wouldn't this make the "bind address" redundant??? Correct me if I am wrong, but all the host name is is an alias for a static IP defined in /etc/hosts... Further, I had noticed that their was a -p option for ssh, but decided to try and stick with the guide I was using to secure synergy, which uses the -L option. At your sugestion, I modified my /etc/ssh/sshd_config file to include Port 24800 and then restarted my ssh... sudo /etc/init.d/ssh restart to make sure ssh was up to date with the config file... I then made sure that my port 24800 was being forwarded through my router to my machine. Then at my remote host I did this ssh -p 24800 host_name and I get this... ssh_exchange_identification: Connection closed by remote host Not sure why this would be happening, either... I really did not think that this would be difficult at all... oh well... at least I will learn something... Thank you...
  3. I am trying to configure synergy to run over ssh to secure it... but I have very little experience tunneling with ssh. In order to solve this problem I need to ssh over port 24800, like so ssh -L 24800:remote-host:24800 I made very sure that I am correctly forwarding port 24800 in my router/firewall config... and all I get when running that command is this... $ ssh -L 24800:hal:24800 usage: ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-e escape_char] [-F configfile] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R [bind_address:]port:host:hostport] [-S ctl_path] [-w local_tun[:remote_tun]] [user@]hostname [command] Any thoughts??? Any help if greatly appreciated...
  4. So... this is a sort of strange mission objective... What I want to do is bind a key combo, say <ctrl><shift>j, and have that preform some directional arrow movement the same as it would if I pressed the down arrow... I know... that is strange... but I have my reasons... So, from the dark times back before I changed over form M$ to a real OS, we used macros for many things... and key bindings were one of them. Looking for a linux analog to that, i found xmacro. So I have now made a shell script that does this... echo -e "KeyStrPress Right \n KeyStrRelease Right" | xmacroplay :0 and then I set that up as a key command in metacities... but this does not seem to work... anyone know why / have a better solution (kinda hoping for the latter)... Oh... by the way... I am on Ubuntu Feisty 64bit...
  5. I am not all that experienced with linux... but I am (was) in EXACTLY the same boat as you. The disgust I feel when I see vista's warently unnecessary waste of my system resources is almost beyond description. XP is fine for IE using hosewives... but people who do more than check email and play solitaire should use a real OS. Here are the pro's of linux (as I see them). Whatever people say IT IS HARDER to use / set up than windows (in my experience). This is not a con. You may (will) need to do some command line stuff, but after a while you will find out that is a good (great) thing. With linux you trade simplicity for power in many (most, certainly not all) circumstances. I would not trade bash for a strictly graphical interface... because their is simply no way that a graphical interface can have that kind of power (yes it does OWN that sad little dos imitation they are calling command prompt). But don' t let me exaggerate... if you can google, you can linux. I doubt any linux OS will immediately find / work with your wifi card. If you want multiple monitors (a must for me), well that takes between 30 seconds and 30 minutes depending on your own skill and the distro you choose. Linux (in my experience) is secure. No need to buy an anti virus software every year or whatever. Whatever saves me money is definitely in the pro category. Linux (by and large) is free. Usually the OS is free, and so is virtually all of the software you use. This has many profound implications. I did not really understand the scope of the free software available until I tried it. I am still stunned. This is almost definitely the best part of linux. Linux is stable (again, in my experience). No random errors on startup, and it actually shuts down when I tell it to. No waves of random applications that improperly uninstall and glitch whenever I boot up / power down. I never am presented with stupid error boxes asking if I would like to "send an error report" after mathcad crashes for no reason, corrupting 83 pages of mathematics (yeah... still bitter about that). Many people feel that Microsoft may be, what is the word, EVIL. They are not wrong. Finally, I think that both ext3 and reiserFS are much better file systems than NTFS. Ubuntu does not even ship with a defrag tool. This sounded stupid to me at first, but so far I have had no need at all to defrag my hard discs. Even through large influxes of data, nearly full hard discs, multiple uninstalls and installs of dozens of different programs... I have not really noticed any performance loss. Boot times stay constant... none of this waiting for 10 minutes for my machine to become functional after I log on. Granted that does not really happen in windows if you take care of the machine and keep the HD less than 70% full, and NEVER resize an NTFS partition that is over 70% full. But this never happens on linux even if you do all of those things. Cons of linux Many applications can not easily be made to function on linux. As others have said .NET is an issue. Wine simply will not help you with that. Their is a project called mono that is designed to correct this... but I have a feeling that it is going to be quite a while before this is a solid solution. Learning time - If you are highly computer dependent to do what you do (sounds like you are), it may be extremely inconvenient to learn a whole new OS with a whole new set of programs. Dual boot helps... but many people who do this never seem to break free of windows. That is both good and bad... they still get the few benefits of windows, but it takes some measure of discipline to choose linux at the prompt when you turn on your computer every morning. Many people (in my experience) who dual boot, never really get into linux because they just take the path of least resistance and boot XP. Gaming does not seem to mix well with linux... but I left that behind more or less anyway. But still... for many people, especially those likely to even consider linux, this is a serious issue. Gotta respect that, even if it does not really apply to me. That is it... seriously... all of the serious problems I can think of at the moment. As for which distro to choose... Back when I first switched to linux (the same day that vista RC2 hit the web) several of my friends had something of a linux install fest. We tried several linux distros and all basically came to the conclusion that Ubuntu was the best choice for us. This is not me dissing Mepis, Fedora, suse, CentOS, Debian, and certinally not gentoo (seems to me that I will eventually switch to gentoo). I just think that Ubuntu is relatively simple (I LOVE apt), and has an excellent community to support it (the wikis will help you do just about anything). Ubuntu is super easy to install with the live cd, and runs well on both my desktop and my laptop. It will almost certinally be easier to learn Ubuntu vs Gentoo, but I don't think it should take you two months to learn either of them (to the point of proficiency). All in all, I conclude that almost any linux distro is vastly superior to XP, and seeing as how I can barely keep my lunch through a discussion of vista we can skip that. So my final advice would be this. If possible, dual boot Ubuntu with XP for a while. Eventually you will most likely find that you prefer Ubuntu, then again... my gentoo download just finished, so I am going to go tinker with that now.
  6. Sorry... my bad... all of this trouble over some stupid typo... function saveFile($upload) { if (validateFile($uplaod)===true) //Note to self... learn to spell upload... damn. I guess that is the trouble with loosely typed languages... or being unable to type... one of the two. I am going to have to disagree with you on that one... sudo code for that save function if (file already exists) { say so } else { upload it } All in all I have to say thanks to all of you... I am really impressed with this whole site, and very glad I joined this group. Hopefully I will be able to give back (after I learn some more php).
  7. Well... I did the === true change. No effect... but at least now we are positive that the validateFile function is returning false... so the bug must live in that function... As for that rewrite... if just gives me "invalid file" when I run that. That means that the condition (($upload["type"] == "image/gif") || ($upload["type"] == "image/jpeg") || ($upload["type"] == "image/pjpeg")) && $upload["size"] < 20000000 is false... no idea what that is about... Now... here is something interesting (were back to the 2 function version here...) if i echo validateFile($_FILES["file"]) . "<br />"; it prints the normal output of validateFile as well as a 1. I thought 1 was true??? validateFile must be returning false, otherwise I would not be getting "Can't save invalid file" from the saveFile function???
  8. Ok... print_r($_FILES); Gives the following... Array ( [file] => Array ( [name] => civilDisobidience.gif [type] => image/gif [tmp_name] => /tmp/phpAjHCsS [error] => 0 [size] => 13139 ) ) Upload: civilDisobidience.gif Obviously the temp location is randomized... but the rest of that seems to be in order to me...
  9. Well d22552000, I can do that... but I don't really understand why... the file output already told me that it is a gif and all of that... Upload: civilDisobidience.gif<br /> Type: image/gif<br /> Size: 13139<br /> Stored in: /tmp/phpIZBJ3R<br /> Invalid file<br /> Can't save invalid file <br /> So I can't really see how their could be an error in any of those conditions. Besides, the whole condition (($upload["type"] == "image/gif") || ($upload["type"] == "image/jpeg") || ($upload["type"] == "image/pjpeg")) && $upload["size"] < 20000000 should return true or false. The fact that the server kicks back both the section about Type, Size, ect... and the words "invalid file" seem to indicate that it ran BOTH the 'then' and 'else' part of the code. As far as I know, this should not happen in ANY event. Thanks... I will try what you suggested and get back to you... As for teng84... my mistake, I copied that section wrong... the script on the server says the following... <html> <body> <?php function validateFile($upload) { if ($upload["error"] > 0) { echo "Error: " . $upload["error"] . "<br />"; return false; } else { if ((($upload["type"] == "image/gif") || ($upload["type"] == "image/jpeg") || ($upload["type"] == "image/pjpeg")) && $upload["size"] < 20000000) { echo "Upload: " . $upload["name"] . "<br />"; echo "Type: " . $upload["type"] . "<br />"; echo "Size: " . $upload["size"] . "<br />"; echo "Stored in: " . $upload["tmp_name"] . "<br />"; return true; } else { echo "Invalid file<br />"; return false; } } } function saveFile($upload) { if (validateFile($uplaod)) { if(file_exists("upload_" . $upload["name"])) { echo $upload["name"] . " already exists.<br />"; return false; } else { move_uploaded_file($upload["tmp_name"], "upload_" . $upload["name"]); echo "Store sucess <br />"; return true; } } else { echo "Can't save invalid file <br />"; return false; } } validateFile($_FILES["file"]); saveFile($_FILES["file"]); ?> </body> </html>
  10. I have tried everything and still can not explain this... I just hope one of you can... So i have someForm.html like this... <form action = "basic.php" method = "post" enctype="multipart/form-data"> File: <input type = "file" name = "file" id = "file" /><br /> <input type="submit" name = "submit" id = "submit" value = "Submit" /><br /> </form> And I have basic.php like this <html> <body> <?php function validateFile($upload) { else { if ((($upload["type"] == "image/gif") || ($upload["type"] == "image/jpeg") || ($upload["type"] == "image/pjpeg")) && $upload["size"] < 20000000) { echo "Upload: " . $upload["name"] . "<br />"; echo "Type: " . $upload["type"] . "<br />"; echo "Size: " . $upload["size"] . "<br />"; echo "Stored in: " . $upload["tmp_name"] . "<br />"; return true; } else { echo "Invalid file<br />"; return false; } } } function saveFile($upload) { if (validateFile($uplaod)) { // Do some stuff... that never seems to actually happen } else { echo "Can't save invalid file <br />"; return false; } } validateFile($_FILES["file"]); saveFile($_FILES["file"]); ?> </body> </html> And this is what I get back when I upload some gif (civilDisobidence.gif in this case) <html> <body> Upload: civilDisobidience.gif<br /> Type: image/gif<br /> Size: 13139<br /> Stored in: /tmp/phpIZBJ3R<br /> Invalid file<br /> Can't save invalid file <br /> </body> </html> So what this comes down to is that the function validateFile is returning false in spite of the fact that it obviously is executing a part of the script that obviously ends in return true. Further... it is running both the 'then' and 'else' parts of nested if else statement in the validateFile function. I have never had any error like that before. Any thoughts?? Thanks for any help on this one...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.