w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
WebDAV Server Error 401.2, connection issue with Windows Authentication after pausing virtual server/domain controller
We figured out what was causing our issue although I may not be able to explain entirely why it mattered. In IIS there is a setting in the "HTTP Response Headers" under "Set Common Headers" called "Enable HTTP keep-alive". We check marked this option as true and our Windows Authentication started working again. It seemed to have something to do with the connection not staying open between requests and the application or IIS not realizing the connection was restarted during the SYNC operation.

Categories : Iis

SQL Server 2012: Calculating total time elapsed for every unique record from a logs table
I believe this will work: SELECT Entity,Destination'Type',Time,SUM(TimeDiff) OVER (PARTITION BY Entity, Destination ORDER BY Time)'Running Total' FROM (SELECT Entity, LEFT(SOURCE,2)'Source',LEFT(Destination,2)'Destination',Time, DATEDIFF(second,LAG([Time]) OVER (PARTITION BY Entity ORDER BY [Time]),[time])'TimeDiff' FROM #test )sub ORDER BY TIME Or if you just want the total time for a given Entity/Type combination: SELECT Entity, Type, MAX(Running_Total) FROM (SELECT Entity,Destination'Type',Time,SUM(TimeDiff) OVER (PARTITION BY Entity, Destination ORDER BY Time)'Running_Total' FROM (SELECT Entity, LEFT(SOURCE,2)'Source',LEFT(Destination,2)'Destination',Time, DATEDIFF(second,LAG([Time]) OVER (PARTITION BY Entity ORDER BY [Time]),[time])'TimeDiff' FRO

Categories : SQL

syslog: does it remove the old logs if there would be less space on the storage
It completely depends how much stuff gets logged, but if you only have ~100MB, I would imagine that it's certainly likely that your storage will fill up before 30 years! You didn't say which syslog server you're using. If you're on an embedded device you might be using the BusyBox syslogd, or you may be using the regular syslogd, or you may be using rsyslog. But in general, no syslog server rotates log files all by itself. They all depend on external scripts run from cron to do it. So you should make sure you have such scripts installed. In non-embedded systems the log rotation functionality is often provided by a software package called logrotate, which is quite elaborate and has configuration files to say how and when which log files should be rotated. In embedded systems there is no s

Categories : Linux

Unable to see access logs in my Google Storage Bucket
cloud-storage-analytics@google.com needs to have write permission for your LogBucket as described here: https://developers.google.com/storage/docs/accesslogs

Categories : Rest

UserPrincipals.GetAuthorizationGroups An error (1301) occurred while enumerating the groups. After upgrading to Server 2012 Domain Controller
I'm in an environment with multiple domain forests and trusts. I have pretty much this exact same code running on a web site form used to perform user security group lookups across the different domains. I get this exact error in one of the very large domains where group membership can include 50+ different groups. It works fine in other domains forests. In my research I found a thread that looks unrelated, but actually has the same stack trace. It is for a remote application running on SBS. The thread mentions that the error is caused by unresolvable SIDS in a group. I believe these would be what are known as "tombstoned" SIDS in active directory. See the thread here. The thread suggests that finding the tombstoned enteries and removing them from the groups solves the problem. Is it

Categories : C#

Do we have any options to collect storage service operation logs in Azure using Rest API
Thanks for sharing the steps. Yes, you could programmatically get this information. To do so, you would need to make use of Windows Azure Service Management API especially List Subscription Operations. Portal actually makes use of the same operation.

Categories : Java

Web Deploy Command Line Logs in Event Logs (Updated / Inserted / Deleted Files) in event logs
I don't believe you can log the activities to the event log, but what you can do is use the -xml parameter to output the changes in XML format. You could then use this to log to the event log via a Powershell script, for example.

Categories : Iis

Rails 3: Register logs in model or controller?
Logs can be used anywhere, it depends on your need to put them into right place. For this case, your logging seems related to model changes but has little to do with HTTP requests, I think the better option would be model related place. Option 1: after_save and after_update callback, not before_save. (You only want to log it after change already made effect) Option 2: Model Observer. I myself prefer Observer in this case because Log is not something inside this model so better not to use model callback. Also Observers allow you to add more things later easier. The downside is Observers are easy to be forgot, not a big deal if you can overcome it.

Categories : Ruby On Rails

Get file contents of a domain in another domain in the same server
Glob needs file-access. But since it is on another domain. It doesn't get file-access (and it shouldn't). Even if they are on the same server, they shouldn't be able to access each others files for so many reasons. What you can do is write a small API on domain1.com that returns a list of images for a certain user. You then access that information using for isntance curl on domain1.com where the pictures are stored: <?php //get the user id from the request $user_id = $_GET['user_id']; $pathToImageFolder = 'path_to_pictures' . $user_id ; $images = glob($pathToImageFolder.'/*.{jpg,jpeg,png,gif}', GLOB_BRACE); //return a JSON array of images print json_encode($images,true); #the true forces it to be an array on domain2.com: <?php //retrieve the pictures $picturesJSON = file_get_

Categories : PHP

add product from one domain, to the cart of different domain(both are on same server)
The requirement is that both domains have to store the sessions at the same place. Then you have to make the client use the same session id on both domains, to do that, pass the session id in all links and redirects that go from one domain to another. <a href="http://xyz.com/cart.php?<?php echo SID ?>">cart</a>

Categories : PHP

What domain is Google Cloud Storage expecting in the ACL definitions when inserting an object?
The reason you're seeing "Could not find domain "mydomain.appspot.com"." is that the "domain-" prefix refers to all accounts within a Google Apps for Business domain, not appengine domain names. For example, if you were using Google Apps for your company, fakecompany.com, and you wanted to grant read access for a bucket for all accounts under fakecompany.com, you could specify "domain-fakecompany.com" to refer to all such accounts. I'm guessing mydomain.appspot.com is an appengine domain name and not a Google Apps for Business domain, which would cause that sort of error. Updates: There was another misunderstanding that is worth pointing out. A service account does not necessarily have permission to insert new objects into buckets that you own. Make sure that it either has explicit WRITE

Categories : Java

How can I determine down time from logs in database table
The following query gets the restart time for each error: select l.*, (select top 1 ErrorDateTime from logs l2 where l2.ErrorId > l.ErrorId and l2.ErrorMessage = 'App Restarted' order by l2.ErrorId ) as RestartTime from logs l where l.ErrorMessage = 'ERROR'; To get the sum requires summing times. Here is the sum in seconds: with errors as ( select l.*, (select top 1 ErrorDateTime from logs l2 where l2.ErrorId > l.ErrorId and l2.ErrorMessage = 'App Restarted' order by l2.ErrorId ) as RestartTime from logs l where l.ErrorMessage = 'ERROR' ) select sum(datediff(second, ErrorDateTime, RestartTime)) as SecondsDown from errors;

Categories : SQL

How to I find multiple logs in the same time interval?
This should get you most of the way there: SELECT `CustomerID`, `Timestamp`, COUNT(1) FROM OrderItems GROUP BY `CustomerID`, `Timestamp` HAVING COUNT(1) > 5

Categories : Mysql

OpenCV default storage format
It depends on the way you are managing the image: have you loaded it from a file with imread for example? Have a look at imread here, with a colour jpeg for example you'll have a 3 channel format, 24 bits overall. Can you be more specific? I do not know if it's useful, but I had a similar issue when converting an image from Android Bitmap (passed to OpenCV as a byte array RGBA8888) to OpenCV image (BGR888). Here is how I've solved it. cv::Mat orig_image1(orig_height, orig_width, CV_8UC4, image_data); int from_to[] = { 0, 2, 1, 1, 2, 0}; cv::Mat image(orig_height, orig_width, CV_8UC3); cv::mixChannels(&orig_image1, 1, &image, 1, from_to, 3); orig_image1.release();

Categories : Opencv

Rewrite domain.com/sub/ to sub.domain.com on other server
On domain.com enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC] RewriteRule ^sub(/.*|)$ http://sub.domain.com$1 [L,R=301,NC] UPDATE As per the comments if you don't want original URL to change: This will require you to enable mod_proxy on domain.com: RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC] RewriteRule ^sub(/.*|)$ http://sub.domain.com$1 [L,P,NC]

Categories : Apache

Sortable, readable and standard time format for logs
@J.F. Sebestian - Thanks for your comment. After some research I chose RFC 3339 / ISO 8601 in UTC, e.g.: date -u "+[%Y-%m-%d %H:%M:%S%z (%Z)]" # Space separated with tz abbreviation [2013-07-31 23:56:34+0000 (UTC)] date -u "+[%Y-%m-%d %H:%M:%S.%N %z (%Z)]" # Space separated with nanoseconds and tz abbreviation [2013-07-31 23:56:34.812572000 +0000 (UTC)] Features: Sortable (Most significant date item is on the left) Readable Unambiguous, time zone clearly stated Delimited by [,], useful for regexing the date away Easily parsable Accurate: uses nanoseconds (might be practically milliseconds on some machines, which is good enough) I've also created a nice github project that helps with date formatting - feel free to take a look and suggest your own formats

Categories : Sorting

Set default ringtone from private internal storage
In my testing (Android v.19), I can use RingtoneManager.setActualDefaultRingtoneUri() to point to a ringtone on private, internal app storage without exception. However, attempting to play this Ringtone simply plays the default sound. I'm betting the system application that plays Ringtones doesn't have access to your apps internal storage. Bad for this scenario, but good for security!

Categories : Android

MySQL: efficiently converting event logs to time series
The only changes happen at start_time and end_time. So, if you were to select distinct start_time As time_point from event_log UNION select distinct end_time As time_point from event_log ... that would give you all the "points" at which you need a snapshot. If you create that in a temporary table (say TEMP_POINTS), and join if back to event_log, you should be able to count the number of events at each "point". CREATE TABLE NON_ZERO_POINTS (t DATETIME, event_count INT(11)) select time_point, count(*) from TEMP_POINTS join event_log on time_point between start_time and end_time group by time_point Might be worth creating an index on NON_ZERO_POINTS Then, you could use NON_ZERO_POINTS in your update thus: UPDATE time_series SET event_count= (SELECT event_coun

Categories : Mysql

Is there a way to view my web-apps tomcat logs in a browser real time?
A simple example would be: Servlet (change path of log file as needed): @WebServlet(name = "Log", urlPatterns = { "/log" }) public class LogServlet extends HttpServlet { private static final long serialVersionUID = 7503953988166684851L; public LogServlet() { super(); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Path path = FileSystems.getDefault() .getPath("/path/to/tomcat/logs", "catalina.out"); StringBuilder logContent = new StringBuilder(); logContent.append("<pre>"); try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8);) { String line = null; while ((line = reader.readLine()) != null) {

Categories : Java

View all transaction logs in SQL Server 2014
As far as I know your only options for this are: Third party tool ApexSQL Log (Red Gate has a free tool but only for SQL Server 2000) Undocumented commands such as DBCC LOG or fn_dblog. Change data capture – this is SQL Server feature that automatically creates history tables but its only available in enterprise edition We are also evaluating SQL Server 2014 CTP 1 for it’s in memory features but I haven’t been able to find anything on this topic. I don’t really believe MS is going to allow this any time sooner. Right now their focus is on enterprise level features such as high availability, in memory queries and such… Also, they have their own version of this in CDC.

Categories : Sql Server

Capturing and sending crash logs to the server
Yes, there are several solutions that provide this functionality. One of them that I'm intimately familiar with (and works very well) is Apigee's Mobile Analytics (http://apigee.com/docs/enterprise/content/analyze_apps). One of the important points for dealing with crash logs is to save a copy of your .dSYM. This is needed to symbolicate the crash log.

Categories : IOS

how to get request-response logs on weblogic server
If you need HTTP request log, follow documentation: http://docs.oracle.com/cd/E13222_01/wls/docs90/ConsoleHelp/taskhelp/logging/EnableAndConfigureHTTPLogs.html If you want more data or response, you need to write (or find) servlet filter that will dump requested data to file

Categories : Java

C# web app is using none hard coded path of dev pc showing up on server logs
The folders you see there are taken from the projects debug symbols. They are only there for you to know where the files were located on the build computer. This information is usually not accessible from your code so the error you are encountering is probably something else in the implementation of theme_skin_url.

Categories : C#

read and store server logs in real tine
You need to read each file in a separate thread, and ensure that the code to write to database is thread safe. Edit: I put this in a comment, but actually it's part of the answer: from Java 7 you can get the filesystem to call you back when a file changes http://docs.oracle.com/javase/7/docs/api/java/nio/file/WatchService.html That way you don't need to poll the file size like you're doing... but you do still need 1 thread per file. Tutorial for WatchService is here: http://docs.oracle.com/javase/tutorial/essential/io/notification.html

Categories : Java

Send C# Application Logs to Linux Syslog Server
try using log4net, it offers a RemoteSyslogAppender https://logging.apache.org/log4net/release/framework-support.html below an example of configuration <appender name="RemoteSyslogAppender" type="log4net.Appender.RemoteSyslogAppender"> <facility value="Local6" /> <identity value="MyApp[%level][%property{log4net:HostName}]" /> <layout type="log4net.Layout.PatternLayout" value="%-5level %logger [%ndc] - %message" /> <remoteAddress value="yourAddressHere" /> </appender>

Categories : C#

WCF Service: How to find server logs to understand error?
Logging is not necessarily turned on. Tracing and logging need to be enabled in WCF configuration (app.config or web.config). You can do this manually, or by clicking app.config and then selecting Edit WCF Configuration. If this item doesnt appear in context menu (happens in old versions of VS), you can find it in VS Tools menu or by running it manually (SvcConfigEditor.exe). By default, messages are logged to files in directory from which application is ran. You can edit this in configuration editor once you enable logging. Editor will allow you to specify file path once you enable logging or tracing. You can later use Microsoft Service Trace Viewer tool for going through the files, as large XMLs and are not user friendly. Viewer tool should come up itself once you double click log fi

Categories : C#

What is the point of adding "IP domain.tld" to the ( /etc/hosts ) file if the server is not gonna be used as a mail server?
/etc/hosts file is an alternative to DNS host name resolution. It has nothing specifically to do with mail servers. But, to use a mail server it has to be found on the network. /etc/hosts is a local lookup file that computer uses as specified in /etc/nsswitch.conf. DNS is a network service provided for each domain. For example, BIND. Domain zone files are configured and hosted on the domains primary DNS servers. You can configure domain searches in /etc/resolv.conf.

Categories : Linux

How to conveniently store common logs and client specific logs
I would have an xml file that contain the appenders to specify what packages go into what log file. You can then load the xml file in your application entry point. Below is an example I have used in my current project <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <!-- appenders --> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out" /> <param name="threshold" value="error" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%t] %p %c - %m%n" /> </layout> </appender> <appender name="codebaseXAppender" class="org.apache.log4j.RollingFileAppender"> <

Categories : Java

Can I create a view that will query a table from another sql server on another server but same domain
you can link the servers and run cross server queries as long as you put the server name before the DB your running the query on. For example SELECT * FROM "linkedserver".dbo.aTable (without "" marks ) bear in mind different server versions though. I run cross server queries from 2008 to 2000 servers and its a pain adapting :)

Categories : SQL

How to use token generated at login time, for security, when user logs in a php web appliction from mobile application?
When device login with email & password, Generate a token, create a session for the user and store the token in session. for all further request from the device, that token has to be passed as header, so that you can validate it against the stored token.

Categories : PHP

InputHelper email field with default domain
Either modify the data as suggested by @cske (but modify Controller::$request::$data or Model::$data instead of $_POST), ie append the domain part to the user input before saving/validating, and consequently store the complete email address in the database, or use a custom validation rule that uses the domain part only for validation purposes, something like: App::uses('Validation', 'Utility'); ... public $validate = array( 'email' => array( 'required' => array( 'rule' => array('notEmpty'), 'message' => 'Email field cannot be empty' ), 'email' => array( 'rule' => array('validatePreRegistrationEmail'), 'message' => 'The email is not valid.' ) ) ); ... public function validate

Categories : PHP

Unload event for the default Application Domain?
i forgot to cross post my own answer from my other slight variation of this question. Ultimately, the answer came from an answer by M.A. Hanin. There is no DomainUnload, but there is a ProcessExit: class Contoso { //constructor public Contoso() { //... //Catch domain shutdown (Hack: frantically look for things we can catch) if (AppDomain.CurrentDomain.IsDefaultAppDomain()) AppDomain.CurrentDomain.ProcessExit += MyTerminationHandler; else AppDomain.CurrentDomain.DomainUnload += MyTerminationHandler; } private void MyTerminationHandler(object sender, EventArgs e) { //The domain is dying. Serialize out our values this.Dispose(); } ... } Note: Any code is released into the public domain. No attribution requ

Categories : C#

Configuring eclipse to delete logs before tomcat server startup
I'm not sure if Eclipse is the right tool to accomplish that. In my current project server start and application deployment is managed by Ant and include a Task to erase Logs between this processes is trivial. Ant integrates nicelly with Eclipse and Tomcat. You can do the same with Maven if you prefer

Categories : Eclipse

Is it possible to serve static files on Google Cloud Storage with Google App Engine with one domain?
I don't believe so, no. A single domain name must route to either Google Cloud Storage or Google App Engine. You could cheat, mind you. You could configure your app engine app to take all requests for, say "/images/X" and redirect them to images.example.com/X, or you could have your app read the data from GCS and feed it back to the user directly from app engine, but neither of those are a good solution. If you wanted to move to a VPS later, you could perhaps configure the VPS to handle two domains, one for images and one for dynamic content.

Categories : Google App Engine

Using IRepository pattern for multiple domain objects and multiple storage mechanisms
Please refer to How would I design a repository to handle multiple data access strategies? , I think this is what you want. Basically assume you already have one IRepository interface having methods of CRUD and other generic methods refer by all your other repository, then you have multi implementations to IRepository interface. After that use any IOC container (I use Windsor Castle) to resolve which implement's component should take part for this interface doing application setup.

Categories : C#

Database design or architecture suitable for storing logs, real time reporting and utilized as log correlation engine
Lots of questions! Q1: Does NoSQL have aggregation? A1: I know Mongo has aggregation, but the last time I used it, it wasn't particularly fast compared to relational databases. Can't speak to Cassandra. Lots of people use Mongo to store structured logs and report. Q2: What about data warehouses? A2: You're right that a data warehouse can exist in a relational database. It's just a different way of structuring the data and thinking about it. Have you thought about keeping a snapshot of time in a real time relational database and then archiving older logs? For example, maybe at 10 million, you start shipping out the oldest log entries to a data warehouse and this guarantees that you are always only looking at the most recent 10 million log entries, which should be fast.

Categories : Database

Ember getting content from another controller doesn't work with local storage adapter
same problem as in Ember loop through content of controller you have to use alert(names.objectAt(0).get('name'));

Categories : Ember Js

Why does django return 301 and 302 as server response codes after a user logs in and a flatpage is displayed?
I can't see your url pattern for the home view. But it's probably the missing slash which makes django send out a auto-redirect: https://docs.djangoproject.com/en/dev/ref/settings/#append-slash Is my web client sending the request underling the fourth line? How does it know to do this? Yes, Status code 301 in line 3 tells the browser 'the page you requested moved to another url x'. And browsers will usually always automatically send a new request to that new url x which is line 4.

Categories : Django

How to set intellij to show logs in the logs tab and not the output tab
In the application server Run/Debug configuration open the Logs tab and specify the full log file path there. You can just search your disk for algo_js.log file and specify its location.

Categories : Spring

missing of domain and controller under grails-app in GGTS 2.2.1
As I understand the problem is that you don't see some folders (eg domain, controllers, ...) in project explorer. This happend to me once too. The problem was that the imported projected didn't have .classpath file and when you were importing the project grails made one for you. The solution is to copy-paste the original .classpath file or if you don't have the original try to create it from another project.

Categories : Grails



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.