IPB





Welcome Guest ( Log In | Register )

> FTP scriptyness
MonkeyFiend
post Oct 7 2008, 03:33 PM
Post #1


Security and Projects
**********

Group: Clan Dogsbody
Posts: 4,700
Thank(s): 1102
Joined: 31-August 07
From: A Magical Place, with toys in the million, all under one roof
Member No.: 1




Firstly would it not be easier to script it so that a bunch of files are packaged - zipped or preferably tarred and then upload the one file then untar it on the remote server??

Something like the following run on "Remote server" => "computer where files are kept" (Dirty FTP connections*)

On server, create a local ghey.zip and fills it from the FTP request.


WebRequest.RegisterPrefix("ftp://", FtpWebRequest.Creator);
WebRequest request = WebRequest.Create("ftp://ftp.magik5likesmen.com/ghey.tar.gz");
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();

Stream local = File.Create("ghey.tar.gz");
byte[] buffer = new byte[1024];
int n;
do
{
n = stream.Read(buffer, 0, buffer.Length);
local.Write(buffer, 0, n);
}
while (n > 0);
stream.Close();
local.Close();

**then something like.. (I can't remember the syntax tongue.gif)***

gz.UnTarGz("ghey.tar.gz", untarRoot, bNoAbsolute);

Obviously this can be rejigged if you want to run as a script on the "computer where files are kept" > "Remote Server" type direction



*I do it this way so that a remote secure server never accepts inbound FTP connections, it should always initiate outbound connections by script. This means that the script can run with limited permissions e.g. run under a user to reach the outside world and place files in a given limited directory with no permissions outside of that directory. A separate script with permissions to this directory but no permissions to the outside world can then be run to unpack and palce the files where they belong; this is purely limiting security.


--------------------

Go to the top of the page
 
+Quote Post
2 Pages V   1 2 >  
Start new topic
Replies (1 - 36)
Magik5
post Oct 7 2008, 04:13 PM
Post #2


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




yeh good idea actually, never thought of packaging up

had a quick check and php (yes php not asp tongue.gif) supports zips over tars so ill use them instead.

basically theres a php script that executes after each upload to enter each file into a mysql db ive created so ill get php to do the unzipping as well =]

cheers for the help =]


--------------------
Go to the top of the page
 
+Quote Post
Magik5
post Oct 8 2008, 08:28 AM
Post #3


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




nice idea on the security thing as well, but the only people using this will be staff uploading to our server so security shouldn't really be an issue.

i had a little dig around google as it seems c# only supports zipping one file at a time, where as i need to zip (sometimes multiple folders) containing multiple files into one zip.

the ftp app works just fine as is, albeit a few annoying 550's every so often, and ive got the rest of the php stuff to be getting on with so if theres a quick simple solution for this then great, if not its not really an issue =]

oh one more thing - on the first connection it makes, the app seems to hang until connection is made, short of going down the threading route, do you no of a quick fix for this?

cheers


--------------------
Go to the top of the page
 
+Quote Post
MonkeyFiend
post Oct 8 2008, 10:10 AM
Post #4


Security and Projects
**********

Group: Clan Dogsbody
Posts: 4,700
Thank(s): 1102
Joined: 31-August 07
From: A Magical Place, with toys in the million, all under one roof
Member No.: 1




Code that I routinely steal err.. I mean utilise for zipping in #:

http://www.vwd-cms.com/Forum/Forums.aspx?topic=18

App hanging... ahh the old blocking problem... good old 'asynchronous sockets' to the rescue - basically you should be able to handle GUI and networking in 1 thread

Quickly googled: http://tinyurl.com/4jyfyt


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 8 2008, 12:12 PM
Post #5


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




cheers for the links,

will look into the sockets thing if i have time near the end of the deadline as itll take me awhile to get my head round.

the zip script seems quite simple, yet kind of a hack when microsoft could have made it so much easier...

ta


