Daily Archives

Articles indexed Saturday November 9 2013

Page 4/15 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Webinvoke to POST JSON with ajax call

    - by G-Man
    This is my first time that I an using WCF Service with Knockout. I want to POST an entire view model as a JSON object with an ajax call. This is the error message that I get: Endpoints using 'UriTemplate' cannot be used with 'System.ServiceModel.Description.WebScriptEnablingBehavior' I have noticed that some developers send each value as a parameter which I feel is unnecessary especially if you work with a big object. This is my WCF method: [OperationContract] [WebInvoke(UriTemplate = "AddNewEvent?newEvent", Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] public bool AddNewEvent(Models.DAL_CRMEvents newEvent) { Entities.CRMEntities dbCRM = new Entities.CRMEntities(); //Models.CRMEvents crmEvent = new Models.CRMEvents(); Entities.Event crmEvent = new Entities.Event(); crmEvent.EventDateCreated = Convert.ToDateTime(newEvent.DateCreated); crmEvent.EventActive = true; crmEvent.EventDescription = newEvent.Description; crmEvent.EventDate = Convert.ToDateTime(newEvent.Date); crmEvent.EventTimeStart = TimeSpan.Parse(newEvent.TimeStart); crmEvent.EventTimeEnd = TimeSpan.Parse(newEvent.TimeEnd); crmEvent.EventAllDay = newEvent.AllDay; dbCRM.AddToEvent(crmEvent); return true; } This is my ajax function function SaveEvent (data) { var s = { newEvent: ko.mapping.toJS(data) } alert(data.AllDay()); $.ajax({ type: "POST", url: "../Services/CRMDataService.svc/AddNewEvent", data: JSON.stringify(s), contentType: "application/json; charset=utf-8", dataType: "JSON", success: function (result) { alert(result); }, error: function (jqXHR, textStatus, errorThrown) { if (textStatus == "error" && errorThrown != "") { var n = noty({ text: errorThrown, type: 'warning', dismissQueue: false, modal: true, layout: 'center', theme: 'defaults', callback: { } }) } } }) }

    Read the article

  • Fluentemail not working locally but working on server

    - by sreginogemoh
    My web app using Fluentemail to send emails. But there is strange thing happening, it is sending emails on server successfully, but locally I am getting such kind of errors: RazorEngine.Templating.TemplateCompilationException: Unable to compile template. Check the Errors list for details. at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context) at RazorEngine.Templating.TemplateService.CreateTemplate(String template, Type modelType) at RazorEngine.Templating.TemplateService.GetTemplate(String template, Type modelType, String name) at RazorEngine.Templating.TemplateService.Parse[T](String template, T model, String name) at RazorEngine.Razor.Parse[T](String template, T model, String name) at FluentEmail.Email.UsingTemplateFromFile[T](String filename, T model, Boolean isHtml) error CS2001: Source file 'C:\Windows\TEMP\5yn3eqdw.0.cs' could not be found} Is there any way I can fix that?

    Read the article

  • Change default global installation directory for node.js modules in Windows?

    - by gremo
    In my windows installation PATH includes C:\Program Files\nodejs, where executable node.exe is. I'm able to launch node from the shell, as well as npm. I'd like new executables to be installed in C:\Program Files\nodejs as well, but it seems impossible to achieve. Setting NODE_PATH and NODE_MODULES variables doesn't change anything: things are still installed in %appdata%\npm by default. How can I change the global installation path?

    Read the article

  • How i can fix the increasing order summation code?

    - by user2971559
    I want from the java to reads all numbers from the user as long as the number entered by user is bigger than the previous number. But i could write it for only positive numbers. How i can fix code below if all numbers included. If it is possible please write the solution for beginners because its my first year in computer science in college and I haven't learn a lot yet. import acm.program.*; public class IncreasingOrder extends ConsoleProgram { public void run() { int previousNumber = 0; int total = 0; int count = 0; while(true) { int n = readInt("Enter > "); if (n <= previousNumber) break; total += n; count++; previousNumber = n; } println("You have entered " + count + " numbers in increasing order."); println("Sum of these " + count + " numbers is " + total + "."); } }

    Read the article

  • How to save output from the shell?

    - by user2971553
    I want to save this in a file form the shell: Type the number of steps N 10 Type the initial values ti and ai 0 1 23.000000 24.000000 46.000000 576.000000 69.000000 13824.000000 92.000000 331776.000000 115.000000 7962624.000000 138.000000 191102976.000000 161.000000 4586471424.000000 184.000000 110075314176.000000 207.000000 2641807540224.000000 230.000000 63403380965376.000000 253.000000 1521681143169024.000000 how to do it? it does not work by just typing: >./a.out>lalalla.txt

    Read the article

  • Teacher confused about MVC?

    - by Gideon
    I have an assignment to create a game in java using MVC as a pattern. The thing is that stuff I read about MVC aren't really what the teacher is telling me. What I read is that the Model are the information objects, they are manipulated by the controllers. So in a game the controller mutates the placement of the objects and check if there is any collision etc. What my teacher told me is that I should put everything that is universal to the platform in the models and the controllers should only tell the model which input is given. That means the game loop will be in a model class, but also collision checks etc. So what I get from his story is that the View is the screen, the Controller is the unput handeler, and the Model is the rest. Can someone point me in the right direction?

    Read the article

  • Read text and print each (byte) character in separate line

    - by user2967663
    preforming this code to read file and print each character \ (byte) in separate line works well with ASCII void preprocess_file (FILE *fp) { int cc; for (;;) { cc = getc (fp); if (cc == EOF) break; printf ("%c\n", cc); } } int main(int argc, char *argv []) { preprocess_file (stdin); exit (0); } but when i use it with UTF-8 encoded text it shows unredable character such as ï » ? ? § ? „ ? … ? ¤ ? ´ ? and advice ? Thanks

    Read the article

  • Delay in for loop while playing mp3 file C#

    - by daniyalahmad
    I want to give delay in for loop, While in for loop there is mp3 file is playing. What I actually want to do, that every clip plays after 2 sec. There are total 10 clips. Here is my code for (int i=1; i < 10; i++) { System.Threading.Thread.Sleep(1000); WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer(); wplayer.URL = @"D:\Project C#\A-Z\" + i + ".mp3"; }

    Read the article

  • conf.lua not being read (Lua/LOVE 0.8.0)

    - by Brigham Andersen
    I need a higher resolution for my program to run. For some reason I cannot discern alone, LOVE is not applying (or finding?) conf.lua. My folder architecture is as follows: basefolder/ basefolder/main.lua basefolder/conf.lua basefolder/Resources/ My conf.lua reads: function love.conf(t) t.window.width = 1280 t.window.height = 720 end Is it something with my code, or with how my directory is set up?

    Read the article

  • update entire table with pdo

    - by MephDaddy
    I am working on a simple gaming ladder script. I am having little to no luck trying to find an effective way to reset my ladder information while leaving my table id and name fields intact. I am trying to get create a loop to update my entire table, similar to the way I draw my table. Shown below. ...... //Start displaying ladder with with team with most wins at the top echo "<TABLE border=1 width=500 align=center><TR>"; foreach($db->query('SELECT * FROM test ORDER BY win DESC , name ASC') as $row) { echo "<TR><TD>" . $row['name'] . "</TD><TD>" . $row['win'] . "</TD><TD>"; echo $row['loss'] . "</TD><TD>" . $row['battles'] . "</TD><TD>"; echo $row['score'] . "</TD></TR>"; } ...... I currently have a table with 6 fields(id,name,win,loss,battles,score). I want to reset the values of win,loss,battles, and score back to 0. While leaving id and name alone. Effective reseting my ladder for a new season to begin. The only way I have been able to complete this is to find out how many rows there are and run a for loop. It seems vary inefficient. Was hoping I could get some better insight as to how to go about this.

    Read the article

  • setting the openCV configuration in an openGL project produce several errors

    - by GolSa
    I have a win32 solution which is set for openGL; it works well; but I want to write a function which use functions of openCV; I set the configuration for openCV for both X86 and X64;;I commented the openCV function and just to test the correctness of configuration, I run it; but when I want to run it on X64 I faced with the error below: Error 1 error C2065: 'GWL_HINSTANCE' : undeclared identifier D:\matrix\matrixProjection\src\ControllerMain.cpp 35 1 matrixProjection Error 2 error C2664: 'CreateDialogParamW' : cannot convert parameter 4 from 'BOOL (__cdecl *)(HWND,UINT,WPARAM,LPARAM)' to 'DLGPROC' D:\matrix\matrixProjection\src\DialogWindow.cpp 47 1 matrixProjection Error 2 points to this line of code: HWND DialogWindow::create() { /*-->this line*/ handle = ::CreateDialogParam(instance, MAKEINTRESOURCE(id), parentHandle, Win::dialogProcedure, (LPARAM)controller); return handle; } but on Debug Win32 configure, it runs; I used openGL32 in my project; is there any probability to be the cause? is there any X64 version for openGL? I know that there is something needed in X64 mode which my solution can not handle it; I googled a lot about it but I did not find any solution; How can I solve that?

    Read the article

  • Remove a certain value from string which keeps on changing

    - by user2971375
    I m trying to make a utility to generate a Insert script of sql tables along with relational table. I got all the values in c#. Now I want to remove the one column name and its value from the script.most probably the identity column. Eg. The string I have (which keeps on changing with table name and varies) INSERT Core.Customers ([customerId],[customername],[customeradress],[ordernumber]) Values(123,N'Rahul',N'244 LIZ MORN',2334) NOW I know I have to remove CustomerId. (sometimes need to be replaces with @somevariable) Please give me an efficient way how to retrieve customerId value and Deleting column name and value . Conditions: insert script length and columns names keep changing. Method should return the deleted value. At some point of time customer id can be same as order id. In that case my string.remove method fails.

    Read the article

  • VitrtualStringTree. How to Drag'n'Drop to ROOT level?

    - by Alexandr
    A have a tree: ROOT - VirtualStringTree(You don't see it, TVirtualStringTree.RootNode) - My Root Node 1 - My Root Node 2 - - Second node 1 - - Second node 2 - - Second node 3 - My Root Node 3 I can Drag'n'Drop "My Root Node 3" to any visible node, but I can't return it to defaut position, to the root level of tree. I try that: //Part of code from OnDragDrop Event of VirtualStringTree if (Sender.DropTargetNode = Sender.RootNode) then begin for i := 0 to high(Nodes) do begin LinksTree.MoveTo(Nodes[i], Sender.DropTargetNode, Attachmode, False); end; end; I places mouse to nowhere, but nothing happens. In DragOver I accepted drop to root if DropTarget is VST.RootNode. Anybody knows, how to drop node to VST.RootNode if I drag mouse to empty space of component?

    Read the article

  • How and where to implement basic authentication in Kibana 3

    - by Jabb
    I have put my elasticsearch server behind a Apache reverse proxy that provides basic authentication. Authenticating to Apache directly from the browser works fine. However, when I use Kibana 3 to access the server, I receive authentication errors. Obviously because no auth headers are sent along with Kibana's Ajax calls. I added the below to elastic-angular-client.js in the Kibana vendor directory to implement authentication quick and dirty. But for some reason it does not work. $http.defaults.headers.common.Authorization = 'Basic ' + Base64Encode('user:Password'); What is the best approach and place to implement basic authentication in Kibana? /*! elastic.js - v1.1.1 - 2013-05-24 * https://github.com/fullscale/elastic.js * Copyright (c) 2013 FullScale Labs, LLC; Licensed MIT */ /*jshint browser:true */ /*global angular:true */ 'use strict'; /* Angular.js service wrapping the elastic.js API. This module can simply be injected into your angular controllers. */ angular.module('elasticjs.service', []) .factory('ejsResource', ['$http', function ($http) { return function (config) { var // use existing ejs object if it exists ejs = window.ejs || {}, /* results are returned as a promise */ promiseThen = function (httpPromise, successcb, errorcb) { return httpPromise.then(function (response) { (successcb || angular.noop)(response.data); return response.data; }, function (response) { (errorcb || angular.noop)(response.data); return response.data; }); }; // check if we have a config object // if not, we have the server url so // we convert it to a config object if (config !== Object(config)) { config = {server: config}; } // set url to empty string if it was not specified if (config.server == null) { config.server = ''; } /* implement the elastic.js client interface for angular */ ejs.client = { server: function (s) { if (s == null) { return config.server; } config.server = s; return this; }, post: function (path, data, successcb, errorcb) { $http.defaults.headers.common.Authorization = 'Basic ' + Base64Encode('user:Password'); console.log($http.defaults.headers); path = config.server + path; var reqConfig = {url: path, data: data, method: 'POST'}; return promiseThen($http(angular.extend(reqConfig, config)), successcb, errorcb); }, get: function (path, data, successcb, errorcb) { $http.defaults.headers.common.Authorization = 'Basic ' + Base64Encode('user:Password'); path = config.server + path; // no body on get request, data will be request params var reqConfig = {url: path, params: data, method: 'GET'}; return promiseThen($http(angular.extend(reqConfig, config)), successcb, errorcb); }, put: function (path, data, successcb, errorcb) { $http.defaults.headers.common.Authorization = 'Basic ' + Base64Encode('user:Password'); path = config.server + path; var reqConfig = {url: path, data: data, method: 'PUT'}; return promiseThen($http(angular.extend(reqConfig, config)), successcb, errorcb); }, del: function (path, data, successcb, errorcb) { $http.defaults.headers.common.Authorization = 'Basic ' + Base64Encode('user:Password'); path = config.server + path; var reqConfig = {url: path, data: data, method: 'DELETE'}; return promiseThen($http(angular.extend(reqConfig, config)), successcb, errorcb); }, head: function (path, data, successcb, errorcb) { $http.defaults.headers.common.Authorization = 'Basic ' + Base64Encode('user:Password'); path = config.server + path; // no body on HEAD request, data will be request params var reqConfig = {url: path, params: data, method: 'HEAD'}; return $http(angular.extend(reqConfig, config)) .then(function (response) { (successcb || angular.noop)(response.headers()); return response.headers(); }, function (response) { (errorcb || angular.noop)(undefined); return undefined; }); } }; return ejs; }; }]); UPDATE 1: I implemented Matts suggestion. However, the server returns a weird response. It seems that the authorization header is not working. Could it have to do with the fact, that I am running Kibana on port 81 and elasticsearch on 8181? OPTIONS /solar_vendor/_search HTTP/1.1 Host: 46.252.46.173:8181 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Origin: http://46.252.46.173:81 Access-Control-Request-Method: POST Access-Control-Request-Headers: authorization,content-type Connection: keep-alive Pragma: no-cache Cache-Control: no-cache This is the response HTTP/1.1 401 Authorization Required Date: Fri, 08 Nov 2013 23:47:02 GMT WWW-Authenticate: Basic realm="Username/Password" Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 346 Connection: close Content-Type: text/html; charset=iso-8859-1 UPDATE 2: Updated all instances with the modified headers in these Kibana files root@localhost:/var/www/kibana# grep -r 'ejsResource(' . ./src/app/controllers/dash.js: $scope.ejs = ejsResource({server: config.elasticsearch, headers: {'Access-Control-Request-Headers': 'Accept, Origin, Authorization', 'Authorization': 'Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXX=='}}); ./src/app/services/querySrv.js: var ejs = ejsResource({server: config.elasticsearch, headers: {'Access-Control-Request-Headers': 'Accept, Origin, Authorization', 'Authorization': 'Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXX=='}}); ./src/app/services/filterSrv.js: var ejs = ejsResource({server: config.elasticsearch, headers: {'Access-Control-Request-Headers': 'Accept, Origin, Authorization', 'Authorization': 'Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXX=='}}); ./src/app/services/dashboard.js: var ejs = ejsResource({server: config.elasticsearch, headers: {'Access-Control-Request-Headers': 'Accept, Origin, Authorization', 'Authorization': 'Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXX=='}}); And modified my vhost conf for the reverse proxy like this <VirtualHost *:8181> ProxyRequests Off ProxyPass / http://127.0.0.1:9200/ ProxyPassReverse / https://127.0.0.1:9200/ <Location /> Order deny,allow Allow from all AuthType Basic AuthName “Username/Password” AuthUserFile /var/www/cake2.2.4/.htpasswd Require valid-user Header always set Access-Control-Allow-Methods "GET, POST, DELETE, OPTIONS, PUT" Header always set Access-Control-Allow-Headers "Content-Type, X-Requested-With, X-HTTP-Method-Override, Origin, Accept, Authorization" Header always set Access-Control-Allow-Credentials "true" Header always set Cache-Control "max-age=0" Header always set Access-Control-Allow-Origin * </Location> ErrorLog ${APACHE_LOG_DIR}/error.log </VirtualHost> Apache sends back the new response headers but the request header still seems to be wrong somewhere. Authentication just doesn't work. Request Headers OPTIONS /solar_vendor/_search HTTP/1.1 Host: 46.252.26.173:8181 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Origin: http://46.252.26.173:81 Access-Control-Request-Method: POST Access-Control-Request-Headers: authorization,content-type Connection: keep-alive Pragma: no-cache Cache-Control: no-cache Response Headers HTTP/1.1 401 Authorization Required Date: Sat, 09 Nov 2013 08:48:48 GMT Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS, PUT Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-HTTP-Method-Override, Origin, Accept, Authorization Access-Control-Allow-Credentials: true Cache-Control: max-age=0 Access-Control-Allow-Origin: * WWW-Authenticate: Basic realm="Username/Password" Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 346 Connection: close Content-Type: text/html; charset=iso-8859-1 SOLUTION: After doing some more research, I found out that this is definitely a configuration issue with regard to CORS. There are quite a few posts available regarding that topic but it appears that in order to solve my problem, it would be necessary to to make some very granular configurations on apache and also make sure that the right stuff is sent from the browser. So I reconsidered the strategy and found a much simpler solution. Just modify the vhost reverse proxy config to move the elastisearch server AND kibana on the same http port. This also adds even better security to Kibana. This is what I did: <VirtualHost *:8181> ProxyRequests Off ProxyPass /bigdatadesk/ http://127.0.0.1:81/bigdatadesk/src/ ProxyPassReverse /bigdatadesk/ http://127.0.0.1:81/bigdatadesk/src/ ProxyPass / http://127.0.0.1:9200/ ProxyPassReverse / https://127.0.0.1:9200/ <Location /> Order deny,allow Allow from all AuthType Basic AuthName “Username/Password” AuthUserFile /var/www/.htpasswd Require valid-user </Location> ErrorLog ${APACHE_LOG_DIR}/error.log </VirtualHost>

    Read the article

  • VS2013: How to debug a web application under a specific app domain?

    - by burnt1ce
    I have a few applications running under one app domain using port 80. I'm using port 80 to test and develop web application code. I want to take those same applications and publish them in a different app domain under a different port, 8001. This way, clients can view my applications that's using port 8001 while I develop and compile my project on port 80. However, when I debug my application, it freezes both the web applications on both port 80 and 8001. How can I debug my application under port 80 without affecting the web applications under port 8001?

    Read the article

  • Different output between release and Debug

    - by AthomSfere
    I can't figure this one out. I have a c++ Application that works in Debug mode exactly as expected: #include "stdafx.h" #include <string> #include <Windows.h> #include <iostream> using namespace std; void truncateServer(std::string inString); int _tmain(int argc, char *argv[]) { char* server = argv[1]; truncateServer(server); } void truncateServer(std::string inString) { std::string server = ""; int whackCount = 0; for (unsigned int i = 0; i < inString.length(); i++) { char c = inString[i]; if (whackCount < 3) { if (c == '\\') whackCount++; else server += c; } } cout << server; } For example if I call the server I want via its UNC path \\serverName\Share\ in the debug it gives me exactly what I want: servername However, if I use the release build I get nothing: I deleted the release output folder, but the issue is exactly the same. I can only assume there is some other difference between the release and build applications that is exposing a major issue with my code? Or another difference between the outputs I need to account for. What do I need to do to get the expected output?

    Read the article

  • c++ std::ostringstream vs std::string::append

    - by NickSoft
    In all examples that use some kind of buffering I see they use stream instead of string. How is std::ostringstream and << operator different than using string.append. Which one is faster and which one uses less resourses (memory). One difference I know is that you can output different types into output stream (like integer) rather than the limited types that string::append accepts. Here is an example: std::ostringstream os; os << "Content-Type: " << contentType << ";charset=" << charset << "\r\n"; std::string header = os.str(); vs std::string header("Content-Type: "); header.append(contentType); header.append(";charset="); header.append(charset); header.append("\r\n"); Obviously using stream is shorter, but I think append returns reference to the string so it can be written like this: std::string header("Content-Type: "); header.append(contentType) .append(";charset=") .append(charset) .append("\r\n"); And with output stream you can do: std::string content; ... os << "Content-Length: " << content.length() << "\r\n"; But what about memory usage and speed? Especially when used in a big loop. Update: To be more clear the question is: Which one should I use and why? Is there situations when one is preferred or the other? For performance and memory ... well I think benchmark is the only way since every implementation could be different. Update 2: Well I don't get clear idea what should I use from the answers which means that any of them will do the job, plus vector. Cubbi did nice benchmark with the addition of Dietmar Kühl that the biggest difference is construction of those objects. If you are looking for an answer you should check that too. I'll wait a bit more for other answers (look previous update) and if I don't get one I think I'll accept Tolga's answer because his suggestion to use vector is already done before which means vector should be less resource hungry.

    Read the article

  • Forward horizontal swipe events on UITableView to parent view

    - by D-Nice
    I have a UITableView that I want to have respond to taps and vertical swipes, but still have something like userInteractionEnabled = NO for horizontal swipes. By that I mean, it would not handle touches and pass the touch event back to its superview. Things I've tried that didn't work: returning NO in - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath Overriding touchesBegan/touchesMoved/touchesEnded and passing the event to the next responder Adding gesture recognizers for horizontal swipes and setting cancelsTouchesInView to YES I've been trying to fix this on and off for several weeks, so any help is greatly appreciated!

    Read the article

  • Morris.JS X-Axis Label Height

    - by Aaron
    I have a chart generated with Morris.JS but the labels on the x-axis are to long and being cut off due to the limited height of the area showing the labels. The code below would render a graph that only shows the partial label for "COUNTY PARK ROAD ELEM.". How can I adjust the height of the label area to show the entire text? The code is as follow if ($('#IP1').length){ Morris.Bar({ element: 'IP1', data: [ {x: 'COUNTY PARK ROAD ELEM.', yIndex: 376.92} ], xkey: 'x', ykeys: ['yIndex'], labels: ['Index Points'], ymax: 500, barRatio: 0.2, xLabelAngle: 45, hideHover: 'auto' }); }

    Read the article

  • Reading from a file not line-by-line

    - by MadH
    Assigning a QTextStream to a QFile and reading it line-by-line is easy and works fine, but I wonder if the performance can be inreased by first storing the file in memory and then processing it line-by-line. Using FileMon from sysinternals, I've encountered that the file is read in chunks of 16KB and since the files I've to process are not that big (~2MB, but many!), loading them into memory would be a nice thing to try. Any ideas how can I do so? QFile is inhereted from QIODevice, which allows me to ReadAll() it into QByteArray, but how to proceed then and divide it into lines?

    Read the article

  • Using public interfaces on a server connected through a GRE tunnel

    - by Evan
    I'm pretty new to networking so please forgive any terminology mistakes. I have 2 servers connected with a GRE tunnel. Server1 (10.0.0.1) ---- Server2 (10.0.0.2) I want to be able to bind to the public IPs on Server2 using Server1. To do this, I setup virtual interfaces with Server2's public IPs on Server1 and then used routing rules on Server1 to route the packets through the GRE tunnel. On Server1: ip rule add from [Server2's first public IP] table gre ip rule add from [Server2's second public IP] table gre ip route add default via 10.0.0.2 dev gre1 table gre This works great and I can see the packets arriving via GRE on Server2. I can see the packet exiting the tunnel on Server2's gre1 device as shown: From Server1: ping -I [Server2's public ip] google.com tcpdump from Server2's GRE tunnel device: 12:07:17.029160 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84) [Server2's public ip] > 74.125.225.38: ICMP echo request, id 6378, seq 50, length 64 This is exactly the packet I want. However, I'm not seeing it go out at all on eth0:0 (where Server2's public IP is bound to). I've tried to use routing rules to get packets coming from Server2's public IP (which would be coming out of dev gre1) to go through dev eth0 on the public default gateway and that doesn't work either. I'm at a loss, thank you to anyone who can help.

    Read the article

  • Authentication error in LTSP client

    - by sat
    I am building a LTSP server with LDAP authentication for LTSP Clients. I have configured LDAP server also. When I try to login from LTSP client in GUI, I am getting No response from server, restarting. Then, It's restarting the GUI and comes to the login screen again. I thought that there could be a problem with LDAP authentication. But, When I try to login from Alt+Ctrl+F1 terminal in LTSP client, it is logged in successfully with LDAP user. LDAP Server and authentication is working fine. Even, after executing the below commands, still I am getting the same error. ltsp-update-sshkeys ltsp-update-kernels ltsp-update-image --arch i386 Whether I need to configure anything for GUI login from LTSP Client? How to fix this issue?

    Read the article

  • Using Ruby on share web hosts

    - by Parhum
    We are developing a Wordpress theme and we are going to publish it on themeforest.com. We are using Sass(scss Syntax) as our CSS Preprocessor and we need to compile it on server side. We have two solutions: Use phpsass which is a php script(but it has some bugs) Use Ruby Compiler which most of wordpress plugins use this I noticed that plugins which use Ruby need to have PHP proc_open function enabled on server. My question is what are Pros and Cons of using Ruby compiler on servers? and are most of shared web hosts support Ruby and have PHP proc_open function enabled by default?

    Read the article

  • How do I set up domain names for IP's on my LAN?

    - by Qemal Stafa
    I have a LAN with 50 clients and my company has made me do a local WebApp. This is new territory for me, but as I see it, the individual internal IP's are regulated by MikroTIK. I was wondering, how does one make MikroTIK recognise internal domain names for this IPs? Right now, the WebApp works fine and can be used by entering 192.168.3.150/app/ But since most people have difficulties entering IPs I was wondering if i could do smth like : myroom.lan would be just as you typed 192.168.3.150

    Read the article

  • PowerShell filter vs. function

    - by Marcel Janus
    I'm reading currently the Windows PowerShell 3.0 Step by Step book to get some more insights to PowerShell. On page 201 the author demonstrates that a filter is faster than the function with the same functionally. This script takes 2.6 seconds on his computer: MeasureaddOneFilter.ps1 Filter AddOne { "add one filter" $_ + 1 } and this one 4.6 seconds MeasureaddOneFunction.ps1 Function AddOne { "Add One Function" While ($input.moveNext()) { $input.current + 1 } } If I run this code is get the exact opposite of his result: .\MeasureAddOneFilter.ps1 Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 226 Ticks : 2266171 TotalDays : 2,62288310185185E-06 TotalHours : 6,29491944444444E-05 TotalMinutes : 0,00377695166666667 TotalSeconds : 0,2266171 TotalMilliseconds : 226,6171 .\MeasureAddOneFunction.ps1 Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 93 Ticks : 933649 TotalDays : 1,08061226851852E-06 TotalHours : 2,59346944444444E-05 TotalMinutes : 0,00155608166666667 TotalSeconds : 0,0933649 TotalMilliseconds : 93,3649 Can someone explain this to me?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >