Search Results

Search found 9 results on 1 pages for 'poma'.

Page 1/1 | 1 

  • How to use public-key ssh authentication

    - by Poma
    I have 2 ubuntu 12.04 (beta) servers (node1 and node2) and want to establish passwordless root access between them. Other users should not have access to other boxes. Also note that ssh default port is changed to 220. Here's what I did: sudo -i cd /root/.ssh ssh-keygen -t rsa # with default name and empty password cat id_rsa.pub > authorized_keys then copied id_rsa & id_rsa.pub to node2 and added id_rsa.pub to authorized_keys. Both hosts have the same /root/.ssh/config file: Host node1 Hostname 1.2.3.4 Port 220 IdentityFile /root/.ssh/id_rsa Host node2 Hostname 5.6.7.8 Port 220 IdentityFile /root/.ssh/id_rsa Now the problem is that when I type ssh node2 it asks me for password. What may be the problem?

    Read the article

  • How to choose NoSQL database engine?

    - by Poma
    We have a database with following specs: 30k records, 7mb in size 20 inserts/second 1000 updates/second 1000 range selects/second, by secondary index, approx 10 rows each needs at least one secondary index needs some mechanism to expire keys if they are not updated for 75 secs (can be done via programmatic garbage collector but will require additional 'last_update' index and will add some load) consistency is not required durability is not required db should be stored in memory For now we use Redis, but it does not have secondary index and it's keys index:foo:* is too slow. Membase also does not have secondary index (as far as I know). MongoDB and MySQL memory engine have table-level locks. What engine will fit our use case?

    Read the article

  • Should I completely turn off swap for linux webserver?

    - by Poma
    Recently my friend told me that it is a good idea to turn off swap on linux webservers with enough memory. My server has 12 GB and currently uses 4GB (not counting cache and buffers) under peak load. His argument was that in a normal situation server will never use all of its RAM so the only way it can encounter OutOfMemory situation is due to some bug/ddos/etc. So in case swap is turned off system will run out of memory that will eventually crash the program hogging memory (most likely the web server process) and probably some other processes. In case swap is turned on it will eat both RAM and swap and eventually will result in the same crash, but before that it will offload crucial processes like sshd to swap and start to do a lot of swap operations resulting in major slowdown. This way when under ddos system may go into a completely unusable condition due to huge lags and I probably will not be unable to log in and kill webserver process or deny all incoming traffic (all but ssh). Is this right? Am I missing something (like the fact that swap partition is very useful in some way even if I have enough RAM)? Should I turn it off?

    Read the article

  • PerformanceCounter.NextValue hangs on some machines.

    - by Poma
    I don't know why, but many computers hangs on following operation: void Init() { net1 = new List<PerformanceCounter>(); net2 = new List<PerformanceCounter>(); foreach (string instance in new PerformanceCounterCategory("Network Interface").GetInstanceNames()) { net1.Add(new PerformanceCounter("Network Interface", "Bytes Received/sec", instance)); net2.Add(new PerformanceCounter("Network Interface", "Bytes Sent/sec", instance)); } } //Once in 1 second void UpdateStats() { Status.Text = ""; for (int i = 0; i < net1.Count; i++) Status.Text += string.Format("{0}/{1} Kb/sec; ", net1[i].NextValue() / 1024, net2[i].NextValue() / 1024); } On some computes program hangs completely on first call of UpdateStats(), others experiencing 100% CPU load but program works (slowly). Other counters like new PerformanceCounter("Processor", "% Processor Time", "_Total") seems to work fine. Any suggwstions why is that?

    Read the article

  • SendMessage vs. WndProc

    - by Poma
    I'm trying to extend TextBox control to add watermarking functionality. The example I've found on CodeProject is using imported SendMessage function. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); void SetWatermark() { SendMessage(this.Handle, 0x1501, 0, "Sample"); } I'm wondering why not use protected WndProc instead void SetWatermark() { var m =new Message() { HWnd = this.Handle, Msg = 0x1501, WParam = (IntPtr)0, LParam = Marshal.StringToHGlobalUni("Sample") }; WndProc(ref m); } Both seem to work fine. Almost all examples I've seen on internet use SendMessagefunction. Why is that? Isn't WndProc function designed to replace SendMessage? P.S. I don't know right to convert string to IntPtr and found that Marshal.StringToHGlobalUni works ok. Is it right function to do this?

    Read the article

  • WebBrowser.InnerHtml strange behavior

    - by Poma
    I'm trying to load page and then remove some elements in it. While doing that I encountered strange behavior. When I do webBrowser1.Document.Body.InnerHtml = webBrowser1.Document.Body.InnerHtml; It turns off some JavaScript code, for example for Google.com it turns off auto completion. Why is that? I suppose it has something to do with JavaScript initialization, if so how can I reinitialize the page?

    Read the article

  • Dns caching for sockets

    - by Poma
    I'm connecting to some websites through socks proxy server. In my case its very good to implement dns cache, so proxy don't need to resolve website's ip address. So, I performed DNS lookup, but don't know where to supply IP address. mySocket.Connect uses proxy's ip address so it isn't right place. I tried to place it in http header GET http://11.22.33.44/index.html HTTP/1.1 - this doesn't work (even in browser) since website is on virtual hosting. It seems that Host header is right place for resolved ip address. Am I right? Will proxy resolve host name (since it's still there in GET header) or not?

    Read the article

  • How to receive HTTP messages using Socket

    - by Poma
    I'm using Socket class for my web client. I can't use HttpWebRequest since it doesn't support socks proxies. So I have to parse headers and handle chunked encoding by myself. The most difficult thing is to determine length of content so I have to read it byte-by-byte. First I have to use ReadByte() to find last header ("\r\n\r\n" combination), then read chunk's size etc. But this approach has very poor performance. Can you suggest better solution? Maybe some open source examples or libraries that handle http request through sockets (not very big and complicated though, I'm a noob)

    Read the article

  • Why my query is not working?

    - by Poma
    my website has PHP command: mysql_query("SELECT * FROM users WHERE id=" . $_GET["id"]) or die(mysql_error()); When I enter URL http://example.com/index.php?id=1;%20UPDATE%20users%20SET%20password=123%20WHERE%20id=1 I get following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE users SET password=abc WHERE id=1' at line 1 But in phpmyamin query executes successfully. What's wrong here? Why it doesn't execute in browser?

    Read the article

1