--------------------
Go to the top of the page
 
+Quote Post
Magik6
post Oct 8 2008, 12:30 PM
Post #6


Knight Lieutenant
********

Group: Clan Members
Posts: 824
Thank(s): 0
Joined: 30-December 07
From: Brighton
Member No.: 54




Total jiberish tongue.gif


--------------------

There are 10 types of people in this world, those who understand binary and those who don't
Go to the top of the page
 
+Quote Post
MonkeyFiend
post Oct 8 2008, 12:39 PM
Post #7


Security and Projects
**********

Group: Clan Dogsbody
Posts: 4,700
Thank(s): 1102
Joined: 31-August 07
From: A Magical Place, with toys in the million, all under one roof
Member No.: 1




Well thats how I feel when I see a thread about motorbikes ohmy.gif


--------------------

Go to the top of the page
 
+Quote Post
fido77
post Oct 8 2008, 12:41 PM
Post #8


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




i don't understand most of that!!! i must need more classes!!! of course i haven't done anything with c# yet.


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 8 2008, 12:41 PM
Post #9


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




before i started this i was like ZOHNOES! my first app in c#!

but then 475 lines later i feel ive done a good job =]

but then again having "jnr developer"as my job title gets me off the hook when i end up googling everything i dont know =]

pretty comfortable with programming now though, as in syntax, writing custom classes etc

i prefer as3 though, just not the authoring environment as the available code hinting is shite


--------------------
Go to the top of the page
 
+Quote Post
Magik5
post Oct 8 2008, 01:01 PM
Post #10


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




but i still dont like regular expressions :s


--------------------
Go to the top of the page
 
+Quote Post
fido77
post Oct 8 2008, 01:10 PM
Post #11


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




i'm startin to get it down. writin small programs is fairly simple to me, but i have trouble with the bigger ones. its mainly the paper work the teacher makes us do that slows me down. i figure by the time i write all the IPO charts and crap, i could have already wrote the dam program!!!


--------------------

Go to the top of the page
 
+Quote Post
MonkeyFiend
post Oct 8 2008, 01:25 PM
Post #12


Security and Projects
**********

Group: Clan Dogsbody
Posts: 4,700
Thank(s): 1102
Joined: 31-August 07
From: A Magical Place, with toys in the million, all under one roof
Member No.: 1




