RSS

Author Archives: my914

About my914

Programmer, code monkey, Porsche enthusist, Orchid enthusist

Git set executable bit / flag

If you have created an executable script on your windows box and committed it to git your brand new file may be missing the executable flag set on it when it is downloaded or used in Unix OSes.

To set the executable bit run this:

# Flag it as executable
git update-index --chmod=+x script.sh

Credit to: www.pixelninja.me

Advertisements
 
Leave a comment

Posted by on October 31, 2017 in Uncategorized

 

Tags:

Log Parser Lizard format time for IIS log file


SELECT TOP 100
TO_STRING(TO_TIME(time), 'hh:mm:ss') AS TimeLocal,
sc-status,
* FROM 'D:\temp\w3wp.log'
where
TO_TIMESTAMP(date, time) > TIMESTAMP('2015-10-28 19:59', 'yyyy-MM-dd HH:mm')
and sc-status='500'
and
cs(User-Agent) like 'Mozilla/5.0+(Windows+NT+6.1%;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/46.0.2490.80+Safari/537.36'

if the time is in utc and you want it local first load it into To_TimeStamp then do To_LocalTime

TO_TIMESTAMP(date, time) AS utc-timestamp, TO_LOCALTIME(utc-timestamp) AS local-timestamp

 
Leave a comment

Posted by on October 29, 2015 in Uncategorized

 

Tags:

.Net Fusion Log Viewer

While you can use the registry to turn on or off .Net Fusion/Assembly Binding I find that very painful. Instead I use Fusion Log Viewer. To use it simple type fuslogvw from a Visual Studio command prompt.

 
Leave a comment

Posted by on May 8, 2015 in Uncategorized

 

Tags:

Add untracked files to git recursively

Have you ever needed to add all of the untracked files to git but due to your .gitignore file’s settings your files are not added when you do:

“git add .”

Use this command:

“git ls-files –others .\build\tools | xargs git add -f”

 

 

 
Leave a comment

Posted by on October 4, 2013 in Uncategorized

 

Tags:

MS Sql print/select text column as XML without truncating

CAST(COLUMNNAME as XML)

 
Leave a comment

Posted by on June 6, 2013 in Uncategorized

 

Search stored procedure for table

Credit to: http://blog.sqlauthority.com/2006/12/10/sql-server-find-stored-procedure-related-to-table-in-database-search-in-all-stored-procedure/

SELECT DISTINCT o.name, o.xtype
 FROM syscomments c
 INNER JOIN sysobjects o ON c.id=o.id
 WHERE c.TEXT LIKE '%tablename%'
 
Leave a comment

Posted by on April 19, 2013 in SQL

 

Convert unicode file to ascii file

CHCP 1252
TYPE unicode.txt > ascii.txt

An added benefit of doing this is that the file size will probably be reduced to 1/3 the original size.

Credit to http://www.robvanderwoude.com/type.php#Unicode

 
Leave a comment

Posted by on August 5, 2011 in Uncategorized

 

Tags: , ,