2014/08/26

How to create an element with attributes and a value but no sub-element using XmlSerializer ?

http://stackoverflow.com/questions/3524224/using-xmlserializer-to-create-an-element-with-attributes-and-a-value-but-no-sub

2014/08/22

Visual Studio 2013 - 'Operation Could Not Be Completed' when trying to open any View ?

I had two <appSeettings> nodes in config file.
Make only one node.
Maybe you will need restart of VS or system.

How to backup SqlServer database ?

1/ Backup file: Right click on Database -> Task -> Backup ...
2/ Script with structure and data: Right click on Database-> Task -> Generate scripts -> On 3rd step of wizard choose 'Advanced' button and select 'Types of data to script':'Schema and data'.


How to bind MVC model to different table ?

Fatal error: Class 'SoapClient' not found in ..

1/ Open php.ini.
2/ Uncoment line:
from: ;extension=php_soap.dll
to: extension=php_soap.dll
3/ Restart php.

How to read config section from configuration file in C# ?

App.config Class that reads config file.
Remember to add System.Configuration to Project references !

2014/08/15

2014/08/13

Sql server connection strings

http://www.connectionstrings.com/sql-server-2012/

Spf record example


Record SPF (Sender Policy Framework) allows you to check the host SMTP mail servers, the server sends e-mails from a given domain is authorized to do. It is in fact plain text record. To ensure compatibility with older implementations of servers / clients DNS domain should be 2 SPF records that contain exactly the same value, one type of SPF, and the second TXT.
 
Suppose, for example, that your domain example.com uses Gmail. You create an SPF record that identifies the mail servers as authorized Google Apps mail servers for that domain. When the recipient's mail server receives a message sent from the account user @ example.com, you may check the SPF record for the domain example.com, to determine if the message comes from an authorized mail server. If the message comes from a server other than the Google Apps mail servers listed in the SPF record, the recipient's mail server can reject it as spam.
If your domain has no SPF record, messages from users from that domain can be rejected by some of the recipients domain because it is not possible to check whether the message came from an authorized mail server.

Qualifiers


The qualifier is a single sign placed before the definition of the mechanism:

Qualifier Description
"+" - PASS indicates that the data source is authorized to send mail from the domain. If prior to the determination of the mechanism does not have a qualifier, it is assumed that it is "+".
"?" - NEUTRAL This source will be treated as if it was not him at all ...
"~" - SOFTFAIL Maile from this source will be rejected or accepted, but marked as SPAM.
"-" - FAIL Messages from this source will always be rejected.

Mechanisms

Immediately after the qualifier is the "mechanism" that is, to identify the source:

Mechanizm Description
ip4: 192,168,137,101 IPv4 Address - 192,168,137,101
ip6: 2001: db8 :: 1428: 57ab Ipv6 Address - an Ipv6: 2001: db8 :: 1428: 57ab
a Each record for a domain
mx Each SMTP server accepting mail for this domain
all Each host on the Internet

Examples

a/
example.com. IN TXT "v = spf1 mx -all"
Each SMTP server is accepting mail for the domain przykladowa.local. may also be sent. Mail coming from other hosts across the Internet will be rejected.

b/
example.com. IN TXT "v = spf1 a -all"
Mail originating from any host in the domain will be accepted. On the other rejected.

c/
example.com. IN TXT "v = spf1 ip4:192,168,137,101 -all"
Incoming IP 192,168,168,137,101 will be accepted. Other messages rejected.
d/
example.com. IN TXT "v = spf1 a mx ip4:192,168,137,202 -all"
Incoming mail from any host in the domain, the SMTP server receiving the mail and IP 192,168,137,102 will be accepted. The remainder will be rejected.
e/
example.com. IN TXT "v = spf1 mx -ip4:192,168,137,101 -all"
Incoming mail from any SMTP server receiving the mail, bypassing the host IP 192,168,137,101 will be accepted. The remainder will be rejected.

Notes


Full syntax: http://www.openspf.org/SPF_Record_Syntax
Validator: http://www.kitterman.com/spf/validate.html
Generator: http://www.spfwizard.net/
How to add SPF in your domain: http://kb.mediatemple.net/questions/658/How+can+I+create+an+SPF+record+for+my+domain%3F#gs

2014/08/11

Simple url construction example

http(s)://www.domain.net/site.php?arg1=val1&arg2=val2#label1

http(s) - protocol
www.domain.net - server address
site.php - document name (optional)
arg1,arg2 - url arguments passed to site (optional)
label1 - anchor, it points where to jump on site (optional)

How to check your google search history ?


If you have google account and are logged in, google stores your search results in history.
Archive stores results even from some years ago.
To check your history visit:
https://history.google.com/history/
or where you were:
https://maps.google.com/locationhistory                  



2014/08/09

How to add and remove programs from startup windows 8 ?

Disable / enable program on startup Wndows 8

(right click) Windows Toolbar -> (select) Task Manager -> (select) Startup -> (right click) application -> (select) disable / enable




Add programs to startup Windows 8

From Run box run: 
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup

or type in Windows explorer:
C:\Users\(your domain name)\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

or look here.

2014/08/04

How to force file update in TFS ?



1. Find file on drive and replace it with a new version


 2. Open Team Explorer -> Source Control and find it in archive
 3. Click right on file and select "Check out for edit"

4. Confirm changes as shown..

5. Now TFS knowsthat file needs to be updated in repository

6. Check In pending changes