Jump to content

Koobi

Staff Alumni
  • Posts

    419
  • Joined

  • Last visited

    Never

Everything posted by Koobi

  1. Gentoo is pretty sweet...apart from the fact that it's very customizable, I like it's package manager, Emerge, which is based on Ports if I'm not mistaken which  is what one of the BSD's use as well. what's good about emerge is that it downloads the source files and compiles it on your machine instead of downloading precompiled binaries like most other package managers do. i generally stay away from RPM based distros like RedHat, Fedora, SuSE, etc. don't like how they handle dependencies. if you want to get your hands dirty and learn the guts of dependencies, etc., use Slackware. [quote author=steelmanronald06 link=topic=100080.msg395276#msg395276 date=1152638190] With Gentoo, you need to make sure you get the download that matches your processor, etc.  They have a variety of different ones...and you only need the ISO boot disk...assuming you have your computer hooked to the net.  From there it is pie. [/quote] i believe most linux distro's have processor specific installs. for example, ubuntu has the i386 and i686 for x86 i'm itching to try out the completed version of SymphonyOS when it finally comes out!
  2. :EDIT: ocrrected spelling mistake. Debian's package manager is APT and not PAT [quote author=mentalageof2 link=topic=99871.msg395257#msg395257 date=1152635636] Yes! And completely without sarcastic replies, amazing  8) [/quote] haha apart from that post, i suspect :) package managers are wonderful things. i'm guessing you have no say in what OS to choose. i generally avoid RPM based distros like RedHat, Fedora, SuSE, etc. i love anything based on apt (debian, ubuntu, etc), or ports (gentoo, FreeBSD, etc) because they are very easy to manage.
  3. google works wonders :) glad you got it sorted.
  4. well if you've worked on a variety of things via SSH you would be able to just manage on CLI in Linux...but it really depends on what you've done via SSH. i think you better begin with a GUI distro and experiment with the terminal to begin with. once you're comfortable with terminal. you can move onto a pure CLI version...or simply use the terminal and not the GUI. the first thing you should become familiar with is the entire system file structure. liek for example, /var is where things like logs and mail, etc is stored...aka variable files and /usr would store most of your libs, programs, etc. examine the ~/.bashrc file if you can and understand what it does. the linux manual ABSOLUTELY rocks! if you're not sure how to use a command, you can generally do this: [code] $ myCommand -h [/code] or [code] $ myCommand --help [/code] but if that doesn't work, this generally would: [code] $ man myCommand [/code] linux might be slightly more complex/simpler than win (depending on how you look at it) but it's definitely easier to learn.
  5. i'm getting a new PC next week too. gonna stick a few distros in it :) what sort of thing are you looking to do with linux? how conversant are you with Linux? if you're new to it and you prefer a lot of GUI driven things, go for Ubuntu. it's a good Desktop OS for general home use. for development, i would go with Gentoo or Slackware...Gentoo moreso because i don't like how Slackware doesn't have a proper package manager. you would learn a lot with Gentoo. you can compile Gentoo...would take you almost a day...or you can install precompiled binaries. Debian is ROCK SOLID. period. their software is thoroughly tested. SymphonyOS is in beta...but the creator is writing a new Desktop Manager (like Gnome, KDE, XFCE, etc) called Orchestra which will have PHP integration pretty soon (similar to how you can integrate Perl into Gnome, KDE(?) with a shebang) so i DEFINITELY will try that once it's stable...busted my last monitor by trying out SymphonyOS's Alpha version because i messed about with X's settings and set my refresh rates all wrong :/ SLAX or DSM are good light linux's. I have SLAX on a USB that i carry around...so if i sit at a PC with Win on it, i just stick my USB in it, boot through USB and i have linux on the PC :) there's so many other choices...it all depends on what you want to do. [url=http://en.wikipedia.org/wiki/List_of_Linux_distributions]List of Linux distributions[/url] :Edit: Nice summary of SymphonyOS: http://en.wikipedia.org/wiki/Symphony_OS by the way, if you have unusual hardware, go for Ubuntu. Ubuntu has the best hardware support as far as i know and that's quite rare in most Linux distro's ...but don't become too dependant on Ubuntu. they've just released their last major release. they will have an update in October or so...but nothing after that for quite a few years at least.
  6. [quote author=obsidian link=topic=100073.msg394529#msg394529 date=1152550406] i agree about being careful listing what technologies you use. it's possible to limit yourself with a listing like this as opposed to enhancing your contacts. if you fail to list one that you do, someone may not want to contact you because your card doesn't say that you do it. i like to think of my cards as a way to get people to call me or visit my site. if i can get them there, they'll get all the information they need. [/quote] i suppose that rationale would work in a developed country but in a third world country like Sri Lanka, not everyone has the net :/ so it's important for me to list what i can do, even if it's only specific to that moment in time. anyway, this thread is about suggestions for anything i could add not the current state of the business card :)
  7. yeah i do have my contact details, website etc. but i wanted suggestions for technologies used and capabilities, etc.
  8. i'm in the process of creating a new business card for my freelance web development...i was wondering, what would you, as a PHP developer, list on it? currently, i have the list of techonologies i use: Linux Apache MySQL PHP CSS XHTML Web 2.0 (not too fond of the terminology but it's what clients love seeing... :/) also, on the other side of the card, i have a list of things i'm capable of...but i'm not sure what i can add there so i was wondering if any of you had any suggestions. this is my current list: Content Management Systems (it was too long so i shortened it to CMS...i hope they know what it means) Web Sites Web Services Web Consulting Web Applications Server Configuration as developers yourselves, you know that these terms aren't exactly the best ones, but i have to use terms that the average businessman understands. any suggestions? i think the words i've chosen are too long...
  9. thanks for that link. yeah svg is pretty sweet. 3 years ago i thought it would wipe flash out...i'm surprised Adobe hasn't pushed for that after aquiring macromedia..they had a great SVG plugin. svg would have been good though because it could do everything Flash could if you knew enough JavaScript and google can index it. just imagine the possibilities with SVG+AJAX. i'm just waiting for someone to do something crazy with em...IE users will need to download an SVG plugin though.
  10. you don't have to escape underscores and dashes if they are the leading characters in an expression. you can also use the [b]i[/b] modifier to make expressions case insensitive [code] '/[^a-zA-Z0-9\_\-]/' [/code] is equivalent to [code] '/[^-_a-zA-Z0-9]/' [/code] which is, in turn, equivalent to [code] '/[^-_a-z0-9]/i' [/code]
  11. this problem is probably because Apache isn't running. try starting Apache, however you do it in WAMP, and this problem should be fixed. if you're a regular PHP developer, i recommend you add Apache as a service so that it begins everytime your OS boots.
  12. Koobi

    curl and fread

    hmmm i don't think you posted the correct HTML...there seems to be a closing div that doesn't belong, there. let me know if this is the exact HTML and i will write a regular expression for you. and please enclose your code in proper code tags the next time.
  13. isn't this thread about the same thing: [url=http://www.phpfreaks.com/forums/index.php/topic,99916.0.html]save img[/url] the solution i posted should work for you.
  14. [quote author=redarrow link=topic=99958.msg393974#msg393974 date=1152452967] The for loop was to go throw the array one by one and post 50 images from the database lol. [/quote] but that's what you would use the foreach for
  15. yeah but you should create a seperate thread for that :) ok to explain your code to you: [code=php:0] <?php //seperates the data from the db after every space $get_images=explode( " ",$images['images']."');//$images['images']; from database of images. //foreach iterates through each value that you got from your previous step $img=foreach($get_images as $download_images); //i don't know why you need this... for($i=0; $i <count($download_images); $i++) { $file=$download_images; //this overrides the previous line...which makes no sense because now, the foreach becomes redundant $file = $_REQUEST['file']; //HTTP headers for caching header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); //this header tells the browser to prompt the user to download the file header("Content-Type: application/force-download"); //this header specifies the file name header( "Content-Disposition: attachment; filename=".basename($file)); header( "Content-Description: File Transfer"); //this reads the file and outputs it to the buffer which in this case is your browser @readfile($file); } ?> [/code] the above code simply reads a file and prompts the user to download it. your syntax seems faulty. because as far as i know, foreach returns nothing since its a language construct but you assign a variable to it. also the quotes around $images['images'] in your explode function is unnecessary...actually you should get a parse error for that... this is how i would rewrite your code: [code=php:0] <?php /* assuming $images['images'] contains something like: http://example.com/image0.png http://example.com/image1.png http://example.com/image2.png */ $get_images=explode(" ", $images['images']); //you can define these headers before the foreach since they will be the same for every download header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header( "Content-Description: File Transfer"); foreach($get_images as $download_images) {     $file=$download_images;     header( "Content-Disposition: attachment; filename=".basename($file));     readfile($file); } ?> [/code]
  16. i split the topic because the other thread was AV1611's [quote author=redarrow link=topic=99958.msg393915#msg393915 date=1152447782] i dont know if this would download all the 50 images as i am also learning but if someone can tell me cheers. [/quote] http://www.phpfreaks.com/forums/index.php/topic,99916.msg393910.html#msg393910 replace your header() and readfile() with my functions. first try it out and if it doesn't work, let us know and we should be able to help you out but please give it a try yourself, first :)
  17. Koobi

    save img

    have a look at [url=http://www.phpfreaks.com/forums/index.php/topic,99889.msg393691.html#msg393691]this post[/url] you can use those two functions. suppose your image was at http://www.example.org/image.png and you wanted to save it to /var/www/myImage.png, you would use those two functions like this: [code=php:0] $data = getData('http://www.example.org/image.png'); $result = writeData($data, '/var/www/myImage.png'); if($result !== false) {     echo 'Image was written'; } else {     echo 'Image could not be written'; } [/code] i've split the posts after this into another thread: http://www.phpfreaks.com/forums/index.php/topic,99958.new.html#new
  18. Koobi

    curl and fread

    show me the entire HTML and indicate to me what part of the HTML you want to grab.
  19. Koobi

    curl and fread

    a regular expression is a string that can match a pattern of strings in case you don't know exactly what you're looking for. so if your tag is "<myTag>" and "</myTag>": [code=php:0] <?php $tagName = 'myTag'; $pattern = "%<($tagName)>(.*)+</\\1>%im"; $subject = getData('http://example.org/'); preg_match($pattern, $subject, $matches); print_r($matches); ?> [/code] now depending on what exactly you want, you can write the contents of $matches. you might want to clean up the first indice of $matches since it would contain the name of the tag, according to my expression. the above regular expression should work...let me know if it doesn't i'm a bit rusty with my regular expressions. i'm assuming there will only be one instance of <myTag> if there are two, consider using [url=http://www.php.net/manual/en/function.preg-match-all.php]preg_match_all() in the manual[/url]
  20. Koobi

    curl and fread

    [quote author=G__F__D link=topic=99889.msg393708#msg393708 date=1152391129] It wrote the entire source code to the news.txt file. I caould have done the myself. I can i get some contents of the txt file between 2 certatin tags. [/quote] your initial question wasn't clear which is why i posted that function because i thought that was what you were asking for. for the answer to your question, refer to effigy's post in this thread.
  21. Koobi

    curl and fread

    i wouldn't use CURL for something like this. here's a modified snippet of something i already had: [code=php:0] <?php $source = 'http://www.example.com/'; $destination = './news.txt'; //function to return file data from URL function getData($url) { return file_get_contents($url); } //function to write file to disk //you'll have to implement error handling. i simply return errors but this is not good practice function writeData($data, $location) { if(is_writable($location)) { // i use the b in the mode for portability of code if(!$handle = fopen($location, 'w+b')) { //couldn't open file return false; } if(fwrite($handle, $data) === false) { //file could not be written return false; } fclose($handle); } else { //file is not writable return false; } } $data = getData($source); $result = writeData($data, $destination); if($result !== false) { echo $destination . ' was written to'; } else { echo $destination . ' could not be written'; } ?> [/code] let me know if you don't understand anything there. :edit: after reading edffigy's post i think i know what you meant to say...but yeah, like effigy said, you might have to use regular expressions, depending on what the HTML is like.
  22. Web Development. i think i would like software development but i don't think i know enough to do it well. need to change that when time permits!
  23. Koobi

    curl and fread

    i'm not sure what you meant by "how can i select only the new from the txt file" question, why don't you want to use [url=http://www.php.net/file_get_contents]file_get_contents()[/url] to retrieve the page and then use fopen/flock/fwrite/fclose to do the writing? Any particular reason you want to use CURL?
  24. yeah like wildteen88 suggested, i don't thinks its a chmod issue since your chmod is 0755 it might be to do with apache. you might have DirectoryListing disabled. so i'm guessing you already have an .htaccess file (if you're on *nix, you can confirm its existence by typing "ls -a" without the quotes in CLI) edit this .htaccess and add this to it: [code] Options +Indexes [/code]
  25. as far as i know, yum is CLI. sorry I forgot to mention that in my previous post. You should have tried google :) [url=http://www.mjmwired.net/resources/mjm-php4-fc4.html]PHP4 on Fedora Core 4[/url] [url=http://stanton-finley.net/fedora_core_4_installation_notes.html#Yum]Fedora Core 4 Linux Installation Notes: Yum[/url] some of those steps require super user permissions...but if you have the ability to edit ~/.bashrc you should be able to install all these programs in your home directory where you should have absolute access. Section 1.2 should help you on [url=http://wiki.housni.org/index.php?title=Compiling_and_Installing_Vim_7.0_per_user_on_%2Anix&mwiki_session=fad89bb61c0e7345d6f96cae2637ac10#Set_up_the_environment]my wiki[/url] but really, you would save yourself some time if you attempted the suggestions in the link i posted previously. or maybe you already attempted them, but you haven't told me if you have and my jedi powers haven't developed to a level where i can read minds...yet :)
×
×
  • 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.