I'm still using md5 hashing for my site and I need to upgrade, yet I don't know how... Here is the code that I'm using now     $salt1 = "mysite";     $salt1 = md5($salt1);     $salt2 = "passed";     $salt2 = md5($salt2);     $salt3 = "php";     $salt3 = md5($salt3);     $password1 = $salt1.$password1.$salt3;
It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection.  This question,   suggests that hashing multiple times may be a good idea, whereas  suggests using salt.  I'm using PHP. I want a safe and fast password encryption system. Hashing a password a million times may be safer, but also slower. How to achieve a good balance between speed and safety? Also, I'd prefer the result to have a constant number of characters.   The hashing mechanism must be available in PHP It must be safe It can use salt (in this case, are all salts equally good? Is there any way to generate good salts?)   Also, should I store two fields in the database (one using MD5 and another one using SHA, for example)? Would it make it safer or unsafer?  In case I wasn't clear enough, I want to know which hashing function(s) to use and how to pick a good salt in order to have a safe and fast password protection mechanism.  Related questions that don't quite cover my question:
Multiple servers acting like a single one with all the hardware? by now I have 10 servers for hpc, power computing oriented. My users need to launch several processes using qmake. The users are used to work with ubuntu 9.10, and the software from the repositories is switable for them.  I've deployed ubuntu 9.10 to all 10 servers (pxe rocks).  By now we work with parallel-ssh and cluster-ssh, which allows as to launch the same process to all servers. With this tools this tools the servers remain as independent but with the same software and the same launched command.  Now we would like to go to next step and see all the servers as a single one with all the resources from the other 9 as if was its resources.   The difference would be substantial in time to process and also time to design the command to launch.  Any advice on wich software to use will be very useful?  Thanks I am writing a document for which I need the margin to be exactly as follows: left, right, top and bottom text margin all equal to 1in, distance from bottom of the paper to page number equal to 0.75in (I don't have any footnote or header to set).  I tried to use the fullpage package in LaTeX but it does not give me the 0.75in to the page number. Is there a way to force that? I tried to set manually the margins for a 8.5x11 paper but I am not succeeding.    I tried but after writing:  \documentclass[PhD]{class_file} \usepackage[margin=1in,footskip=0.25in]{geometry}   I get the error message \paperwidth (0.0pt) too short.  I don't see the \paperwidth is set to 0.0pt anywhere though..  Also it seems to me that depending on which machine I use to compile my tex file, I get different margins, even when I set them up manually (without using geometry). Is it possible?    Using the geometry package things seem to work a bit better now (I changed machine and the problem with the paper width previously mentioned disappeared).   \usepackage[margin=1in,footskip=0.25in]{geometry}   gives me without problem upper, right and left margin of 1in. But the lower margin is 1.2in and I can't change it to be 1in even by using bottom=1in or bottom=0.8in. I really don't see how this can happen. Maybe a problem with the spacing between lines? The class files I am using can be fund at   I erased the margin settings of uclath12.clo as the margin I need are different from the ones that this file gives. Thank you. Is there any easy LINQ expression to concatenate my entire List&lt;string&gt; collection items to a single string with a delimiter character?  What if the collection is of custom objects instead of string? Imagine I need to concatenate on object.Name. How do I open PDF in Adobe Reader DC without locking the file from being updated by pdflatex? I don't know if this is possible on Adobe Reader DC on Windows, but asking in case someone has managed to do it.   When I am working on a large document in LaTeX (I use TexStudio) I sometimes like to keep a second copy of my PDF on a second screen so that I can easily refer to what I wrote before, while on my main screen I would have TexStudio with its preview window, which is typically automatically in sync with my current editing location.  On Ubuntu (which uses evince as its default PDF viewer) I used to do it quite nicely. It also seems to watch the PDF file for updates, and keeps in sync of any new versions of the PDF file and reloads it (staying on the same page) when I re-run pdflatex from TexStudio.  At the moment I am working on a Windows machine, and I am trying to recreate the same workflow. I would really like to open a second viewer on my second screen so that I can navigate easily to previous chapters without losing my current position in TexStudio's preview window (which will anyway go back to the current editing location when I run pdflatex).  The only problem however is that when I open the PDF in Adobe Reader DC to put it on the second screen and then I try to recompile the PDF I get the error "I can't write to file". I presume that for some stupid reason Adobe Reader DC maintains some write lock on the file, probably keeping it open while the PDF is visible on screen.  Is there a way to disable this stupid file-locking behaviour from Adobe Reader DC?  UPDATE  After some valuable comments, a workaround is possible using a different viewer. One could either use  or  (the default PDF viewer on Ubuntu, but also available for Windows). They are not so feature rich, and maybe do not look so nice, but in this case do the job.  A similar question was posted  for reference. Is there a way to fully stretch one line of text on the full width of the page, without manually setting the letter spacing, no matter how many characters on the line? Let $f,g:X\to Y$ be maps of spaces such that $f\simeq g$. Is it true that the mapping cones $\operatorname{cone}(f)$ and $\operatorname{cone}(g)$ are homotopy equivalent?  Can we write down an explicit homotopy equivalence? It ought not to be too hard to get a map $\operatorname{cone}(f)\to \operatorname{cone}(g)$ from the existence of a homotopy $H:X\times I\to Y$, but I haven't been able to find a sensible candidate, despite trying for quite a while. Does an ability or spell grant me the bonus action with which to use it? The  description of casting times says that spells with a casting time of &quot;bonus action&quot; require a bonus action to cast (p. 79, emphasis mine):  Most spells require a single action to cast, but some spells require a bonus action, a reaction, or much more time to cast. Bonus Action A spell cast with a bonus action is especially swift. You must use a bonus action on your turn to cast the spell, provided that you haven't already taken a bonus action this turn. You can't cast another spell during the same turn, except for a cantrip with a casting time of 1 action.  It's pretty clear that bonus actions aren't automatic (p. 69):  You can take a bonus action only when a special ability, spell, or other feature of the game states that you can do something as a bonus action. You otherwise don't have a bonus action to take.  So to cast a spell like Healing Word (p. 93), do I  need to be granted a bonus action that I can use, or do I have a bonus action I can use?  I guess I'm unclear on whether I need to have a bonus action before I can spend it on something, or whether having an ability, spell, or whatnot that can be done as a bonus action grants me the bonus action I need to use it. difference fn(String... args) vs fn(String[] args) Whats this syntax useful for :       function(String... args)   Is this same as writing       function(String[] args)    with difference only while invoking this method or is there any other feature involved with it ? AlwaysOn AG: Current Host Server - Owner Node - Primary Instance I'm building up a SQL Server AlwaysOn AG and I'm on the step "failover", manual and automatic:  I noticed that in the Windows Server Failover Cluster a "Current Host Server" exists. My knowledge says that this is the "master" of the cluster that the cluster hosts. But now I noticed that the "Owner Node", which hosts the Availability Group(-role) a other node could be. (The owner node is also the primary instance of the AG, right?)  Now for me there exist two questions for the normal operating of an AlwaysOn AG:  Q1: Should the "Current Host Server" the same as the Owner Node of the AlwaysOn AG?  Q2: Imagine if I want to maintain a host. Shall I first failover the AG (via SSMS or with ALTER AVAILABILITY GROUP...) to the second node/another node and at second a failover of the WSFC-Current Host?  Maybe someone could help me with this questions and give me some advice.  Thanks Linux ACL behaviour: settings the mask changes 'ls' output, but not actual permissions Confused About Trigonometric Substitution How do I expire a PHP session after 30 minutes? I need to keep a session alive for 30 minutes and then destroy it. Convert ArrayList to String[] array Evaluating the nested radical $ \sqrt{1 + 2 \sqrt{1 + 3 \sqrt{1 + \cdots}}} $. How does one prove the following limit? $$   \lim_{n \to \infty}   \sqrt{1 + 2 \sqrt{1 + 3 \sqrt{1 + \cdots \sqrt{1 + (n - 1) \sqrt{1 + n}}}}} = 3. $$ How to add CC to a webform email? I'm using Drupal 7.  Is it possible to add a CC to a webform email?  I was using   function theme_webform_mail_headers($variables) {   $headers = array(     'X-Mailer' =&gt; 'Drupal Webform (PHP/' . phpversion() . ')',   );   return $headers; }   changing it with      function MYTHEME_webform_mail_headers($variables) {       $headers = array( 'CC' =&gt; 'ccmeail@domain.com', 'X-Mailer' =&gt; 'Drupal Webform (PHP/'. phpversion() .')',  );       return $headers;     }   It does not work, I've cleared all the chaches and it does not add the CC. How could I add the CC?  Thanks in advance. Is there a good resource or tool to help build a palette/color scheme around colors I select? No matter how nice the composition, flow, and lines of my design are, if I am not copying directly from nature, I have a very difficult time picking a decent color scheme.  It either looks too drab, or too garish.  Is there a good resource that will help me to choose a color scheme that has 2 or 3 colors, and the colors do not clash?  I'm not looking for specific colors or color schemes.  What I need is a resource that will help me choose a color (or colors) that go nicely with, or provide a good accent to, whatever main color I am working with on the design. How to find the list of all available packages along with the lastest version number available in the repositories? I want to list all the packages(installed or not installed) along with the latest version number available in the repositories.  For example:  The output of apt-cache policy chromium-browser shows like below  $ apt-cache policy chromium-browser chromium-browser:   Installed: (none)   Candidate: 34.0.1847.116-0ubuntu2   Version table:      34.0.1847.116-0ubuntu2 0         500 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty/universe amd64 Packages   So the latest version of chromium-browser package available in the repository is 34.0.1847.116-0ubuntu2. Like that, i want to list the version number along with the package names that are available in repositories. And all i want to do this through command-line.  I want the output to be like this,  chromium-browser 34.0.1847.116-0ubuntu2 xxxxxxxxxxxxxx   yyyyyyyyyyy ............     ............ Run a nohup command over SSH, then disconnect I want to execute a script, start.sh on a remote server which runs this:  nohup node server.js &amp;   Naively, I call SSH like this:  ssh myserver &lt;&lt;EOF ./start.sh &amp; EOF   This starts the script, but leaves the session connected. I want to follow this step with other commands in a script, so that's no good.  How can I SSH to the remote machine, launch a nohup command into the background, then disconnect? I suppose I could put the SSH process itself into the background, but that doesn't seem right. Bypass GeneratedValue in Hibernate (merge data not in db?) I am thinking of buying a digital SLR camera. What things should I be looking for?