Alesp

Author's details

Date registered: December 2, 2010

Latest posts

  1. How can I decode UTF-8 encoded data from a MySQL table with Latin1 character set? — June 21, 2013
  2. How can I remove a virtual directory in the Default Web Site using appcmd.exe? — June 14, 2013
  3. How can I determine which process occupies a port? — November 23, 2012
  4. Book Notes – The Power of Habit: Why We Do What We Do in Life and Business by Charles Duhigg — November 15, 2012
  5. How can I quickly sort characters in a string? — October 5, 2012

Author's posts listings

Jun 21

How can I decode UTF-8 encoded data from a MySQL table with Latin1 character set?

If you have UTF-8 encoded data in a MySQL table that has character set set to Latin1 you can use the following SQL statement to correctly decode it: SELECT CAST(BINARY(value) AS CHAR CHARACTER SET utf8) AS value

Jun 14

How can I remove a virtual directory in the Default Web Site using appcmd.exe?

Use the following command appcmd delete app /app.name:"Default Web Site"/VDir where VDir is the name of the virtual directory / application under the Default Web Site.Appcmd.exe can usually be found in the C:\Windows\System32\inetsrv folder.

Nov 23

How can I determine which process occupies a port?

To find out which process uses a certain TCP or UDP port you can use a tool called netstat. Netstat is a command-line tool that displays incoming and outgoing network connections, routing tables, and network statistics. So to determine which process is listening on port 80, go to command prompt and type netstat -aon | …

Continue reading »

Nov 15

Book Notes – The Power of Habit: Why We Do What We Do in Life and Business by Charles Duhigg

A couple of weeks ago I read The Power of Habit: Why We Do What We Do in Life and Business, by Charles Duhigg. I really liked it as it describes mechanisms of forming habits and helps us change them. Since there are several “bad” habits I would like to change in my life, the …

Continue reading »

Oct 05

How can I quickly sort characters in a string?

string word = "cab"; string sorted = string.Concat(word.OrderBy(c => c));

Jan 16

How can I disable a plugin in Google Chrome?

To disable a plugin in Google Chrome type chrome://plugins/ in the address bar (sometimes also called omnibox). A page with all plugins will be displayed and you can disable them easily by just clicking the “Disable” link.

Jan 08

Spell Checker in Axosoft OnTime

It seems that Axosoft does not intend to implement spell checker in the Windows client for OnTime Scrum Project Management Software. There is however a solution for the problem: AutoHotkey and "AutoCorrect for English" script. Download AutoHotkey from http://www.autohotkey.com/ Download "AutoCorrect for English" script for AutoHotkey from http://www.autohotkey.com/download/OtherDownloads.htm. Install AutoHotkey. Double click AutoCorrect.ahk file in …

Continue reading »

Jan 06

How can I get information about digital signatures of all files in the folder?

The following PowerShell code snippet allows you to get information about digital signatures of all files in a specific folder: Get-ChildItem *.* | foreach-object {Get-AuthenticodeSignature $_} All you have to do is start PowerShell, go to the folder you want to check and run the command.

Oct 12

How can I delete records from MS SQL Server database using Python?

The following code will delete all records from table in database on server. import win32com.client connectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=database;Data Source=server;" query = "delete from table;" con = win32com.client.Dispatch(‘ADODB.Connection’) con.Open(connectionString) con.Execute(query) con.Close( ) Note: This code works on Windows only. You will also need to install excellent Python for Windows extensions (pywin32) by …

Continue reading »

Sep 28

How can I restart Windows service with Python?

First you need to install excellent Python for Windows extensions (pywin32) by Mark Hammond from http://sourceforge.net/projects/pywin32/. Then you can use the following code (that will restart the Print Spooler service). import win32serviceutil serviceName = "spooler" win32serviceutil.RestartService(serviceName) Note: this code was tested with Python 2.7 and version 216 of the pywin32 extensions.

Older posts «