[Warning: bad c# regex joke follows]


What regular expression can be found in December?








Answer: [^L]


--------------------

Go to the top of the page
 
+Quote Post
fido77
post Oct 8 2008, 02:12 PM
Post #13


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




i can't figure it out! whats the answer? lol.


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 8 2008, 02:48 PM
Post #14


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




any character not equal to L... eh


--------------------
Go to the top of the page
 
+Quote Post
MonkeyFiend
post Oct 8 2008, 02:57 PM
Post #15


Security and Projects
**********

Group: Clan Dogsbody
Posts: 4,700
Thank(s): 1102
Joined: 31-August 07
From: A Magical Place, with toys in the million, all under one roof
Member No.: 1






Sorry... I'll get my coat sad.gif


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 8 2008, 03:23 PM
Post #16


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




to be fair i did laugh

for a few seconds


--------------------
Go to the top of the page
 
+Quote Post
fido77
post Oct 8 2008, 05:02 PM
Post #17


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




i had myself a laugh too! biggrin.gif


--------------------

Go to the top of the page
 
+Quote Post
Lawpf2001
post Oct 8 2008, 06:53 PM
Post #18


Knight Errant
*******

Group: Clan Members
Posts: 645
Thank(s): 0
Joined: 18-November 07
From: Swindon
Member No.: 43




GCSE IT = name sum input devices, make a stupid database using acess for no good reason

Law
x


--------------------
Go to the top of the page
 
+Quote Post
Magik5
post Oct 8 2008, 07:10 PM
Post #19


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




i had to do that for alevels

the first time i ever saw a line of code was my first year of uni - 2 years ago lol

and that was java

oh and ive now added the starters of my image gallery to my website, found here: http://www.dancotton.co.uk/Gallery


--------------------
Go to the top of the page
 
+Quote Post
Magik6
post Oct 9 2008, 08:00 AM
Post #20


Knight Lieutenant
********

Group: Clan Members
Posts: 824
Thank(s): 0
Joined: 30-December 07
From: Brighton
Member No.: 54




IT is bullshit, its more about how programs can be used etc rather than learning the how a computer processes data etc. I decided to drop IT after GCSE and take computer science instead, was much better. Although neither compares to the super cool subject of Geology!!! biggrin.gif


--------------------

There are 10 types of people in this world, those who understand binary and those who don't
Go to the top of the page
 
+Quote Post
MonkeyFiend
post Oct 9 2008, 08:21 AM
Post #21


Security and Projects
**********

Group: Clan Dogsbody
Posts: 4,700
Thank(s): 1102
Joined: 31-August 07
From: A Magical Place, with toys in the million, all under one roof
Member No.: 1




I did A-level IT - the teacher (now sacked) was an old physics teacher that my school moved across in the 70's to teach computers, since physics/maths were closest to IT at the time.

He decided to split the sets based on score of a big IT test, but rather than taking the top 20 into set 1 etc., he set a hard limit e.g. Top set were people that scored over 90%.

This meant my A-level class consisted of 3 people. The only lesson he taught in 2 years was 'how binary works' The rest of the time he went into the staff room and never reappeared.

For me IT/IS and computer science were all basically the same thing.

I completed my generic spradsheets/relational database coursework and then started learning VB - probably out of boredom.

I also learnt a lot about security during this time - there were more computer rooms than computer staff, so certain people were selected as prefects to look after these rooms. My room was H6 in hawkins house - there had been a sudden upsurge in (forbidden) gaming that I was supposed to prohibit (Duke Nukem!)

During this 2 year period, the head of IT never figured it was me installing these games. It was a good situation - he kept buying security and snooping software and showing me how it worked, thereby enabling me to bypass it biggrin.gif

I suspect I learnt more through this than I would have in a traditional taught class tongue.gif


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 9 2008, 08:29 AM
Post #22


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




lol

well ive learnt a hell of a lot more in this place of work where ive been for 3months, compared to my whole 2 years ive currently spent at uni

schools suck.

and why VB :s ergh shite language


--------------------
Go to the top of the page
 
+Quote Post
MonkeyFiend
post Oct 9 2008, 08:46 AM
Post #23


Security and Projects
**********

Group: Clan Dogsbody
Posts: 4,700
Thank(s): 1102
Joined: 31-August 07
From: A Magical Place, with toys in the million, all under one roof
Member No.: 1




vb was part of access/excel so I started veering towards it through those sad.gif


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 9 2008, 08:47 AM
Post #24


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




oo ok. your old =]


--------------------
Go to the top of the page
 
+Quote Post
fido77
post Oct 9 2008, 12:00 PM
Post #25


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




what kind of place are you working at Magik5? only thing i could do with my computer before school and =SM= is put a disk in and play it. now i gotta deside wether i want to focus more on programming or graphics. the programmers make the most money. http://www.gamecareerguide.com/features/61...ect_.php?page=2


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 9 2008, 12:19 PM
Post #26


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




www.mediastation.co.uk - we are currently designing a new wesbite as the current one is quite outdated

i mainly do flash design/programming - as3 ftw =]

im currently doing a bit of php with c# because we got this job for ea - deadlines 2 weeks time tho so after that ill be going back to flash i expect

but i can use most adobe tools like photoshop, after effects/premiere/dreamweaver etc etc, and im also doing some 3dsmax work in my own time as i love all things 3d =]

i programmed about 1/2 of a 3d board game (but not the stereoscopic engine as m not that clever :s) currently on a well known companies website (pm me as im not publicly allowed to disclose who) =]

