Pranas.NET is a parent company of ExpoFP.com, SQL Backup And FTP, SqlBak.com, scrin.io and other products. Please visit the individual product websites to learn more about them.
Category Archives: Random Thoughts
What is the best email configuration of Google Apps for a small company?
How to configure emails in Google Apps in a typical small business?
Continue reading What is the best email configuration of Google Apps for a small company?
How to link Gmail and non-Gmail email in Google Account
Lets say you want to be smart and use MyName@MyDomain.com instead of MyName912@gmail.com – I won’t insult your intelligence telling you why. If you have never used Gmail, just register MyName@MyDomain.com as an account with Google, then follow instructions. More often however you have a Gmail account already and just want to use your own email to login and give to public while keeping all of the benefits of your current Google Account.
So we are talking about transition from Gmail to your own email. To do that you have to add your new email to your existing Gmail account. Go to Google Account, Personal Info > Email > Other Emails > “Add a new alternate address” and add your new address.
If you get “MyName@MyDomain.com is already associated with another Google Account.” error, you are out of luck – you have 2 accounts and no way of merging them. Close one of the accounts, then use the remaining to add the email from closed.
If that step worked correctly – all what is left to do is redirect all emails from MyName@MyDomain.com to your old Gmail account (probably deleting the original copy) – that would take care of receiving email and Gmail will take care of sending.
This is similar to “Add another email address you own” feature in Gmail Settings > “Accounts and Imports”. But this option requires you to use your own SMTP server. Why not always use the Alternate email addresses option that we’ve discussed above? – you can ask. Because it can only be associated with one Google Account at a time, so it won’t work in a scenarios when you need to use an account as a shared group email.
How to create a page without a sidebar in WordPress?
Sidebar is useful on most of the pages of a WordPress site – you can add recent posts or categories there. However on pages like Privacy Policy it seems unnecessary. I use a simple and nice WordPress theme Twenty Thirteen, but it lacks a page template without a sidebar. Here I will show how to create such a template in a few very easy steps. Note that the idea is not mine – it is a compilation from other sources.
Continue reading How to create a page without a sidebar in WordPress?
How to forward/redirect email in Google Apps
It is very convenient to open Google Apps account and use Google as your mail server. However the simple email forwarding becomes a challenge when for example you want two people send and receive emails using lets say support@yourdomain.com account. This post will explain how to setup email redirects in Google Apps. This assumes you are an administrator and know how to get to your domain management dashboard (from gmail’s wrench menu select “Manage this domain”)
Note that Google does not offer Google Apps for free any more:
“Prior to December 6, 2012, Google offered a free edition of Google Apps—also known as the Standard edition—that had a reduced set of business features. As of December 6, 2012, Google stopped offering Free edition to new customers.”
Email forwarding with forwarders in user’s account (simple)
- Create a new regular user (like support@yourdomain.com)
- Login as this user to Gmail
- Go to Settings > Forwarders and set up your own email (like john@yourdomain.com) as a recipient “Forward a copy of incoming mail to” – this will take care of receiving emails sent to the new account
- Note that this won’t work if you need to forward to multiple emails. In this case you are better off using filters to forward all (*) email
- Now login to Gmail as yourself (john@yourdomain.com) , go to Settings / Account and add the new email to “Send mail as” section – this will allow you to send email from the new account
Email forwarding with Groups
Note: this does not work as of 2014
Create a group – all of it’s members will receive a copy of the email to this group. Sending from this group is also possible, but recipients (in Gmail) will see “john.smith@example.com via gmail.com”. Some claim it is unprofessional. We think it is minor. This method also saves you from creating new users – in free version you are limited to only 10.
- Click Groups > “Create a new group”
- Name the group and check “Also allow anyone on the Internet to post messages”
- Add members (recepients)
Best DNS hosting and management services
Recently we have encountered a question of selecting a reliable and fast DNS service providers. Why? The main reason was that 1and1 – the registrar for some of our sites has the most terrible domain control panel ever that does not allow configuring TXT records that we need for SPF. See the comparison below.
Remote Desktop to Console/Admin Session on Windows Server 2003
When you Remote Desktop to a Windows XP Professional computer, you always connect to the console (main/default) session. This is the default for Remote Desktop to Windows XP Professional. When you remote desktop to a Windows Server 2003 computer, the default is to start a new session.
This is how you can connect to the default/console/admin session:
Create a .bat file like this:
%SystemRoot%\system32\mstsc.exe “You RDP file” /admin
For options just run
%SystemRoot%\system32\mstsc.exe /?
This post is a good reference
Creating a Self-Signed SSL Certificate without a mess of makecert.exe (using SSL Diagnostics Tool)
Introduction:
So you have a server and you need to implement SSL to allow secure (https) communication. What choices do you have? You can buy a certificate from certification authority or you can issue a Self-Signed certificate to yourself. The difference is that your browser “knows” it can trust the certificates from the authorities (it has it installed). But when the browser encounters the https connection with a server with the self-signed certificate, the user is presented with a message like this:
Thus, self-signed certificates are OK for test and development web sites, but generally not OK for public websites.
This article will show you the simplest ways to create a Self-Signed SSL Certificate.
Here are your options. (Or just go to the Best Solution )
Solution 1 (quite long, but recommended by Microsoft)
Setting Up SSL Using IIS and Certificate Server
MS recommends that you get the certificate from the certificate server. This means that you have to have an access to Window 2000 or Windows 2003 server with “Certification Services” installed. You use IIS MMC to generate request to this server. Then using browser you submit this request to the server. Then, when somebody at that server approves the request, you will get back a certificate.
See details at http://support.microsoft.com/default.aspx?kbid=299525
Solution 2 (fast, but sometimes could be tricky)
Creating Self-Signed SSL Certificates using makecert.exe
It is a quite simple solution. The only problem is that sometimes it just doesn’t work, and it’s hard to determine what is wrong. The makecert.exe comes with VS.NET. It you don’t have .NET Framework 1.1 installed, the makecert might be outdated. You can download a newer version from http://download.microsoft.com/download/platformsdk/Update/5.131.3617.0/NT45XP/EN-US/makecert.exe
Just replace yourservername with the computer name of your PC and run:
makecert -r -pe -n “CN=yourservername” -b 01/01/2000 -e 01/01/2050 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp “Microsoft RSA SChannel Cryptographic Provider” -sy 12
Then go to the IIS “Web Site Properties”, “Directory Security”, “Server Certificate…”, “Assign an existing certificate” and select the new certificate from the list.
It works? Fine! No? Go to the Best Solution
Solution 3 (OK for not-technical users)
Download a test certificate from certification authorities
The certificate companies like VeriSign and Thawte issue test certificates, but they expire after 90 days or so, and the process of getting it could be quite tedious.
Solution 4 (The Best and Recommended)
Create a Self-Signed Certificate using SSL Diagnostics Tool
Avoid all this pain with a nice tool from Microsoft: SSL Diagnostics . Download setup.exe (2112 KB) from here: http://www.microsoft.com/downloads/details.aspx?familyid=CABEA1D0-5A10-41BC-83D4-06C814265282&displaylang=en
Install it and run. In the main window of SSL Diagnostics, right-click the Web site level (shown by [W3SVC/<site number>]), and then click Create New Certificate.
That is it. You are done. Don’t forget to explore other capabilities of this nice tool.
Writing to Event Log in ASP.NET application
Writing to Event Log is not simple, but very simple:
// Create an EventLog instance and assign its source.
EventLog
myLog = new EventLog();
myLog.Source
= "MySource";
// Write an informational entry to the event log.
myLog.WriteEntry("Writing
to event log.");
EventLog is in System.Diagnostics namespase.
Before using the source of the EventLog, you have to create
it. But if you use the code like this:
//Create Event Log if It Doesn’t Exist
if (! EventLog.SourceExists("MySource"))
EventLog.CreateEventSource("MySource",
"MySource");
you will get the error:
System.Security.SecurityException: Requested registry access
is not allowed.
Instead, go to registry editor (regedit), locate key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
and create a new key with the source name
Hierarchical Data Binding in ASP.NET
This will show a sample of hierarchical data bound to
hierarchical List Controls (repeaters)
This is just a transcript of the great article by Fritz Onion
from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspn-hierdatabinding.asp
Get the data
This is obvious
//Create DataSet and Bind it to the
repeater
private
void Page_Load(object sender, EventArgs e)
{
string strConn
=
“server=.;trusted_connection=yes;database=northwind”;
string strSql
= “SELECT CustomerID, CompanyName FROM ” +
” Customers;
” +
“SELECT OrderID, CustomerID,
” +
” EmployeeID FROM
Orders;” +
“SELECT OrderID,
Products.ProductID,” +
“ProductName, Products.UnitPrice
FROM” +
” [Order Details], Products WHERE
” +
” [Order Details].ProductID =
” +
“Products.ProductID”;
SqlConnection conn = new SqlConnection(strConn);
SqlDataAdapter da = new SqlDataAdapter(strSql, conn);
da.TableMappings.Add(“Customers1”,
“Orders”);
da.TableMappings.Add(“Customers2”,
“OrderDetails”);
//Fill DataSet
_ds = new DataSet();
da.Fill(_ds, “Customers”);
//Add Relations
_ds.Relations.Add(“Customer_Order”,
_ds.Tables[“Customers”].Columns[“CustomerID”],
_ds.Tables[“Orders”].Columns[“CustomerID”]);
_ds.Relations[0].Nested = true;
_ds.Relations.Add(“Order_OrderDetail”,
_ds.Tables[“Orders”].Columns[“OrderID”],
_ds.Tables[“OrderDetails”].Columns[“OrderID”]);
_ds.Relations[1].Nested = true;
//Bind
_customerRepeater.DataSource =
_ds.Tables[“Customers”];
_customerRepeater.DataBind();
}
Very useful function
///<summary>
/// returns a DataView of ChildRows
///</summary>
///<param name=”dataItem”>parent row</param>
///<param name=”relation”>the name of the
relation</param>
///<returns>DataView</returns>
protected DataView GetChildRelation(object dataItem,
string relation)
{
DataRowView drv = dataItem as DataRowView;
if (drv != null)
return drv.CreateChildView(relation);
else
return
null;
}
HTML view
Three hierarchical repeaters:
<asp:RepeaterRunat=”server”ID=”_customerRepeater”
EnableViewState=”false”>
<ItemTemplate>
Customer:
<%#
DataBinder.Eval(Container.DataItem, “CustomerID”) %>
<%#
DataBinder.Eval(Container.DataItem,”CompanyName”) %>
<br/>
<asp:Repeaterrunat=”server”EnableViewState=”false”
DataSource=
‘<%# GetChildRelation(Container.DataItem,
“Customer_Order”)%>‘
ID=”Repeater1″>
<itemTemplate>
Orderid:<b>
<%#DataBinder.Eval(Container.DataItem,
“OrderID”)%>
</b><br/>
<asp:Repeaterrunat=”server”EnableViewState=”false”
DataSource=
‘<%#
GetChildRelation(Container.DataItem,
“Order_OrderDetail”)%>‘
ID=”Repeater2″>
<itemTemplate>
<b><%# DataBinder.Eval(Container.DataItem,
“ProductName”) %></b>
$<%#
DataBinder.Eval(Container.DataItem,
“UnitPrice”) %>
<br/>
</itemTemplate>
</asp:Repeater>
</itemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>