Showing posts with label list. Show all posts
Showing posts with label list. Show all posts

Export list of used NuGet packages for a given project

This one is as simple as the title says… I just wanted to get a list of all NuGet packages I’m currently using in my ASP.NET MVC 4 project.

If you look at the NuGet Package Manager window that you can access by right clicking a project in Solution Explorer and then selecting Manage NuGet Packages… you’ll see that there’s an Installed packages option on the left vertical menu. This is good and all but the manager doesn’t have an option to export the list of installed packages to a simple .txt file.

NuGet Package Manager listing Installed Packages for the projectFigure 1 - NuGet Package Manager listing Installed Packages for the project

One interesting thing is that NuGet uses a .XML file called packages.config that resides in the root folder of every project to actually fill the above window. Every time you add or delete a NuGet package this file is updated to reflect the changes.

This is the content of my packages.config file:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="AttributeRouting" version="1.5.4426" />
  <package id="DataAnnotationsExtensions" version="1.0.1" />
  <package id="DataAnnotationsExtensions.MVC3" version="1.0.1" />
  <package id="jQuery" version="1.7.1" />
  <package id="jQuery.Ajax.Unobtrusive" version="1.0" />
  <package id="jQuery.UI.Combined" version="1.8.17" />
  <package id="jQuery.Validation" version="1.8" />
  <package id="jQuery.Validation.Unobtrusive" version="1.0" />
  <package id="jquery-globalize" version="0.1.0" />
  <package id="knockoutjs" version="1.2.9.0" />
  <package id="log4net" version="1.2.10" />
  <package id="Microsoft.Web.Optimization" version="0.1" />
  <package id="microsoft-web-helpers" version="1.15" />
  <package id="Modernizr" version="2.0.6" />
  <package id="MvcSiteMapProvider" version="3.2.1.0" />
  <package id="Newtonsoft.Json" version="4.0.8" />
  <package id="NLog" version="2.0.0.2000" />
  <package id="RavenDB-Embedded" version="1.0.700" />
  <package id="System.Web.Providers" version="1.0.1" />
  <package id="T4MVC" version="2.7.0" />
  <package id="WebActivator" version="1.2.0.0" />
</packages>

This file serves the purpose of this post but it’d be a nice addition to the NuGet manager if it had a button to export the list of installed packages in a better formatted way. Just an idea.

Just let me take the opportunity to say “I Love You NuGet”. You let me explore the plethora of knowledge of fellow developers scattered all over the world in an easy way with the push of a button. I have no better words to describe you! You contribute enormously to the world development. Keep evolving!

Listing compressed files within a .zip or .rar by file size

I'd like to know any app that shows a list of the files that lie within a compressed file .zip or .rar. If the list could be ordered by file size it'd be great! It could be any software that runs on Windows or Mac OS since I use both OS using Parallels.

Why this is important to me?
The answer is that sometimes I need to send a compressed file to someone and this file generally contains lots of coding files that are part of a Visual Studio Solution/Project for example. I just want to send a subset of those files. There are some big files like DLLs and database files scattered everywhere in a lot of folders that don’t need to go with the compressed file.

So how can I avoid spending time going through all those folders/files, looking their size and deleting one by one to make the final compressed file to be uploaded smaller?

I thought about asking this question at SuperUser. To tell the truth I already had the question typed there but before I could post it and after a few tries by myself I got what I wanted using WinRAR with an easy play of menu commands. So how can you do this? Follow me…

1 - If you don’t know or don’t have WinRAR or use another file archiver, you can get it at:
http://www.rarlab.com/download.htm

I use WinRAR in its evaluation copy incarnation that once in while pops up a dialog asking you to purchase it. Smiley surpreso It works great even if you don’t want to purchase it… take it easy.

2 - At first compress the folders and files you want without getting bothered about the size of the resulting compressed file. After installing WinRAR it’s available in the context menu of any file or folder in Windows Explorer.

3 - Open the compressed file in WinRAR and play with the menu just a little bit. Go to the Options | File list and select Flat folders view and Details menu options.

