How to determine HP Smart Array model?
How to determine HP Smart Array model on HP server? I own HP 350 G6 server.
Really do not know where to look, is there a utility tool that can help me
find this information, or is there a sign on the hardware?
Thanks
Tuesday, 1 October 2013
VPS apache config - Invalid command 'PassengerDefaultRuby' after adding latest passenger gem
VPS apache config - Invalid command 'PassengerDefaultRuby' after adding
latest passenger gem
used to have this list of rubies in my vps:
ruby-1.9.2-p320 [ i686 ]
=* ruby-1.9.3-p194 [ i686 ]
ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
today I installed a new app on this vps on ruby 2.0, so I added 2.0 to rvm:
ruby-1.9.2-p320 [ i686 ]
ruby-1.9.3-p194 [ i686 ]
ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
=* ruby-2.0.0-p247 [ i686 ]
installed passenger and passenger-apache-module, instructions says to add
these lines:
LoadModule passenger_module
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby
to /etc/apache2/apache2.conf and restart apache, after restart I got this
error:
Syntax error on line 242 of /etc/apache2/apache2.conf:
Invalid command 'PassengerDefaultRuby', perhaps misspelled or defined by a
module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
and one more problem, when I open my app at http://nccm.md I got:
Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
from gem list command I can see this gem is installed in ruby 2.0
environment, but the app looks for it in
usr/local/rvm/gems/ruby-1.9.3-p194@global and not in
ruby-2.0.0-p247@global. Why is that? Thank you for any help.
latest passenger gem
used to have this list of rubies in my vps:
ruby-1.9.2-p320 [ i686 ]
=* ruby-1.9.3-p194 [ i686 ]
ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
today I installed a new app on this vps on ruby 2.0, so I added 2.0 to rvm:
ruby-1.9.2-p320 [ i686 ]
ruby-1.9.3-p194 [ i686 ]
ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
=* ruby-2.0.0-p247 [ i686 ]
installed passenger and passenger-apache-module, instructions says to add
these lines:
LoadModule passenger_module
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby
to /etc/apache2/apache2.conf and restart apache, after restart I got this
error:
Syntax error on line 242 of /etc/apache2/apache2.conf:
Invalid command 'PassengerDefaultRuby', perhaps misspelled or defined by a
module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
and one more problem, when I open my app at http://nccm.md I got:
Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
from gem list command I can see this gem is installed in ruby 2.0
environment, but the app looks for it in
usr/local/rvm/gems/ruby-1.9.3-p194@global and not in
ruby-2.0.0-p247@global. Why is that? Thank you for any help.
Monday, 30 September 2013
Minimum size for a /home partition?
Minimum size for a /home partition?
Here's how my partitions are currently set up:
500 GB HDD: [21 GB Free Space] [145 GB Windows partition - unfortunately I
can't move it so it starts at the beginning of the Hard disk] [175 GB Data
partition]* [145 GB Extended partition, containing / and Swap]
SDD: [30 GB used as a cache for the HDD in Windows]
*Note that my "My Documents." "My Downloads," etc. folders are relocaed to
the data partition. The "Documents," "Downloads," etc. folders in linux
are symlinked to the same folders.
I'd like to reinstall Ubuntu and put / on the SSD. I'd also like to make
use of the 21 GB on my HDD before the windows partition. Here's what I was
thinking:
HDD: [8 GB SWAP] [13 GB /home]** [145 GB Windoze] [320 GB Data]
SDD: [30 GB / ]
**Alternatively, I could make this 21 GB and move the SWAP partition to be
after the Windows Partition.
My question is: What's the minimum size I can make my /home partition so I
will probably never run out of space, given that all of my Documents,
Downloads, and Media will be on a seperate partition?
Here's how my partitions are currently set up:
500 GB HDD: [21 GB Free Space] [145 GB Windows partition - unfortunately I
can't move it so it starts at the beginning of the Hard disk] [175 GB Data
partition]* [145 GB Extended partition, containing / and Swap]
SDD: [30 GB used as a cache for the HDD in Windows]
*Note that my "My Documents." "My Downloads," etc. folders are relocaed to
the data partition. The "Documents," "Downloads," etc. folders in linux
are symlinked to the same folders.
I'd like to reinstall Ubuntu and put / on the SSD. I'd also like to make
use of the 21 GB on my HDD before the windows partition. Here's what I was
thinking:
HDD: [8 GB SWAP] [13 GB /home]** [145 GB Windoze] [320 GB Data]
SDD: [30 GB / ]
**Alternatively, I could make this 21 GB and move the SWAP partition to be
after the Windows Partition.
My question is: What's the minimum size I can make my /home partition so I
will probably never run out of space, given that all of my Documents,
Downloads, and Media will be on a seperate partition?
Labeling a three-dimensional plot mathematica.stackexchange.com
Labeling a three-dimensional plot – mathematica.stackexchange.com
As the title says, I want to add some text in a three-dimensional plot,
thus labeling specific parts of it. Here is the corresponding Mathematica
code V = 1/2*(x^2 + y^2 + z^2) + (x^2*y^2 + x^2*z^2 + …
As the title says, I want to add some text in a three-dimensional plot,
thus labeling specific parts of it. Here is the corresponding Mathematica
code V = 1/2*(x^2 + y^2 + z^2) + (x^2*y^2 + x^2*z^2 + …
How Do I Give My C++ Application The File Path Of The File Clicked To Open Said Application
How Do I Give My C++ Application The File Path Of The File Clicked To Open
Said Application
I have an application that uses custom file types, and I have associated
these file types with my application (Windows File System). When I double
click the file my application opens, but I would like to be able to pass
in the data from the file.
I had hoped that the file path would have been sent to main, but no such
luck. Whenever I open the application by clicking on a file 'argc' reads
'0'. Opening the application normally give 'argc' as '1'.
Is there a way to pass in the file path used to open the application?
Said Application
I have an application that uses custom file types, and I have associated
these file types with my application (Windows File System). When I double
click the file my application opens, but I would like to be able to pass
in the data from the file.
I had hoped that the file path would have been sent to main, but no such
luck. Whenever I open the application by clicking on a file 'argc' reads
'0'. Opening the application normally give 'argc' as '1'.
Is there a way to pass in the file path used to open the application?
Sunday, 29 September 2013
null pointer exception for contextWrapper.getResources()? when using custom listener
null pointer exception for contextWrapper.getResources()? when using
custom listener
getting a strange null pointer exception for a common type of custom
listener that i have implemented before without any problems.
how do i fix this problem?
from the logcat:
09-30 10:55:15.360: E/AndroidRuntime(2207): FATAL EXCEPTION: main 09-30
10:55:15.360: E/AndroidRuntime(2207): java.lang.NullPointerException 09-30
10:55:15.360: E/AndroidRuntime(2207): at
android.content.ContextWrapper.getResources(ContextWrapper.java:81) 09-30
10:55:15.360: E/AndroidRuntime(2207): at
android.widget.Toast.(Toast.java:92) 09-30 10:55:15.360:
E/AndroidRuntime(2207): at android.widget.Toast.makeText(Toast.java:233)
09-30 10:55:15.360: E/AndroidRuntime(2207): at
StartActivity.onResultReturned(StartActivity.java:124) 09-30 10:55:15.360:
E/AndroidRuntime(2207): at
jp.co.forever.tankinspectionsystem.Synchronizer.sendInt(Synchronizer.java:215)
09-30 10:55:15.360: E/AndroidRuntime(2207): at
jp.co.forever.tankinspectionsystem.Synchronizer$SendOutMsgAndPack$2.run(Synchronizer.java:162)
code for the listener in the StartActivity class, this is utility class
that does not extend activity, and all the code here runs in a new thread
run method separate from the UI thread
in class variables declarations
public OnResultReturnedListener listener;
in oncreate
listener = new StartActivity();
listener is an interface as a nested subclass in this activity class
public interface OnResultReturnedListener {
public void onResultReturned(int result);
}
code in the other class that implements the listener, all code runs on UI
main thread, no additional thread are created
public class StartActivity extends Activity
implements Synchronizer.OnResultReturnedListener {
// method onResultReturned is override for custom listerner class
// OnResultReturnedListener interface inside of the Synchronizer class
@Override
public void onResultReturned(int result) {
// toast like this or any other method that touched the
// UI thread will result in a crash
Toast.makeText(StartActivity.this, "value returned "
+ result , Toast.LENGTH_SHORT).show();
// putting the Toast in a handler will not help, still results in crash
handler.post(new Runnable() {
@Override
public void run() {
Toast.makeText(StartActivity.this, "value returned "
+ result, Toast.LENGTH_SHORT).show();
}
});
//adding a handler.post to the other class, Synchronizer,
// that the method call comes from
// will not help and still causes crashes, for example
//handler.post(new Runnable() {
//@Override
//public void run() {
//fileTransferStatus = 1;
// listener.onResultReturned(fileTransferStatus);
// }
//});
// this statement will not cause crash
int x = 13;
}
}
custom listener
getting a strange null pointer exception for a common type of custom
listener that i have implemented before without any problems.
how do i fix this problem?
from the logcat:
09-30 10:55:15.360: E/AndroidRuntime(2207): FATAL EXCEPTION: main 09-30
10:55:15.360: E/AndroidRuntime(2207): java.lang.NullPointerException 09-30
10:55:15.360: E/AndroidRuntime(2207): at
android.content.ContextWrapper.getResources(ContextWrapper.java:81) 09-30
10:55:15.360: E/AndroidRuntime(2207): at
android.widget.Toast.(Toast.java:92) 09-30 10:55:15.360:
E/AndroidRuntime(2207): at android.widget.Toast.makeText(Toast.java:233)
09-30 10:55:15.360: E/AndroidRuntime(2207): at
StartActivity.onResultReturned(StartActivity.java:124) 09-30 10:55:15.360:
E/AndroidRuntime(2207): at
jp.co.forever.tankinspectionsystem.Synchronizer.sendInt(Synchronizer.java:215)
09-30 10:55:15.360: E/AndroidRuntime(2207): at
jp.co.forever.tankinspectionsystem.Synchronizer$SendOutMsgAndPack$2.run(Synchronizer.java:162)
code for the listener in the StartActivity class, this is utility class
that does not extend activity, and all the code here runs in a new thread
run method separate from the UI thread
in class variables declarations
public OnResultReturnedListener listener;
in oncreate
listener = new StartActivity();
listener is an interface as a nested subclass in this activity class
public interface OnResultReturnedListener {
public void onResultReturned(int result);
}
code in the other class that implements the listener, all code runs on UI
main thread, no additional thread are created
public class StartActivity extends Activity
implements Synchronizer.OnResultReturnedListener {
// method onResultReturned is override for custom listerner class
// OnResultReturnedListener interface inside of the Synchronizer class
@Override
public void onResultReturned(int result) {
// toast like this or any other method that touched the
// UI thread will result in a crash
Toast.makeText(StartActivity.this, "value returned "
+ result , Toast.LENGTH_SHORT).show();
// putting the Toast in a handler will not help, still results in crash
handler.post(new Runnable() {
@Override
public void run() {
Toast.makeText(StartActivity.this, "value returned "
+ result, Toast.LENGTH_SHORT).show();
}
});
//adding a handler.post to the other class, Synchronizer,
// that the method call comes from
// will not help and still causes crashes, for example
//handler.post(new Runnable() {
//@Override
//public void run() {
//fileTransferStatus = 1;
// listener.onResultReturned(fileTransferStatus);
// }
//});
// this statement will not cause crash
int x = 13;
}
}
Hashing password to SqlServer
Hashing password to SqlServer
I've been reading over and over the code again to see where the error is
being made but I'm unable to find it. I've copied this code from
stackoverflow an never really checked it or understood it perfectly as to
fix it. I'm receiving passwords from a webservice, hashing, salting and
saving it to a SqlServer 2008. The variables on the SqlServer are declared
as mail as nvarchar(64), hash as varbinary(128) and salt as
varbinary(128). The passwords are being saved but when I try to check if
the password are correct the method always returns false. This are my
methods.
public int InsertData(string mail,string Password)
{
int lineas;
UserData usuario = HashPassword(Password);
using (SqlConnection connection = new SqlConnection(Connection))
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = "INSERT INTO Usuarios (Mail,Hash,Salt)
VALUES (@mail,@hash,@salt)";
command.Parameters.AddWithValue("@mail", mail);
command.Parameters.AddWithValue("@hash", usuario.Password);
command.Parameters.AddWithValue("@salt", usuario.salt);
connection.Open();
lineas=command.ExecuteNonQuery();
}
usuario = null;
return lineas;
}
private UserData HashPassword(string Password)
{
//This method hashes the user password and saves it into the
object UserData
using (var deriveBytes = new Rfc2898DeriveBytes(Password, 20))
{
byte[] salt = deriveBytes.Salt;
byte[] key = deriveBytes.GetBytes(20); // derive a 20-byte key
UserData usuario = new UserData();
usuario.Password = key;
usuario.salt = salt;
return usuario;
}
}
And the next method is the one I use to validate de password, it always
returns false
private bool CheckPassword(string Password, byte[] hash, byte[] salt)
{
// load salt and key from database
using (var deriveBytes = new Rfc2898DeriveBytes(Password, salt))
{
byte[] newKey = deriveBytes.GetBytes(20); // derive a 20-byte
key
if (!newKey.SequenceEqual(hash))
return false;
else
return true;
}
}
This method receives the login info
public bool ValidateLogIn(string mail, string Password)
{
using (SqlConnection connection = new SqlConnection(Connection))
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = "Select * from Usuarios where Mail=@mail";
command.Parameters.AddWithValue("@mail",mail);
connection.Open();
using (SqlDataReader reader = command.ExecuteReader())
{
reader.Read();
byte[] hash = (byte[])reader["Hash"];
byte[] salt = (byte[])reader["Salt"];
if(CheckPassword(Password,hash,salt))
{
/
UpdateData(mail, Password);
return true;
}
else
{
return false;
}
}
}
}
Any ideas what could be wrong?
I've been reading over and over the code again to see where the error is
being made but I'm unable to find it. I've copied this code from
stackoverflow an never really checked it or understood it perfectly as to
fix it. I'm receiving passwords from a webservice, hashing, salting and
saving it to a SqlServer 2008. The variables on the SqlServer are declared
as mail as nvarchar(64), hash as varbinary(128) and salt as
varbinary(128). The passwords are being saved but when I try to check if
the password are correct the method always returns false. This are my
methods.
public int InsertData(string mail,string Password)
{
int lineas;
UserData usuario = HashPassword(Password);
using (SqlConnection connection = new SqlConnection(Connection))
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = "INSERT INTO Usuarios (Mail,Hash,Salt)
VALUES (@mail,@hash,@salt)";
command.Parameters.AddWithValue("@mail", mail);
command.Parameters.AddWithValue("@hash", usuario.Password);
command.Parameters.AddWithValue("@salt", usuario.salt);
connection.Open();
lineas=command.ExecuteNonQuery();
}
usuario = null;
return lineas;
}
private UserData HashPassword(string Password)
{
//This method hashes the user password and saves it into the
object UserData
using (var deriveBytes = new Rfc2898DeriveBytes(Password, 20))
{
byte[] salt = deriveBytes.Salt;
byte[] key = deriveBytes.GetBytes(20); // derive a 20-byte key
UserData usuario = new UserData();
usuario.Password = key;
usuario.salt = salt;
return usuario;
}
}
And the next method is the one I use to validate de password, it always
returns false
private bool CheckPassword(string Password, byte[] hash, byte[] salt)
{
// load salt and key from database
using (var deriveBytes = new Rfc2898DeriveBytes(Password, salt))
{
byte[] newKey = deriveBytes.GetBytes(20); // derive a 20-byte
key
if (!newKey.SequenceEqual(hash))
return false;
else
return true;
}
}
This method receives the login info
public bool ValidateLogIn(string mail, string Password)
{
using (SqlConnection connection = new SqlConnection(Connection))
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = "Select * from Usuarios where Mail=@mail";
command.Parameters.AddWithValue("@mail",mail);
connection.Open();
using (SqlDataReader reader = command.ExecuteReader())
{
reader.Read();
byte[] hash = (byte[])reader["Hash"];
byte[] salt = (byte[])reader["Salt"];
if(CheckPassword(Password,hash,salt))
{
/
UpdateData(mail, Password);
return true;
}
else
{
return false;
}
}
}
}
Any ideas what could be wrong?
Subscribe to:
Posts (Atom)