|
Which Linux distribution is better for a windows developer to start learning Linux? and why?
|
|
|
|
|
Take a look here[^] for some information of the most popular distributions. The 'best' is the one that you feel comfortable with. If you know command line usage, application and hardware setup and C/C++, then you will probably feel comfortable with any of these.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
I merely made a suggestion as to somewhere to look, it is up to you to make the final decision.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Like the timeline in the wikipedia document... I hadn't seen that before...
|
|
|
|
|
I would suggest Ubuntu... it has a huge user community (that is generally VERY helpful) and it is very easy to install and to get going with. I have multiple machines running Ubuntu (11.10 and the LTS version, 10.04). Good luck!
|
|
|
|
|
I switched using OpenSUSE, and found that installing FireFox, Mono and Wine[^] helps a lot.
Bastard Programmer from Hell
|
|
|
|
|
Is there anything in particular you like about openSUSE? I've been using Ubuntu and Fedora mostly, but I'm always curious as to why people choose certain distros.
|
|
|
|
|
Albert Holguin wrote: Is there anything in particular you like about openSUSE?
Ubuntu failed to install on my machine, some missing drivers. SUSE installed without any problems and supports all my old hardware. With SUSE and Mono both coming from Novell, it seemed like a good combination.
The only other distro that I installed is Jolicloud[^], a distro with a HTML-interface that has it's cloud in the desktop. I'm not using it much, though
Bastard Programmer from Hell
|
|
|
|
|
SUSE is a more stable (long term) distro... I'm downloading the newest Fedora release (Vern) to play with. I use Ubuntu quite a bit, but Unity actually slows down graphics quite a bit (resource hog), so I might end up parting ways from Ubuntu (although I still do like it overall).
|
|
|
|
|
When you would learn linux just learn linux don't try to compare with windows. And try start with command prompt. Do not install xwindow at all ...
|
|
|
|
|
I think this is a matter of preference to a certain degree, but personally I prefer Ubuntu Desktop 11.10 because it is the most windows like of all the distributions, and makes it very simple to add and remove modules. Also the Mono Develop Software Development Application makes it easier to develop applications in Linux environment for developers without a deep knowledge of the Operating System which makes a difference for some.
Pete
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Well, actually, they're all moving in a more user friendly direction (except of course server versions). A lot of it has to do with the direction that GNOME is choosing to take, which is a more user friendly and visually appealing desktop environment.
|
|
|
|
|
I'm a little late to this thread I think... anyway, here goes;
I recommend using Debian Lenny as a first distribution. Debian is a very stable distro, and it's great to start with. Some people recommend using Ubuntu, which has a Debian base. Debian has all the similarities people look for in Ubuntu (apt-get, synaptic, gnome, etc.).
It is a great distro, especially for stability. The reason I think it is a good start is because it's quick to get up and running, and good to get comfortable using linux with. Eventually you will get more daring and want to do "newer" things. Debian provides the stability to get used to things, and the challenge of learning to upgrade, fetch dependancies, and compile things from source. It is a little out dated, so when you start getting more daring then you have to do system stuff to bring it up to date. These things are easy to find online because debian has been around for a while.
Id probably start with a vm, move to dual booting or a kvm switch, and then eventually go to an install. I use gentoo now, but I have tried out several distro's.
|
|
|
|
|
Hello friends,
I am learning google API I want to retrieve google contacts using Authsub. And second thing is that i want to use secure token. I have X.509 certificate with private key.
In first step I got token but in second step (To get AuthSubSessionToken) I got error : Invalid AuthSub token. Here my code. please, anybody have idea ?
Help me....
$url = "https://www.google.com/accounts/AuthSubSessionToken";
$token = $token;
$param['sigalg'] = "rsa-sha1";
$nonce = "15948".time()."49418";
$param['data'] = "GET https://www.google.com/accounts/AuthSubSessionToken ".time()." ".$nonce;
$private_key = "MY_PRIVATE_KEY";
$kvpairs = array();
foreach ($param as $k => $v) {
array_push($kvpairs, ($k . '=' . $v));
}
$query_string = '';
$query_string = implode('&', $kvpairs);
$base_string = 'GET'.'&'.$url .'&'.$query_string;
$param['sig'] = base64_encode(hash_hmac('sha1', $base_string, $private_key, true));
uksort($param, 'strcmp');
$header = 'Authorization: AuthSub token="'.$token.'" ';
foreach ($param as $k => $v)
{
$header .= $k . '="' .$v. '" ';
}
$header = trim($header," ");
$headers[]= $header;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$responce = curl_exec($ch);
curl_close($ch);
|
|
|
|
|
Hi guys,
using MAMP v2.0 on Mac ____ Apache/2.0.64 (Unix) -- PHP/5.3.5 -- DAV/2 mod_ssl/2.0.64 -- OpenSSL/0.9.7l -- MySQL 5.5.9
I have a script I am trying to run and It appears to be giving me major memory leaks, which I have attempted to debug and cannot work out how to fix.
Basically, the script is part of a file manager module. It processes the download of a file when given an ID.
The entire file is stored in a database table, as a BLOB, in 64kb chunks (per record), and is streamed down to the client on request.
Database: file_management
Tables: file_details, file_data
file_details:
FileID - int(10) AUTO_INCREMENT
FileTypeID - int(10)
FileType - varchar(60)
FileName - varchar(255)
FileDescription - varchar(255)
FileSize - bigint(20)
FileUploadDate - datetime
FileUploadBy - int(5)
file_details:
FileDataID - int(10) AUTO_INCREMENT
FileID - int(10)
FileData - BLOB
The error I am actually getting is this one (from php error log):
[31-Oct-2011 09:47:39] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 63326173 bytes) in /root/htdocs/file_manager/file_manager_download.php on line 150
Now, the actual function of downloading works if the file is small enough, in this case, less than 40mb, however once it goes over that, like the 60mb file in the error above, it fails. All it does is download a 0kb file.
Obviously, 134217728 bytes is more than 63326173 bytes (128mb vs 60mb).
the Allowed memory size of 134217728 bytes is the directive in php.ini: "memory_limit = 128M ; Maximum amount of memory a script may consume"
If I set this to 256M, it allows me to download that 60mb file, as well as up to about an 80mb file.
Also, if I set this to 1024M it allows me to download a 260mb file and possibly bigger.
So you can see that the problem is a leak somewhere in the script that is eating up all the memory.
Here is the download script:
<?php
ini_set('display_errors',1);
error_reporting(E_ALL & ~E_NOTICE);
$strDB=mysql_connect("localhost","username","password")or die ("Error connecting to mysql.. Error: (" . mysql_errno() . ") " . mysql_error());
$database=mysql_select_db("file_management",$strDB);
if (isset($_GET["id"])) {
$nodelist = array();
$sql_GetFileDetails = "
SELECT
FileID,
FileTypeID,
FileType,
FileName,
FileDescription,
FileSize,
FileUploadDate,
FileUploadBy
FROM file_details WHERE FileID = '".$_GET["id"]."';";
$result_GetFileDetails = mysql_query($sql_GetFileDetails) or die ("No results for this FileID.<br>Your Query: " . $sql_GetFileDetails . "<br> Error: (" . mysql_errno() . ") " . mysql_error());
if (mysql_num_rows($result_GetFileDetails) != 1) { die ("A MySQL error has occurred.<br>Your Query: " . $sql_GetFileDetails . "<br> Error: (" . mysql_errno() . ") " . mysql_error()); }
$FileDetailsArray = mysql_fetch_assoc($result_GetFileDetails);
$sql_GetFileDataNodeIDs = "SELECT FileDataID FROM file_data WHERE FileID = ".$_GET["id"]." order by FileDataID";
if (!$result_GetFileDataNodeIDs = mysql_query($sql_GetFileDataNodeIDs)) { die("Failure to retrive list of file inodes<br />Your Query: " . $sql_GetFileDataNodeIDs . "<br /> Error: (" . mysql_errno() . ") " . mysql_error()); }
while ($row_GetFileDataNodeIDs = mysql_fetch_assoc($result_GetFileDataNodeIDs)) {
$nodelist[] = $row_GetFileDataNodeIDs["FileDataID"];
}
$FileExtension = explode(".",$FileDetailsArray["FileName"]);
$FileExtension = strtolower($FileExtension[1]);
switch ($FileExtension) {
case "mp3": $ctype="audio/mp3"; break;
case "wav": $ctype="audio/wav"; break;
case "pdf": $ctype="application/pdf"; break;
case "zip": $ctype="application/zip"; break;
case "doc": $ctype="application/msword"; break;
case "xls": $ctype="application/vnd.ms-excel"; break;
case "ppt": $ctype="application/vnd.ms-powerpoint"; break;
case "gif": $ctype="application/force-download"; break;
case "png": $ctype="application/force-download"; break;
case "jpeg": $ctype="application/force-download"; break;
case "jpg": $ctype="application/force-download"; break;
default: $ctype="application/force-download";
}
header("Date: ".gmdate("D, j M Y H:i:s e", time()));
header("Cache-Control: max-age=2592000");
header("Accept-Ranges: bytes");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=\"".$FileDetailsArray["FileName"]."\"");
header("Content-Transfer-Encoding: binary");
header("Content-Type: ".$FileDetailsArray["FileSize"]);
ob_end_clean();
ob_start();
ob_start("ob_gzhandler");
$sql_GetFileDataBlobs = "SELECT FileData FROM file_data WHERE FileID = ".$_GET["id"]." ORDER BY FileDataID ASC;";
if (!$result_GetFileDataBlobs = mysql_query($sql_GetFileDataBlobs)) { die("Failure to retrive list of file inodes<br />Your Query: " . $sql_GetFileDataBlobs . "<br /> Error: (" . mysql_errno() . ") " . mysql_error()); }
while ($row_GetFileDataBlobs = mysql_fetch_array($result_GetFileDataBlobs)) {
echo $row_GetFileDataBlobs["FileData"];
}
ob_end_flush();
header('Content-Length: '.ob_get_length());
ob_end_flush();
}
?>
I have used Xdebug and output the results for peak memory usage, but nothing appears to be going anywhere near the limits, in total the peak memory usage was something like 900kb for the page.
So I am thinking it is aggregating the file chunks into memory and not letting them go, or something similar, but the file chunks are the only thing that would reach that amount of memory, causing the script to fail.
I can provide the script to upload a file to the database so you can test my script if you like, just let me know
Cheers for any help!
Mick
modified 30-Oct-11 21:03pm.
|
|
|
|
|
I have partially solved this problem.
I was told on another forum to add ob_flush(); to the While loop where I am echoing out my file nodes. This appears to work in part; it allows me to download a 140mb file with only 128M memory_limit directive set in php.ini
However, when I attempt to download a 250mb file the error is thrown again:
[31-Oct-2011 11:46:01] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 132392961 bytes) in /root/htdocs/file_manager/file_manager_download.php on line 125
[31-Oct-2011 11:46:01] PHP Stack trace:
[31-Oct-2011 11:46:01] PHP 1. {main}() /root/htdocs/file_manager/file_manager_download.php:0
[31-Oct-2011 11:46:01] PHP 2. ob_flush() /root/htdocs/file_manager/file_manager_download.php:125
As you can see, it is getting within 2mb of the limit and then failing, and I can actually see it streaming the file to the browser, it gets to about 200mb of the 250mb file, and fails.
The while loop looks like:
while ($row_GetFileDataBlobs = mysql_fetch_array($result_GetFileDataBlobs)) {
echo $row_GetFileDataBlobs["FileData"];
ob_flush();
}
so it appears to be working better than before, but that REALLY large files dont work.
The question is then, do I need to increase my memory_limit directive, or should it be streaming effectively with the limit of 128M but I still have a problem with my code and the way it is, or is not, trashing the memory it doesn't need.
Cheers
Mick
|
|
|
|
|
Ok, I have added to it and resolved the problem.
The problem was two fold.
1 - I wasn't using ob_flush() inside the while loop. I added that in and it appeared to free up a lot of memory, enabling larger downloads, but not unlimited.
For example, with memory_limit = 128M i could now download more than 40mb, in fact i could now get up to around 200mb. But this is where it failed again. First memory issue problem solved though.
LESSON 1: Flush your objects!
2 - I was using mysql_query to retrieve the results for my SQL Query. The problem is that it buffers these results, and this was adding to my memory limit issue.
I ended up using mysql_unbuffered_query instead and this now works flawlessly.
This does however come with some limitations, that it locks your table while reading results.
LESSON 2: Don't buffer mysql results if not required! (within programmatic limitations)
FINAL LESSON:
All of these fixes work, however, it requires some more testing to ensure that there is no problems with the combination of them.
Also, I have learned a lot more about objects and php memory allocation, I just wish there was a way to visually debug the process a little better than what xdebug offers. If anyone has any ideas on how xdebug could have actually shed some light on this process, please let me know in the comments.
Hope this helps someone else out in the future.
|
|
|
|
|
Also use unset function to removed unused variables and array..
|
|
|
|
|
I am using this code to send emails but when the user send something in arabic I get unreadable message like this:
تجربة من الصÙØØ© العربية
here is my code.. please help..
<?php
$ToEmail = 'reception@rmc.bh';
$EmailSubject = 'Email from rmc.bh ';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= 'Bcc: dhr@rmc.bh' . "\r\n";
$mailheader .= 'Bcc: jkh@rmc.bh' . "\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY .= nl2br($_POST["message"])."<br><br><br><hr>";
$MESSAGE_BODY .= "IP Address: ".$_SERVER["REMOTE_ADDR"]."<br>";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
header('Location: http://www.rmc.bh/thankyou.php');
?>
|
|
|
|
|
In the email header you are setting the MIME content type as HTML, using the ISO-8859-1 character set - that's the Latin-1 set, so that might explain why the Arabic is coming out wrong.
The simplest solution could be to change the header to use "charset=utf-8" instead of iso-8859-1, and also check that your application uses UTF-8 throughout (in HTTP headers, on the web page, form fields, database fields, etc.)
|
|
|
|
|
Hi,
I have skills saved in a table called skills in mysql with field name called skill_name.
I want to retrieve the skills and display like a cloud so one will have small font and next one will have larger font, etc..
something like this image:
http://www.rmc.bh/temp.jpg[^]
can anyone guide please..
|
|
|
|
|
|
Hi,
I wantt o know how can I have a facebook-like or linkedin-like modal dialog they used for properties and alerts?
Thanks,
Jassim
|
|
|
|
|
Modal box in html is clever combination of images. If you can figure out how to create that modal box, then rest is easy.
you can call the page with the modal box, It will have to have some javascript code to show the modal box properly., rest is up to you..
|
|
|
|
|