Easily Remove Built-In Windows 10 Apps Using PowerShell

Here’s something I like to do after setting up a new Windows 10 machine: remove the 20 or so built-in apps that don’t provide an Uninstall option.

It’s a simple task to accomplish; you can achieve it in 4 quick steps:

  1. Create a new text file and save it with the .ps1 extension
  2. Paste the PowerShell code listed below into that new file
  3. Start a PowerShell session via “Run as Administrator”
  4. Type the full path to your new file at the command line and hit the Enter key

Here’s the PowerShell code you need to paste into your .ps1 file:

Write-Host "Starting to remove bloatware."
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Get-AppxPackage *bingnews* | Remove-AppxPackage
Get-AppxPackage *bingsports* | Remove-AppxPackage
Get-AppxPackage *bingweather* | Remove-AppxPackage
Get-AppxPackage *communicationsapps* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *messaging* | Remove-AppxPackage
Get-AppxPackage *onenote* | Remove-AppxPackage
Get-AppxPackage *phone* | Remove-AppxPackage
Get-AppxPackage *photos* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Get-AppxPackage *sway* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Get-AppxPackage *windowsphone* | Remove-AppxPackage
Get-AppxPackage *xboxapp* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
Get-AppxPackage *zunevideo* | Remove-AppxPackage
Write-Host "Goodbye, bloat."

How to Trace/Capture Web Service & REST HTTP Requests Using Fiddler in 3 Easy Steps

1) Download the awesome Fiddler app from here: Fiddler @ Telerik

2) Install Fiddler, then right-click its shortcut icon and click Run as Administrator.

3) Add the following configuration section within the system.net node of your web.config:

<defaultProxy>
<proxy bypassonlocal="false" usesystemdefault="false" proxyaddress="http://127.0.0.1:8888" />
</defaultProxy>

This section tells your server-side code to use Fiddler (running on its default port of 8888 on localhost) as its proxy for the server-side HTTP requests it makes.

Make your web service or REST calls and enjoy!

.NET Web API – Transform dynamic result to JSON

protected HttpResponseMessage JsonApiRespond(dynamic input)
 {
  string jsonResult = JsonConvert.SerializeObject(input, _jsonSettings);
  HttpResponseMessage response = this.Request.CreateResponse(HttpStatusCode.OK);
  response.Content = new StringContent(jsonResult, Encoding.UTF8, "application/json");
  return response;
 }

	

Stop POODLE SSL (SSLv3 Vulnerability) Attacks on Apache

To stop the evil POODLE SSL attack on Apache, you need to disable the SSLv2 and SSLv3 protocols.

Add the following line of text to your apache.conf file, usually found in folder /etc/apache2

SSLProtocol All -SSLv2 -SSLv3

Run the apache configuration test command after doing this:

apachectl configtest

Then restart apache, the “hard” way:

/etc/init.d/apache2 stop
/etc/init.d/apache2 start

You are good to go!

 

Consider Encryption for Your Business — Article Published in Saratoga Business Journal

Portion of an article by Alex T. Silverstein, published online (and in print) by Saratoga Business Journal. Encourages all businesses to consider their storage of personally identifiable information, and the need to encrypt it.

Link: IT Experts: Vital Security Issues Are Not Always Simple, But Need To Be Addressed

How to Use the Ping Command to Ping IPv4 or IPv6

Here’s a useful tidbit relating to ping on Windows: If you specify -4 or -6 after the IP address or hostname, you can ping either IPv4 or IPv6, respectively. For example:

To ping using IPv4:

  ping somehostname.com -4

To ping using IPv6:

  ping somehostname.com -6

Additionally, if you add an entry to your hosts file (C:\Windows\System32\drivers\etc\hosts), ping‘s default behavior will change from IPv6 to IPv4.

SQL Server Administration : Awesome SQL Script for Checking Current Backup Status

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT
DB_NAME(er.[database_id]) [DatabaseName]
,er.[session_id] AS [SessionID]
,er.[command] AS [CommandType]
,est.[text] [StatementText]
,er.[status] AS [Status]
,CONVERT(DECIMAL(5, 2), er.[percent_complete]) AS [Complete_Percent]
,CONVERT(DECIMAL(38, 2), er.[total_elapsed_time] / 60000.00) AS [ElapsedTime_m]
,CONVERT(DECIMAL(38, 2), er.[estimated_completion_time] / 60000.00) AS [EstimatedCompletionTime_m]
,er.[last_wait_type] [LastWait]
,er.[wait_resource] [CurrentWait]
FROM sys.dm_exec_requests AS er
INNER JOIN sys.dm_exec_sessions AS es ON er.[session_id] = es.[session_id]
CROSS APPLY sys.dm_exec_sql_text(er.[sql_handle]) est
WHERE er.[command] = 'BACKUP DATABASE';

