ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO ALTER DATABASE dbname SET MULTI_USER GO
This blog shares my journey as a software engineer, along with personal reviews and life experiences I’ve gained along the way. “I have not failed. I've just found 10,000 ways that won't work.” — Thomas Edison. If you enjoy my content, please support it by clicking on ads (free for you, big help for me!) or by buying me a coffee on Ko-fi. Thank you!
Friday, February 13, 2015
SQL Server How to Drop Connections
Friday, January 16, 2015
IIS 7.5 FTP and Virtual Directory not displaying in FileZilla - 550 Keyset does not exist
Software -
- Windows 2003 R2 - IIS 7.5 using FTP
- FileZilla (Protocol=FTP; Encryption=Require explicit FTP over TLS; Logon Type:=Normal; UserName=****; Passwword=****** Currently there are 3 virtual drives and when I connect via FileZilla they all display fine, however when I try to configure a 4th virtual directory it will not display in FileZilla.
I am actually getting a sporadic failure all together after the directory is created:
Command: LIST Error: GnuTLS error -110: The TLS connection was non-properly terminated. Status: Server did not properly shut down TLS connection Error: Transfer connection interrupted: ECONNABORTED - Connection aborted Response: 550 Keyset does not exist Error: Failed to retrieve directory listing
If I delete the Virtual Directory the directories will display again. What is wrong, all the permissions are identical. Is there something with the SSL that has to be configured on the directory? Any assistance would be great.
SOLUTION
Navigate on the Windows Server 2008 R2 using Windows Explorer
1. %ALLUSERSPROFILE%\Microsoft\Crypto\RSA\MachineKeys
2. Right Click on Machine Key = 76944fb33636aeddb9590521c2e8815a_GUID
3. Granted the FTP Account -- Read & Execute; Read Access... Problem resolved.
I hope this helps someone. Give me a 1+ if it does, because it stumped me for a good 2 days.
Friday, January 02, 2015
Force Kill Process - MSDN
Working on some Windows 2008 R2 FTP issues and the services got hung. After some Goolge searching I found the following article to KILL THE Services Process that was hung.
In this case it was the ftpsvc process.
1) Open Task Manger
2) Go to the Services Tab
3) Take note of the PID
http://technet.microsoft.com/en-us/library/cc725602.aspx
In this case it was the ftpsvc process.
1) Open Task Manger
2) Go to the Services Tab
3) Take note of the PID
taskkill /pid #### /f
/f forces --- Problem solved yes I was sweating bullets.
http://technet.microsoft.com/en-us/library/cc725602.aspx
Tuesday, November 11, 2014
Wednesday, October 29, 2014
Get httpPostedFileBase FileName only code or extract last portion of file director path
var httpPostedFileBase = Request.Files.Get("DocumentFileName"); var myFileName = string.Empty; if (httpPostedFileBase != null) { int position = httpPostedFileBase.FileName.LastIndexOf('\\'); myFileName = httpPostedFileBase.FileName.Substring(position + 1); }
Friday, October 24, 2014
Wednesday, October 15, 2014
Reading Keys from Web.config file.
Try using the WebConfigurationManager class instead. For example:
C# string userName = WebConfigurationManager.AppSettings["PFUserName"];
OR
VB.NET Dim userName as String = WebConfigurationManager.AppSettings("PFUserName")
Read file using FileStream - Reference - http://www.csharp-examples.net/filestream-read-file/
Read file using FileStream
First create FileStream to open a file for reading. Then call FileStream.Read in a loop until the whole file is read. Finally close the stream.
[C#]using System.IO; public static byte[] ReadFile(string filePath) { byte[] buffer; FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read); try { int length = (int)fileStream.Length; // get file length buffer = new byte[length]; // create buffer int count; // actual number of bytes read int sum = 0; // total number of bytes read // read until Read method returns 0 (end of the stream has been reached) while ((count = fileStream.Read(buffer, sum, length - sum)) > 0) sum += count; // sum is a buffer offset for next reading } finally { fileStream.Close(); } return buffer; }
Wednesday, October 01, 2014
jQuery $.ajax call add functions you will need to call after the html is rendered.
I am adding the following blog post because I spent a good amount of time working on figuring the following out.
Using the jQuery function $.ajax I learned that you need to be sure to add all the functions you want to perform actions on after the $.ajax loads the new content to the page.
CORRECT CODE
<script type="text/javascript">
$("#addItem").click(function () {
$.ajax({
url: this.href,
cache: false,
success: function (html) {
$("#editorRows").append(html);
$("a.deleteRow").on("click", function () {
$(this).parents("div.editorRow:first").remove();
return false;
});
}
});
return false;
});
</script>
This makes 100% sense because if you code it as follows it will never work because the .append(html) is not on the page currently when the jQuery loads.
BAD CODE
<script type="text/javascript">
$("#addItem").click(function () {
$.ajax({
url: this.href,
cache: false,
success: function (html) {
$("#editorRows").append(html);
}
});
return false;
});
//Following will not be called --- because it is not on the page currently
$("a.deleteRow").on("click", function () {
$(this).parents("div.editorRow:first").remove();
return false;
});
</script>
Hope this helps. Have fun coding.
Wednesday, September 17, 2014
pragmatic - Word of the day
prag·mat·ic
pragˈmatik/
adjective
- dealing with things sensibly and realistically in a way that is based on practical rather than theoretical considerations.
SSL Chrome
SSL certificate technology is always improving
to stay ahead of hackers. We regularly update to the most current and effective
standards. We recently switched from using SHA-1 certificates to the more
secure SHA-2 algorithm for new certificates.
Google Chrome is a
very popular internet browser. Starting in November, they'll begin displaying
errors on the padlock icon for any website using SHA-1 SSL certificates.
|
|
|
|
The following SSL certificate(s) are still using the SHA-1 algorithm. Re-key them to update to SHA-2 and avoid problems in November.
Wednesday, May 28, 2014
Determine .NET Version - Shared by Walt Daniels
Run this from a Command prompt (not a powershell prompt) …
it takes a minute, be patient.
wmic /namespace:\\root\cimv2 path win32_product
where "name like 'microsoft%.NET%'" get name, version
Friday, May 09, 2014
jQuery Lightbulb
If you want to learn jQuery, which is a hot tech skill these days head over to www.codecademy.com
The following statement had the light bulb go off:
The following statement had the light bulb go off:
VERY IMPORTANT ---
You know a lot about jQuery events already, but it never hurts to review the basics.
The setup almost always looks like this:
$(document).ready(function() {
$('thingToTouch').event(function() {
$('thingToAffect').effect();
});
});
where "thing to touch" is the HTML element you'll click on, hover over, or otherwise interact with, and "thing to affect" is the HTML element that fades away, changes size, or undergoes some other transformation.
Sometimes these elements are one and the same—you might hover over a
<div>
to change its opacity. Other times, you might interact with a separate element; for example, you might click on a button to resize a <div>
.
Sometimes if you want an effect to occur right away, without an event like
.click()
or.hover()
, you'll skip the second line in the above:$(document).ready(function() {
$('thingToAffect').effect();
});
Wednesday, March 26, 2014
Reset Visual Studio Windows if Windows Start opening in different panes
Windows: ALT + W, R
Menu: Window | Reset Window Layout
Command: Window.ResetWindowLayout
Versions: 2005, 2008, 2010, 2012, 2013
Menu: Window | Reset Window Layout
Command: Window.ResetWindowLayout
Versions: 2005, 2008, 2010, 2012, 2013
Monday, March 10, 2014
LINQ Queries OR SQL checking Nothing or Null Values
You need to check if it's
Nothing
first and use the AndAlso
keyword to stop it from evaluating the latter statement. Also, when checking if the and object is null, you should use the Is
or IsNot
operator rather than =
. This should workDim otherRecords As List(Of Objects) = listOf.Where(Function(x) _
(x.ID_NUM = newID) AndAlso _
(x.Codes IsNot Nothing) AndAlso _
(x.Codes.Contains(ddlPrimaryCode.SelectedItem.Text.Trim()))).ToList()
Tuesday, March 04, 2014
Stored Proc Place holder to be filled later example
SELECT
Field1,
Field2,
Field3,
' ' AS FieldName,
FROM tbl_name
WHERE field = @param
Later fill this with the data you need.
Field1,
Field2,
Field3,
' ' AS FieldName,
FROM tbl_name
WHERE field = @param
Later fill this with the data you need.
Wednesday, February 05, 2014
TFS MSBuild Workflow Toolbox
Do you still have the Team Foundation Build Activities tab? If not, you probably deleted it. To get it back, you can right-click on the toolbox and select "Reset Toolbox". This will get it back to the default, which should contain the lost tab.
You could also add them by right-clicking on the toolbox, then "Choose Items", then "Browse" and select C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Workflow.dll.
Monday, January 06, 2014
LAWS OF PROJECT MANAGEMENT
1. No major project is ever installed on time, within budget, or
with the same staff that started it. Yours will not be the
first.
2. Projects progress quickly until they become 90% complete,
then they remain at 90% complete forever.
3. One advantage offuzzy project objectives is that they let
you avoid the embarrassment of estimating the
corresponding costs.
4. When things are going well, something will go wrong.
• When things just cannot get any worse, they will.
• When things appear to be going better, you have
overlooked something.
5. If project content is allowed to change freely, the rate of
change will exceed the rate of progress.
6. No system is ever completely debugged. Attempts to debug
a system inevitably introduce new bugs that are even harder
to find.
7. A carelessly planned project will take three times longer to
complete than expected; a carefully planned project will
take only twice as long.
8. Project teams detest progress reporting because it vividly
manifests their lack of progress.
with the same staff that started it. Yours will not be the
first.
2. Projects progress quickly until they become 90% complete,
then they remain at 90% complete forever.
3. One advantage offuzzy project objectives is that they let
you avoid the embarrassment of estimating the
corresponding costs.
4. When things are going well, something will go wrong.
• When things just cannot get any worse, they will.
• When things appear to be going better, you have
overlooked something.
5. If project content is allowed to change freely, the rate of
change will exceed the rate of progress.
6. No system is ever completely debugged. Attempts to debug
a system inevitably introduce new bugs that are even harder
to find.
7. A carelessly planned project will take three times longer to
complete than expected; a carefully planned project will
take only twice as long.
8. Project teams detest progress reporting because it vividly
manifests their lack of progress.
Monday, December 30, 2013
Family, Friends and fellow Developers
Merry Christmas and Happy New Year. Hope everyone is prosperous and joyful in the coming 2014 year. In 2013 we have have lost and gained Family and Friends. God Bless everyone.
Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered (RBD comment - but can be), it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.
Love never fails. But where there are prophecies, they will cease; where there are tongues, they will be stilled; where there is knowledge, it will pass away.
Subscribe to:
Posts (Atom)