El TecnoBaúl de Kiquenet

Kiquenet boring stories

Archive for the ‘Productividad’ Category

Firefox: Load Page Faster

Posted by kiquenet en 21 octubre 2015

Update Firefox. Many optimization tweaks from the past are now included by default in Firefox. To take advantage of them, update to the latest version. This happens automatically when you check your version number.

Back up your preferences file. These settings can cause bugs and slowdown for some users. You can usually revert them without a problem, but back up the file just in case so you can restore your old preferences:

  • Open a new tab and enter about:support in the address bar.
  • Look for "Profile Folder" and click Show Folder next to it (Show in Finder on a Mac).
  • Go one level up from the folder that opens. You should see a folder with a string of letters and number, ending in ".default."
  • Right-click this folder and choose "Copy," then right-click in a backup location and select "Paste."

Try one setting at a time. These settings are intended for advanced users, and could cause problems with your add-ons. It’s best to change one setting at a time so you can test the effect.

  • You can find tools online to test the speed of your browser precisely.

Adjust connections per server. Your browser limits the number of simultaneous connections to a single server. Upping this limit will make a noticeable change to pages with many images or videos, if your bandwidth can handle it. Increasing this too much is considered bad etiquette, and may get you banned from a server, but you have a little wiggle room:

  • Search for network.http.max-persistent-connections-per-server and double-click the Value. Increase this to a maximum of 10.[1] Some users prefer 8 to be on the safe side.
  • Search for network.http.max-connections. Set this value to 256, if it isn’t already.[2]

Disable animations. Firefox displays small animations when opening or closing tabs. This is usually not an issue, but you can avoid some hang-ups if you tend to open or close many tabs at once:[3]

  • Set browser.tab.animate to False.
  • Set browser.panorama.animate_zoom to False.

Consider disabling prefetching. Prefetching loads pages before you visit them, guessing which links you’ll click on. When working correctly, this should only use idle browser time, and will actually increase load speed. If you have unusually slow load speeds, a buggy prefetch could be the issue. Make the following changes to disable both forms of prefetch, then reverse them if there’s no speed up:[4]

  • Change network.dns.disablePrefetch to True.
  • Change network.prefetch-next to False.
  • Change the value of network.http.speculative-parallel-limit to 0.

Toggle hardware acceleration and WebGL. These functions use your graphics card to speed up certain functions, especially loading videos. However, this can cause slow load times or blurry text, especially with older operating systems or graphics cards. Try watching videos with these settings on and off to see which works best for you:[5]

  • Change webgl.disabled to True or False.
  • Visit about:preferences#advanced in a new tab. Check or uncheck "Use hardware acceleration."
  • Unlike most setting changes, you may need to restart Firefox for these to take effect.[6]

Install an ad blocker. On many web pages, advertisements take up a large fraction of the load time. Install Adblock Plus or another ad-blocking add-on to prevent these ads from loading.

  • Many web hosts rely on ads for most of their revenue. Consider disabling ad block on sites you’d like to support.

Start Firefox in safe mode. Click the menu icon (three horizontal bars), then the help icon (?), then Restart with add-ons disabled. If Firefox runs much faster in Safe Mode, a faulty add-on is slowing you down.

Disable add-ons. Enter about:addons in the address bar, or click the menu icon (three horizontal bars) and select Add-ons. Disable one add-on at a time, and browse for a while to see if it speeds you up. Visit the same page to remove the add-on permanently or re-enable it, depending on your test.

Switch to the default theme. If you have a custom theme, it could be slowing down your browser. Visit the Appearance tab on the add-ons page, and switch to the default theme.

Minimize memory usage. If you’ve just closed a bunch of tabs, Firefox might lag for a while until it deletes the contents of those tabs from its memory. Get rid of them right away by visiting about:memory and clicking Minimize memory usage.[7]

Adjust cache. The cache is another feature that speeds up browsing in general, but can slow you down if it gets too full for your hard drive. To adjust the cache size, visit about:preferences#advanced, click the Network tab, and check "Override cache management." Increase the cache if you have a fast drive with plenty of space, and reduce it to about 250MB if you have a slow or mostly full hard drive.

  • Clearing your cache every couple months is a good idea, or whenever your browser gets unusually slow. You should also clear the cache before reducing its size.