WinRAR listing the files of a compressed file (trunk.rar) by file size
Figure 1 - WinRAR listing the files of a compressed file (trunk.rar) by file size

Taking the above screenshot into consideration (it lists the content of a trunk project folder compressed), we can see that it has 1554 folders and 1624 files. This compressed file alone has 87 MB in disk when the actual uncompressed content has 193 MB in size but it’s still pretty big to send it over the wire… I have a lot of folders and files to go through if I want to delete the big and unnecessary files to try to decrease the final size! As you see, it also contains many duplicate files in different paths… it’s pretty daunting just to think about a manual scan. A visual scan in a single screen is much better. How do you get a big picture of this compressed file?

4 - Order all the files by size by clicking the size column header.

5 - Select all the files you want to remove/delete from the compressed file in just one go. One can do this in two different ways: clicking a file and holding the ctrl key and clicking another file to select not contiguous files OR selecting one file and pressing the shift key and clicking another file to select contiguous files. After this it’s just a matter of right clicking the file selection and executing the Delete files command.

Hope this useful tip helps you someday!

Automate the download of a list of URLs/links

I just wanted to automate the process of downloading a list of URLs/links. I thought about asking a question at SuperUser. So I did that and got a few answers. One of those answers pointed to the piece of software that does exactly what I wanted. The software is a Firefox add-on that I had used a long time ago but couldn’t think about it for this task. Its name is DownThemAll!. Yes with an exclamation mark at the end. I think this has to do with a relief felling you feel when you’re using it.

In this post I’ll walk you through the steps necessary to get your downloads going in a really fast way (fasten your seat belt). No more downloading and saving file by file. Phew!

I’m going to use the same list of URLs I posted on my question at SuperUser.

Suppose you have a list of URLs as this one:

http://creamteam.tv/wp-content/uploads/2010/06/10-Chinatown.mp3
http://mp3muffin.com/train/burbs.mp3
http://www.knoxroad.com/wp-content/music/May/01%20World%20Sick.mp3
http://indierockcafe.com/mp3s/2010/may/5-18/bandofhorses_factory1.mp3
http://www.strangefamousrecords.com/sfr-audio/_common/sagefrancis_slowman.mp3
http://dangerbirdrecords.com/public/theoneamradio/crediblethreats.mp3
http://www.beggarsgroupusa.com/mp3/HolyFuck_LatinAmerica.mp3
http://dl.dropbox.com/u/4746099/05%20Choices%201.mp3
http://subpop-public.s3.amazonaws.com/assets/audio/6801.mp3
http://gvsbchris.com/01%20Sleep%20Paralysist.mp3
http://bantermm.com/tracks/Annuals-Loxtep.mp3
http://downloads.pitchforkmedia.com/The%20National%20-%20Bloodbuzz%20Ohio.mp3
http://stereogum.com/mp3/the%20morning%20benders%20-%20Excuses.mp3

Save this list in a text file [ .txt ] extension and name it MP3s.txt.

Now let’s get DownThemAll! and do the real thing…

1 - Install DownThemAll! add-on for Firefox. After installing restart Firefox.

2 - Go to Firefox menu and select Tools - DownThemAll! Tools - Manager... Right-click inside DownThemAll! screen.

3 - Select context menu Misc - Import from file.

4 - On Import downloads dialog window make sure you select Text Files in the dropdown list.

5 - Point to the text file MP3s.txt that contains the URLs. Click Open button.

6 - On Make your selection dialog window, DownThemAll! will load each link it finds in the text file allowing you to select which ones you want to download and the folder where you want the files to be saved as well.

7 - Make your selections, click Start button.

Here's a screenshot of it just doing the "Downloading" part:

DownThemAll! downloading the list of URLs from my question at SuperUser
Figure 1 - DownThemAll! downloading the list of URLs from my question at SuperUser

Oh… and this is the feature request on DownThemAll! trac opened 3 years ago.

Nice to see this implemented and working so well.

Congrats to DownThemAll! developers and users. Fantastic add-on.