i really enjoy working for this company as they do everything i would want to do =]

i also like taking pictures... as seen um. <PLUG> here: http://www.dancotton.co.uk/Gallery </plug> heh 2 plugs in the same thread, whoo!

im still finishing my gallery, its written in as3 and reads in from an external xml file with links to the images which are also external =]

lol /fin


--------------------
Go to the top of the page
 
+Quote Post
fido77
post Oct 9 2008, 02:07 PM
Post #27


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




the pics look good, when you gonna get more. i should've took my camera with me on the roof yesterday.


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 9 2008, 03:34 PM
Post #28


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




ive got 750 photos i took on my holiday to dorset i took a few weeks back, those are a select few =]


--------------------
Go to the top of the page
 
+Quote Post
Lawpf2001
post Oct 9 2008, 05:40 PM
Post #29


Knight Errant
*******

Group: Clan Members
Posts: 645
Thank(s): 0
Joined: 18-November 07
From: Swindon
Member No.: 43




duke nukem lol. was shareware Doom for me! in the school library having a mass sesh! lol funtimes.

Law


--------------------
Go to the top of the page
 
+Quote Post
fido77
post Oct 14 2008, 03:08 PM
Post #30


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




did you do any of the work on the showreels, magik5? they're pretty neat!


--------------------

Go to the top of the page
 
+Quote Post
Magik5
post Oct 14 2008, 05:04 PM
Post #31


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




no, that was all done before i got the job =]

anyway i leave the video editing/animation/modelling to the real pr0sm im just a gay little script geek atm biggrin.gif

my latest contraption however, is this: http://www.dancotton.co.uk/Bubbles biggrin.gif

oh but i forget, you need flash player 10 beta to be able to get the best from it =[


--------------------
Go to the top of the page
 
+Quote Post
fido77
post Oct 15 2008, 02:36 AM
Post #32


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




pretty coooooooool!!! cool.gif heres my new thing i'm workin on!!!



--------------------

Go to the top of the page
 
+Quote Post
GoochTyke
post Oct 15 2008, 07:22 AM
Post #33


Knight
******

Group: Trusted non-SM
Posts: 429
Thank(s): 1
Joined: 6-January 08
From: Mansfield, UK
Member No.: 59




KEWL: blink.gif

heres one ive been workin on for a few weeks now



should be finished soon


--------------------


Go to the top of the page
 
+Quote Post
Magik5
post Oct 15 2008, 11:22 AM
Post #34


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




rofl


--------------------
Go to the top of the page
 
+Quote Post
fido77
post Oct 15 2008, 12:25 PM
Post #35


Knight Lieutenant
********

Group: Clan Members
Posts: 989
Thank(s): 1
Joined: 5-June 08
From: Tyler, Texas, US
Member No.: 124




maybe i should change mine to be more like yours GoocheTyke!!! biggrin.gif it would prob come out better!


--------------------

Go to the top of the page
 
+Quote Post
Magik6
post Oct 15 2008, 01:34 PM
Post #36


Knight Lieutenant
********

Group: Clan Members
Posts: 824
Thank(s): 0
Joined: 30-December 07
From: Brighton
Member No.: 54




lol Gooch


--------------------

There are 10 types of people in this world, those who understand binary and those who don't
Go to the top of the page
 
+Quote Post
Magik5
post Oct 22 2008, 02:10 PM
Post #37


Paddle Master
**********

Group: Clan Members
Posts: 2,085
Thank(s): 30
Joined: 3-December 07
Member No.: 50




FYI if you care or not, i dropped ftpwebrequest and used this class instead:http://www.csharphelp.com/archives/archive9.html

works much better and runs way smoother.

cheers for the help though monkey, its always appreciated =]


--------------------
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 15th October 2025 - 02:20 AM
Sneaky Monkeys Clan :: MonkeyFiend.com