Reset Firefox. If you are experiencing major slowdowns on a broadband connection, you might have to reset Firefox to remove a buggy add-on or setting change. This will delete all your add-ons, themes, and download history, and return your settings to default. Visit about:support and click Refresh Firefox, or see this article for more detailed instructions.

Understand pipelining. Pipelining allows Firefox to open more than one connection to a server. This will only help if you have a good broadband connection. Even then, this only gives a small speed boost, and can even cause slight slowdowns or errors. The difference in results are probably dependent on the way the web page is structured, so give it a try and see if it helps for your most visited websites.[8][9]

Visit about:config. Open a new Firefox tab and enter about:config in the address bar.

Enable pipelining. Search for network.http.pipelining using the bar at the top of the page. This entry should be set to "Status: default" and "Value: false." Double-click that line to change it to "Status: user set" and "Value: true."

Adjust other settings (optional). There are quite a few related settings you can change as well. Adjusting most of these is not recommended unless you know what you are doing. Here are a couple you could try:

  • network.http.pipelining.maxrequests was capped at 8 for many years, but now the limit (and the default) is 32. Raising this number could cause errors. Lowering it will reduce speed but free up your bandwidth a little.
  • Enabling network.http.pipelining.aggressive doubles down on the tactic: when it works, you’ll be even faster, and when it doesn’t, you’ll be much slower.[10]
  • If you route all your internet use through a proxy, you’ll need to enable network.http.proxy.pipelining. (You’ll need to do a new search to find this.)

Switch to secure-only pipelining if you encounter problems. If pipelining is slowing you down, or causing errors in your web pages, return it to the default "false" position. You can still implement pipelining for secure websites by enabling network.http.pipelining.ssl. Most pipeline-related errors come from proxy servers, which are not an issue with secure connections.[11]

  • Despite the problems with "unsecure" connections, pipelining does not open you up to any security risks.

http://www.wikihow.com/Make-Firefox-Load-Pages-Faster

Anuncios

Posted in Productividad | Etiquetado: , | Leave a Comment »

Delete TestResults folder (Unit Testing Visual Studio)

Posted by kiquenet en 5 enero 2015

Cleaning up Visual Studio TestResults with PowerShell

If you write your unit tests using Visual Studio, then you know how quickly those pesky "TestResults" folders can eat up precious disk space over time.

Assuming all of your code is collocated in the same parent directory, replace "C:\TFS" with your parent directory.

(get-childitem C:\TFS\* -recurse) | where{$_.name -eq "TestResults"} |% {remove-item $_.fullname -recurse}

Improvements:

Error Handling when deleting folders and files.

Validating contents TestResults folder (subfolders In and Out, *.trx files, …)

$dir = "C:\TFS\"
(get-childitem $dir -recurse) | where { $_.name -eq "TestResults"} | foreach {

   $delete = $false;
   (get-childitem  $_.FullName -recurse) | where {$_.name -eq "Out"}  | foreach {
       
        $ParentS = ($_.Fullname).split("\")
        $Parent = $ParentS[@($ParentS.Length – 3)]
        if ($Parent -eq "TestResults") {$delete = $true;}

   }

   if ($delete)
   {
        Write-Host -ForegroundColor red ("Eliminando {0}" -f  $_.FullName )
        Remove-item $_.fullname -recurse
   }

}

Write-Host -ForegroundColor red ("Eliminado TestResults de {0}" -f  $dir )

Source:
http://captechconsulting.com/blog/mike-etheridge/cleaning-visual-studio-testresults-powershell

Posted in .NET, PowerShell, Productividad, Scripts, VisualStudio | Etiquetado: , , | Leave a Comment »

Convert DOC (Office 97-2003) to DOCX (Office 2010) programatically or Bulk

Posted by kiquenet en 20 febrero 2014

Option 1) OMPM – Using  Office File Converter (OFC) and Version Extraction Tool

Download Office Migration Planning Manager (OMPM) to the machine that hosts the files.

Office Migration Planning Manager (OMPM): Office Compatibility
The Office Migration Planning Manager (OMPM) 2010 is a group of tools designed to help administrators during the planning and testing phases of a Microsoft Office 2010 or Office 365 deployment.
http://www.microsoft.com/en-us/download/details.aspx?id=11454

The installer extracts all tools and resource files by default to C:\OMPM

If your machine does not have Office 2003 installed, which by now it probably does not, then you will also need to install the Office compatibility pack to convert the files.

