Friday, February 1, 2013

Facebook: Hiding Suggested Pages

Fine tuning your Facebook news feed is a constant task.  To help bypass uninteresting items, simply perform the following:

1.  Find the down arrow located at the top right portion of the feed item to hide.


2. Select "Hide" or "Report Story or Spam" as you see fit.


3. You'll see confirmation that the story is hidden.



Thursday, January 31, 2013

PowerShell: Removing First 3 Characters from Filenames of Parent and Subfolders


I found several examples of renaming files but this one is simple and easy to change.

gci -include *.txt -recurse|ren -newname {($_.name).substring(3)}

Note: no carriage return, this is a single command
Note: Doesn't like spaces in the filenames

Run this command from the parent folder and it'll rename all the file types in the folder and all subfolders.  The only limitation I found is special characters in the folder or filename.

Saturday, December 1, 2012

Facebook: "Share Posts to Group" Google Chrome Repair

I was unable to share posts, links, and pictures to my newly created Facebook group from my main News Feed.  Performing some web searches, I found that some folks had success using different browsers and one person suspected the web browsers cache caused this problem for Chrome.  One alternative is to drop your membership of all groups then get reinvited back in.  Instead, I cleared a weeks worth of browser information and now I can share posts to my group.  If you're using Google Chrome, here are the steps to take:



 1.  From your Facebook News Feed, select an item and attempt to share it with your group.  Verify that your groups name does NOT show up in the autofill list.
2.  From your Google Chrome web browser, click on the upper right button labeled "Customize and control Google Chrome." Click on Tools, Clear browsing data...

WARNING: This next step will delete information from your Google Chrome web browser.  Read more if you're concerned about this.

3.  I most likely overkilled my data abolishment but start with "the past hour" and select "Empty the cache" and "Delete cookies and other site and plug-in data."  After you've selected these items, click on "Clear browsing data."  Close Chrome, start Chrome, log back into Facebook and try sharing to your group again.  If you still can't share to your group, increase the deletion period and/or add checkboxes to the "Obliterate" list.  Your success will vary based on your browsing history, sites visited, and other web-based events, add-ons, Chrome Extensions, and such.


4.  Your group will autofill once you've successfully deleted the group of data that was messing up your Facebook experience.

Monday, November 12, 2012

PowerShell: Resolve Remote Host and IPv4 Address

Update: I found the script block only works on local hosts.  As such, I found another way to get the remote host name and IP via PowerShellASP.

<%$ipaddress = [net.IPAddress]::Parse($request.UserHostAddress)%>

<%$UserHostname = [System.Net.Dns]::gethostentry($ipaddress.ipaddresstostring)%>
<%$UserHostname = $UserHostName.hostname -replace ".domain.suffix",""%>
Your Computers IP:<%=$ipaddress%> & Host Name:<%=$userhostname%><br><hr>

Click here to find your public IP address without using PowerShellASP.


I don't know if this helps but I've been working on a way to obtain the remote host name and IP for my PowerShellASP site.  Every several searches and testing, I found .net commands which extract the host name and an IPv4 adddress:
#PowerShell Script
$remotehostname = [system.net.dns]::gethostname()
#I noticed the ScopeID of IPv4 addresses is always $null, so I used that to find the IPv4 address
$remotehostipv4 = [system.net.dns]::gethostaddresses($remote)|?{$_.scopeid -eq $null}|%{$_.ipaddresstostring}
#Sample line displaying the host and IP.
$remotehostname,$remotehostipv4
Then I applied them to a test PowerShellASP file:



<%$remote = [system.net.dns]::gethostname()%>

<%$remoteip = [system.net.dns]::gethostaddresses($remote)|?{$_.scopeid -eq $null}|%{$_.ipaddresstostring}%>

Remote IP: <%=$remoteip%><br>
Remote: <%=$remote%>