Project Management: Things the “Top 2%” Get Right

Andy Crowe’s “Alpha Project Managers,” published in 2006.

Crowe surveyed over 3,000 project managers and their co-workers/supervisors in order to identify the “top 2%” of project managers (“alpha project managers”). He tried to identify PMs who were consistently rated as excellent by the people they worked with and their customers. Once he found them, he zeroed in on their work habits and PM techniques.

Some of the interesting findings:

  • Alphas respond to fewer emails/day and spend less time in meetings than non-alphas, yet people rated them as being more responsive than non-alphas.
  • Alphas establish explicit communication expectations, and adhere to them stringently.
  • Alphas sent much shorter communications than their non-alpha peers.
  • Alphas spent twice as much time in the planning phase of their projects than did non-alphas.
  • Alphas used informal networks to get things done much more often than non-alphas (who stuck to formal channels).
  • Alphas were much more aware or how their bosses were being measured (ROI, etc.) than non-alphas.

— Excerpted from the Amazon.com review

Linux: How to Determine Cron-Execution-Time Environment Variable Values

Oftentimes it’s asked how to figure out which environment variables your cron scripts are running against.

The first step in doing so is the figure out exactly which shell cron is using.

/bin/sh is usually symbolically linked to bash on a variety of linux systems. Some Debian-based distros jave /bin/sh linked to dash (you can always run “ls -l /bin” to see such links).

To configure cron’s run-time environment in your shell scripts, add the following environment variables at the top of the cron tab. This will set the shell and $PATH, and it will also email you the output of STDOUT and STDERR as your script is executed.

SHELL=/bin/bash
MAILTO=me@me.com
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

To go a bit deeper in your investigations, you can have cron execute a Perl script (thanks to Po Petz for the code below). The following prints out your environment variable values. It shows you what is visible to cron at exeecution-time, and helps you figure out whether you need to make any adjustments to the cron environment (such as PATH or any special variables like $HOME or $JAVA_HOME).

#!/usr/bin/env perl
use warnings;
use strict;

my $filename = "$0.out"; # just tack on an ".out" to the name of this script

open my $filehandle, '>', $filename or die "Could not write to ' $filename ' : $!\n";

my $timestamp = scalar(localtime);
print $filehandle "Dumping environment values at $timestamp :\n";

# print out the whole environment
foreach my $key (sort (keys %ENV)) {
    print $filehandle "$key = $ENV{$key}\n";
}

MySQL: The reason for using the “DELIMITER” statement in MySQL routines (stored procedures, functions, triggers)

This short article illustrates how to format your MySQL routines (stored procedures, functions, triggers) for release. We’ll use the following code block to discuss.


DROP PROCEDURE IF EXISTS mytestproc; -- Don't use "dbname.mytestproc"
 
DELIMITER $$ -- Change delimiter from semicolon
 
CREATE PROCEDURE mytestproc() -- Again, don't use "dbname.mytestproc"
BEGIN
# ATS Created test for dbname data 06/20/2013
SELECT 1;
 
END$$ -- Use of new $$ delimiter
 
DELIMITER ; -- Change delimiter back to the default (semicolon). Note that the spacing used here is important!

1) The first step in the script is to drop the existing routine, if it exists. Notice how the procedure name is not prefixed with database name (e.g., dbname.mytestproc). This is so that we can run this same script against multiple databases.

2) The next step is to change the default MySQL script parser’s delimiter from semicolon (;) to double-dollar sign ($$). The reason you do this is so that the semicolons after each statement in the body of the routine are not interpreted by the parser as meaning the end of the CREATE PROCEDURE statement. This is because the entire CREATE PROCEDURE block, from CREATE PROCEDURE to END is actually a single statement that must be executed by itself. Were it not for the delimiter change, the script would break, since there each statement inside BEGIN and END would execute individually. Note that you can use a variety of non-reserved characters to make your own custom delimiter.

3) The next step is to create the routine.

4) Next is the BEGIN statement, indicating the start of the routine body

5) Next are the statements inside the routine, each terminated with semicolon (which will NOT be interpreted as end-of-CREATE PROCEDURE, since you changed the delimiter to $$).

6) Next is the END$$ statement. Notice how END is followed by $$. This actually ends the CREATE PROCEDURE statement.

7) Finally, the default delimiter (semicolon) is restored