Módulo de compatibilidad de Microsoft Office para formatos de archivos de Word, Excel y PowerPoint
http://support.microsoft.com/kb/923505


Once that is installed, open the C:\OMPM\Tools folder that contains tools the Office File Converter (OFC) and Version Extraction Tool (VET)

Using OMPM tools
Use the Office File Converter (OFC) to do bulk conversions of specific Office files that are in version 97 through 2003 file formats to the Office 2010 file formats.
http://technet.microsoft.com/en-us/library/cc179179(v=office.14).aspx

Steps:

Edit OFC.INI file.

For the OFC.exe to work there must be a [FoldersToConvert] entry in the OFC.INI file.

Fldr=C:\OMPM\TOOLS\EXAMPLE FOLDER\ (in this case I put all the files I wanted to convert into the “EXAMPLE FOLDER”)

You can put multiple folders under this folder,


OFC.exe will follow this path a convert all DOC and XLS files into DOCX and XLSX files.

It will leave the old DOC file in the folder and create the new DOCX file right alongside.

The date created field will NOT change for the new DOCX or XLSX files


All the new files will be created in the appropriate folder, even if there are multiple layers of folders under the original location

In this case, the SourcePathTemplate and the DestinationPathTemplate listings in the OFC.INI file are just:

SourcePathTemplate=*\*\*\*\

DestinationPathTemplate=*1\*2\*3\*4\


Option 2) PowerShell

Requires Office 2010 installed

The main:

$CompatMode = [Enum]::Parse([Microsoft.Office.Interop.Word.WdCompatibilityMode], "wdWord2010")
$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat],"wdFormatDocumentDefault");

Clear-Host
$word = new-object -comobject word.application
$word.Visible = $False

Get-ChildItem -path $folderpath -recurse -include $fileType | % {

    SaveDocumentWithCompatibilityMode $word $_
    ConvertDocument $word $_
}

#Clean up
$word.quit()
$rc = [System.Runtime.Interopservices.Marshal]::ReleaseComObject($word)
$word = $null
[gc]::collect()
[gc]::WaitForPendingFinalizers()

Save Document with Compatibility

Function SaveDocumentWithCompatibilityMode($word, $document)
{
    $opendoc = $word.documents.open($document.FullName)
    $savename = ($document.Fullname).substring(0,($document.FullName).lastindexOf("."))
   
    $savename = $savename + "_test1.docx"
   
    $opendoc.saveas([ref]"$savename", [ref]$saveFormat);
    $opendoc.close();
    
    $converteddoc = Get-ChildItem -Path $savename
    $opendoc = $word.documents.open($converteddoc.FullName)
    $opendoc.SetCompatibilityMode($CompatMode);
    $opendoc.save()
    $opendoc.close()
}


I prefer Convert Document

Function ConvertDocument($word, $document)
{
    $opendoc = $word.documents.open($document.FullName)
    #$opendoc = $word.documents.open($document.FullName,$false,$true);
   
    $savename = ($document.fullname).substring(0,($document.FullName).lastindexOf("."))
    $savename = $savename + "_test2.docx"
    
    $opendoc.Convert()
    $opendoc.saveas([ref]"$savename", [ref]$saveFormat);
    $opendoc.close();
   
   
    # Stop Winword Process
    #$opendoc.quit()
    #$rc = [System.Runtime.Interopservices.Marshal]::ReleaseComObject($opendoc)
       
}

Referencias:
http://mongell.blogspot.com.es/2013/11/using-ompm-or-how-to-bulk-convert-pre.html

http://mykbit.blogspot.com.es/2011/10/bulk-convert-office-972003-files-to.html

http://blogs.msdn.com/b/ericwhite/archive/2008/09/19/bulk-convert-doc-to-docx.aspx

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/04718fc5-ab83-45d9-a413-e3cd9d18926f/how-to-convert-doc-files-to-docx-in-a-sharepoint-library-programmatically?forum=sharepointdevelopmentprevious

http://row5is.wordpress.com/2012/07/06/convert-doc-to-docx-using-powershell/

http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf

http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/22/hey-scripting-guy-how-can-i-use-windows-powershell-2-0-to-convert-doc-files-to-docx-files.aspx

Posted in Herramientas, Productividad, Scripts | Etiquetado: , , , , | Leave a Comment »