By obtaining the remote host name and IP (a PowerShellASP website visiting computer), I can create a remote connection and run PowerShell commands on the remote host for the user.  By default, PowerShellASP will run all commands on the server, meaning that a request to see how much hard drive space is left will be ran on the server.  This will return the server's remaining hard drive space result to the remote user.  Frankly, the user doesn't care about the servers hard drives and really wants to know about their own hard drives.  To perform this request, the web server has to create a remote WMI connection and run the command. Having the remote host information allows this to happen.

Sunday, November 4, 2012

Virtual PC: Mounting a Windows 7 32-bit VM

The following is an overview of the Windows 7 Virtual Machine (VM) for Windows 7 Virtual PC creation process:
1. Download the AIK (MS Automated Installation Kit) with SP1.
2. Copy a file from the AIK to a hard drive with ample room for the VM.
3. Download and move a script which converts a Windows 7 install CD into a VHD.
4. Download and install Windows 7 Virtual PC.
5. Create a virtual machine.
6. Start the Windows 7 VHD virtual machine.
7. Install Windows 7 as normal.
8. Install the Integration Components.

Detailed Instructions:
1. Download the Automated Installation Kit; which is an ISO file.  ISO's are not normally readable by Windows so I used Slysoft's free virtual clone drive.  Slysoft's software will install a virtual DVD drive which shows up in the system tray with a new drive letter.



Right click on its system tray icon and "mount" the AIK.ISO file that you downloaded.  Let autorun start the AIK install or alternatively double-click on StartCD.exe.  Install the software.

2. Download the Automated Installation Kit Service Pack 1.  Mount the downloaded waik_supplement_en-us (or equiv).ISO and copy the contents into the AIK PETools folder (c:\program files\Windows AIK\Tools\PETools - if you used the defaults).
3. Download the Microsoft WIM2VHD.WSF script. Now you want to copy WIM2VHD.WSF to a large drive.  This will be the location where your new Windows 7 virtual drive will be created.  Also, go into c:\program files\windows AIK\Tools\ and copy imageex.exe (from the appropriate CPU-type subfolder) to the same drive as WIM2VHD.WSF.
4. Make your Windows 7 32-bit DVD/USB source accessible and run this command from an elevated command line (right-click cmd.exe runas-administrator) from the folder which has WIM2VHD.WSF and imageex.exe:
cscript wim2vhd.wsf /wim:d:\sources\install.wim /sku:{professional|enterprise|ultimate} 
note: d: - current Windows 7 install source location; sku type is Windows version (pick one).
 

5.  When the script successfully completes, it will create the VHD file and place it in the folder where you ran the script.  It will have a name similar to this:
(6.1.7600.16385.x86fre.win7_rtm.090713-1255.Enterprise.en-US.vhd)

6. Download Windows Virtual PC. You'll have to pass a Windows license verification authentication first.  Also, check your computer to ensure it can support a virtual machine.  Your BIOS and components have to possess this capability and download and run this Microsoft tool to test your computer.  After you have tested for compatibility and validated your license, install Windows Virtual PC.  You will have the choice of installing the 32 or 64 bit version.  For some reason, I can only use 32-bit virtual machines even though I have the 64-bit Virtual PC software.  I think it might be a software limitation.  Also, be aware that if you've disabled the Windows Update service, this software will be unable to install.

7.  From the Start Menu, open Windows Virtual PC.  Create a Virtual Machine and select your newly created VHD.  After creating the VM, click on Settings and review/alter the settings to suit your needs.



8.  Open the VM and you'll see it perform sysprep steps as it installs Windows 7 in your Virtual Machine.
9. When finished, it will act like a normal Windows installation and need anti-virus, security patches, and other normal utilities.
10.  Ensure to install the Integration Tools found on the VM's Tools menu.  This will allow you to move your mouse in and out of the VM without it being captured.  To break your mouse out of the VM, press the Windows keyboard key.


This blog entry based on information from:
http://forums.mydigitallife.info/archive/index.php/t-32822.html
http://www.hanselman.com/blog/StepByStepTurningAWindows7DVDOrISOIntoABootableVHD VirtualMachine.aspx