Categories
Tech

Remove Directory from Git Repository

I recently started working with the integrated Version Control System (VCS) features of PyCharm and accidentally pushed my IDE / PyCharm project settings to my Google Code hosted Git repository. Basically, all of the files in the .idea folder of my project were pushed to the repository. While these files didn’t necessarily contain any proprietary or confidential information, I didn’t want them cluttering up my project repository. And while I could have simply removed the files and performed a commit, these files would have then been in the history of my repository.

I did some quick research and found a post on GitHub explaining how to remove a file along with its history from a GitHub repository. This command basically did what I needed to, but was designed to remove a single file at a time. Being that I wanted to remove a whole directory of files, I modified the command to remove the folder and recursively iterate through the directory removing children:

git filter-branch --force --index-filter \
'git rm -r --cached --ignore-unmatch .idea' \
--prune-empty --tag-name-filter cat -- --all

git push origin master --force

It should be noted that the command will overwrite existing tags and that if you had sensitive information in the files (like passwords), you should consider the information compromised and take appropriate action.

Categories
Tech

How To Reduce Size of WinSXS

I’ve read all about WinSXS (Side by Side) and how it tries to solve the DLL Hell problems that have plagued Windows for ages, but I thought it was ridiculous that this folder was taking up over 10 gigs of precious space on my 64 GB solid state drive. A few months back, I replaced my laptop’s optical drive with a 500 gig HDD to try to move some of my media and documents over. However, when I went to install the latest service pack to Visual Studio today, I noticed I didn’t have enough space to install it. I used a simple tool called TreeSize Free to analyze the disk space and see what was taking up all the room. A quick drill down of the largest item showed that the WinSXS folder was talking up 10.2 GB of space.

2010-01-04_103841

Categories
Tech

Theme Mod: Search Box

As some of you may have noticed, I've recently added a search box to the top of the site.  This is a default module in joomla, but the template I'm using didn't have support for a search bar right out of the box.  This blog post describes how I added the modified the WR_Futilus_Situs theme so it would have a search box that looked like it fit in.

At a high level, the steps involve:

  • Enabling the search module and setting it up
  • Modifying the theme's index.php file to include the search box

 

And here are the details:

Setting up the module: 

  • Enter the Joomla Administration page.
  • Click Modules > Site Modules
  • Click on the Module named "Search" (of type "mod_search")
  • Make sure the item is published by clicking the appropriate radio box.
  • And change the Position Drop Down box to position User8
  • Click save at the top

Modifying the index.php file:

  • FTP into your server
  • Access the joomla_home/templates/wr_futilus_situs folder
  • Download the file index.php (from the above folder) for editing
  • Find the section called <!– START: SUCKERFISH –>
  • Below : <div id="nav">
                            <?php mosShowListMenu($menu_name);    ?>
                </div>
    Insert:     <div style="padding-top: 5px;" align=right>
                            <?php mosLoadModules ( 'user8', -1 ); ?>
                  </div>
  • Save the file and upload it via FTP
  • You are DONE!