How to Enable or Disable Virtual Memory Pagefile Encryption in Windows 10

Encrypting the pagefile prevents malicious users from reading data that has been paged to disk, but also adds processing overhead for filesystem operations.

This tutorial will show you how to enable or disable virtual memory pagefile encryption in Windows 10.

Read more…

How to Clear Virtual Memory Pagefile at Shutdown in Windows 10

Virtual memory support uses a system pagefile to swap pages of memory to disk when they are not used. On a running system, this pagefile is opened exclusively by the operating system, and it is well protected. However, systems that are configured to allow booting to other operating systems might have to make sure that the system pagefile is wiped clean when this system shuts down. This ensures that sensitive information from process memory that might go into the pagefile is not available to an unauthorized user who manages to directly access the pagefile.

Some third-party programs can temporarily store unencrypted (plain-text) passwords or other sensitive information in memory. Because of the Windows virtual memory architecture, this information can be present in the paging file.

Although clearing the paging file is not a suitable substitute for physical security of a computer, you might want to do this to increase the security of data on a computer while Windows is not running.

This tutorial will show you how to turn on or off to clear the virtual memory pagefile when you shut down or restart Windows 10.

Read more…

Microsoft Security Updates – FEBRUARY 2017 to be bundled with MARCH 2017 release

During final QA testing apparently some issues was discovered that warranted further improvement prior to distribution to millions of users.  Microsoft will merged the FEBRUARY 2017 security updates into MARCH 2017 release, allowing time to resolve all issues.

https://blogs.technet.microsoft.com/msrc/2017/02/14/february-2017-security-update-release/

Our top priority is to provide the best possible experience for customers in maintaining and protecting their systems. This month, we discovered a last minute issue that could impact some customers and was not resolved in time for our planned updates today. After considering all options, we made the decision to delay this month’s updates. We apologize for any inconvenience caused by this change to the existing plan.

Microsoft – Proposes Global Cybersecurity Accord for 2017

Microsoft & other vendors have proposed improved cybersecurity initiatives on a collective basis during coming year.

http://www.technewsworld.com/story/84311.html

Microsoft has called on governments around the world to create a “digital Geneva Convention” as a way to normalize international cybersecurity rules and protect civilian use of the Internet.   President Brad Smith, who is also Microsoft’s chief legal officer, addressed the issue at the annual RSA conference, saying that governments — with the assistance of technology companies in the role of NGOs — need to establish international rules to protect civilians from cyberthreats during peacetime.

“The tech sector plays a unique role as the Internet’s first responders, and we therefore should commit ourselves to collective action that will make the Internet a safer place, affirming a role as a neutral Switzerland that assists customers everywhere and retains the world’s trust,” Smith wrote in an appeal posted online.   There are two key focal points:

1 — Economic Damage Seventy four percent of the world’s businesses expect to be hacked every year, with the economic losses from cybercrime averaging US$3 trillion per year, according to Microsoft.  Cyberattacks historically have focused on military and economic espionage, Smith noted.

2 — Institutional Threat — Microsoft is not alone in promoting cybersecurity cooperation among government institutions.  The Electronic Privacy Information Center earlier this week announced a new Democracy and Cybersecurity project, designed to address growing alarm about the impact of cyberattacks on democratic institutions.  The organization has urged the U.S. Congress to update federal data protection laws, and to establish a data protection agency designed to address the increased risks of identity theft and data breaches, said Marc Rotenberg, executive director of EPIC.

What methods does SCCM provide for deploying operating systems?

What methods does SCCM provide for deploying operating systems?

In this FAQ we look at the various methods ConfigMgr provides for deploying operating systems.

You need a subscription to access the answer.

The post What methods does SCCM provide for deploying operating systems? appeared first on FAQShop.

Source:: http://faqshop.com/feed

Pale Moon 27.1.1 Released February 21, 2017

Pale Moon: Release notes

27.1.1 (2017-02-21)

This is a stability and bugfix update to the browser.

Changes/Fixes:

    • Implemented a fix in media handling to prevent crashes with
      concurrent videos and/or rapidly starting/stopping video playback in
      the browser.
    • Fixed the way the Adobe Flash plugin is detected to prevent
      confusion with other plugins that identify themselves as “Flash” (e.g.
      VLC).
    • Windows: Solved stability issues caused by the release build process, resulting in unexpected behavior (e.g. hangups).

https://www.palemoon.org/releasenotes.shtml

Removal instructions for AllInOneDocs

What is AllInOneDocs?

The Malwarebytes research team has determined that AllInOneDocs is a browser hijacker. These so-called “hijackers” manipulate your browser(s), for example to change your startpage or searchscopes, so that the affected browser visits their site or one of their choice. This one also displays advertisements.

https://forums.malwarebytes.com/topic/196614-removal-instructions-for-allinonedocs/

Technologies to Follow in 2017

Introduction

A lot is happening and it’s difficult to keep track of everything. Based on my work and on what I see over the Internet, I decided to write a post about the technologies – tools, languages, servers, operating systems, etc – that I find more interesting and promising. I know, some of these will be controversial, others are not exactly new, I am even mixing totally different things together, but, hey, it’s my opinion – feel free to share your objections here! Winking smile

I am not going to cover the myriad of JavaScript frameworks, because they’re just too many. I will only talk about what I know. For that same reason, I’m not talking about Akka, Go, Scala, Python, Ruby, Erlang, etc, because, honestly, I never used them. Also, I don’t cover Java, although Kafka is written in Java, because I haven’t used Java in anger for more than 10 years. I read that it’s having some problems, with some key people leaving Oracle, persisting security problems and the delaying of releases, but I’m sure Java is here to stay. Others will be more fit to talk about it.

.NET Core

.NET Core is Microsoft’s next version .NET framework, only this time totally modular, open source and multi-platform. Runs on Linux and MacOS, not just Windows. Still doesn’t have all the features of classic .NET, but it will get there: next version (2.0) will more than double the supported APIs. Right now, it’s perfect for writing .NET MVC apps and web APIs that need to run in other operating systems, including inside Docker containers. Get it from https://github.com/dotnet/core.

Node.js

A JavaScript runtime for the desktop instead of the browser. Uses an event-driven, asynchronous I/O model for high performance and scalability. Has probably the largest ecosystem of open source libraries in the world – NPM. Free and open source, with new features continuously being released. Currently uses Google’s V8 engine, but Microsoft submitted a patch to allow it to run Chakra, it’s JavaScript engine! Exciting times! Its site is https://nodejs.org.

Docker

You favorite container technology! Now supported in both Amazon Web Services and Azure, and with native support in Windows Server 2016. This is a must have for highly scalable applications. Free but it’s possible to get a paid repository online. A lot going on around it, the only problem is that things tend to change in non-retro-compatible ways, still need maturing. See more at http://docker.com.

Elasticsearch

A distributed and open source search engine based on Lucene. A blazing fast NoSQL database with replication capabilities, it is the most widely known component of the ELK stack, together with Kibana (for reporting and visualizations), Logstash (for data import) and Beats (for data shipping). Even Azure Search uses it behind the covers. Free but some tools are paid. Get it from http://elastic.co.

ECMAScript 2015

The next generation JavaScript, also known as ECMAScript 6. Heavily influenced by TypeScript, it offers a number of features from compiled languages, such as lambda functions, classes, type safety, etc. Before it’s available everywhere, people are using Babel.js to compile it to classic JavaScript. Google Chrome’s V8 engine already supports a great deal of it, as does Firefox. The specification is available here: http://www.ecma-international.org/ecma-262/6.0/.

HTML5

Is there any other, I hear you ask? Well, except if you need to support that old two-letter browser who had an infamous version 8, not really. Together with HTML 5 came a wealth of APIs that now allow us to have near-desktop quality apps on the web, and in some mobile browsers too. Latest standard is 5 but 5.1 is due to come out this year. Interestingly, HTML5 is more and more not just about web applications but also being used for desktop ones: for example, the Spotify desktop client is an HTML5 app. The specification is available at https://www.w3.org/TR/html5.

Kafka

A high throughput, low-latency open source message broker from the Apache foundation. Can stream data in real-time for massive simultaneous clients and has bindings for several languages. Similar to a distributed transaction log with exactly once semantics. More info here: https://kafka.apache.org.

TypeScript

A superset of JavaScript offering type safety and class-based object-oriented features. Nice wrappers around promises using similar syntax to C#’s async/await. It is compiled to JavaScript, so it can run anywhere JavaScript can. Free license. The official site is https://www.typescriptlang.org.

MongoDB

An open source NoSQL document database designed for high performance and with interesting clustering features. Mappings for all common languages, including scripting ones. With it you get JSON storage, indexes and automatic expiration. With free and commercial licenses. See more at http://www.mongodb.com.

Git

A free and open source distributed source control from the author of Linux. Now being used everywhere, even Microsoft is using it instead of their own TFS. Not an easy beast to master, I may add. Also worth mentioning GitFlow, a proposed workflow for branching and release management. The official site is https://git-scm.com.

Nginx

A high performance web server, HTTP cache and reverse proxy server for several TCP protocols. Can serve .NET and any other language, probably best used as a reverse proxy, particularly in the case of .NET Core. Runs on Windows and several UNIX flavors. It is free to use. Available from https://www.nginx.com.

Octopus Deploy

An automated deployment and release management tool for .NET applications. Latest versions can deploy both web apps as well as Windows services. Plays nicely with Continuous Integration and build tools such as Jenkins and TeamCity. Both free and commercial licenses. The web site is https://octopus.com.

Azure

Microsoft’s Cloud offering, the competitor of Amazon Web Services. Loaded with powerful services and features, which include amazing machine learning services, containerization as a service, queuing, and anything that can be expected from a Cloud service. Possible to get a time-limited trial for free. The official site is https://azure.microsoft.com.

Amazon Web Services

One of the two major players in the Cloud market, the other being Azure. Still has the biggest market share and offers a number of interesting features. Leaning slightly more towards Java and JavaScript than to .NET. Anyone can get a free account, as long as a credit card is supplied. See more at https://aws.amazon.com.

Linux

The free and open source operating system that just a few years ago Microsoft compared to a virus! Based on UNIX, now not just for geeks, it is everywhere, especially with the arriving of Docker. Several distributions available, to match anyone’s preferences, some free and some commercial. Windows 10 now even runs bash natively! See more at https://kernel.org.

Visual Studio Code

A powerful and extensible yet lightweight IDE from Microsoft based on GitHub’s Electron, which can run in a number of platforms, from Windows and Linux to MacOS. Includes support for a number of languages, Git integration, debugging capabilities – which make it stand from others such as Sublime or Atom – and an extension mechanism. Hey, it’s free! Get it from http://code.visualstudio.com.

Xamarin

A cross-platform implementation of .NET, for Windows Phone, Android and iOS. Before .NET Core came along – in fact, even after that – it is the preferred tool for creating applications that need to target multiple platforms. Now offered for free by Microsoft. but the Enterprise version will require a Visual Studio paid license. Microsoft promised to make it open source. Official site is https://www.xamarin.com.

Google Analytics

A web analytics service offered for free by Google, although paid subscriptions also exist. Can be used to track not only traffic but also custom events, and also in mobile apps. It’s unbelievable the amount of information that one can get out of it. See it in https://analytics.google.com.

SQL Server 2016

In-memory tables, JSON support, Query Store, integrated R, row and column-level security, etc, make this one of the most interesting versions of SQL Server ever. Available for free with limitations as Express edition, and as a paid license. More info from http://microsoft.com/sqlserver.

Let’s Encrypt

Free SSL certificates for the masses! No need to pay for a certificate, now you can get any number for free. Easily installable in any server (even IIS), but expires every 90 days. Get yours from https://letsencrypt.org.

TensorFlow

TensorFlow is Google’s second generation open source library for machine intelligence. It uses data flow graphs to represent mathematical operations and is the core of several Google products, such as Gmail, Google Photos and others. It offers Python and C++ bindings and recently it compiles on Windows as well as Linux and Mac OSX. Get it from https://github.com/tensorflow/tensorflow.

GitLab

GitLab is a free (with an enterprise license too) repository manager built on Git. It is fast moving with a plethora of very useful features. You can install it on premises or run it in the cloud. Offers integration with LDAP servers for authentication, offers a pretty decent Continuous Integration feature, plus a lot of other cool stuff. Check it out at https://about.gitlab.com.

Redis

A distributed cache with open source implementations in Linux and Windows. Currently, probably the most used one. Offered by both Azure and AWS. Not just BLOB cache, offers interesting structures. Learn about it at https://redis.io.

Conclusion

So, what are your thoughts – am I missing something? Do you agree or disagree with my choices? I’d love to hear from you!

How to Manage Virtual Memory Paging File in Windows 10

Paging is a memory management scheme by which a PC stores and retrieves data from secondary storage for use in main memory. In this scheme, the operating system retrieves data from secondary storage in same-size blocks called pages. Paging is an important part of virtual memory implementations in modern operating systems, using secondary storage to let programs exceed the size of available physical memory.

For simplicity, main memory is called “RAM” (abbreviated from “random-access memory”) and secondary storage is called “disk” (a shorthand for “hard disk drive”), but the concepts do not depend on whether these terms apply literally to a specific computer system.

Virtual memory is a memory management technique that is implemented using both hardware and software. It maps memory addresses used by a program, called virtual addresses, into physical addresses in computer memory. Main storage as seen by a process or task appears as a contiguous address space or collection of contiguous segments. Windows manages virtual address spaces and the assignment of real memory to virtual memory. Address translation hardware in the CPU, often referred to as a memory management unit or MMU, automatically translates virtual addresses to physical addresses. Software within Windows may extend these capabilities to provide a virtual address space that can exceed the capacity of real memory and thus reference more memory than is physically present in the computer.

The primary benefits of virtual memory include freeing applications from having to manage a shared memory space, increased security due to memory isolation, and being able to conceptually use more memory than might be physically available, using the technique of paging.

Basically, a paging file is an area on the hard disk that Windows uses as if it were RAM when you run out of available RAM.
By default, Windows automatically manages the pagefile settings for you, but there may be times you may need to manually manage your pagefile. For example:

  • If the C: drive that Windows is installed on is small in size, you may wish to remove the pagefile from that drive, and add a paging file to another drive with more space instead.
  • If you use a lot of memory, then you may wish to add a pagefile to another drive to have available if needed.
  • If you don’t use a lot of memory and your pagefile is large in size, you may wish to use a smaller custom size.
  • If you are getting a BSOD PAGE_FAULT_IN_NONPAGED_AREA or KERNEL_DATA_INPAGE_ERROR or Low Memory type error, you may need to use a larger custom size for the pagefile.

This tutorial will show you how to manage the virtual memory paging file for each drive on your Windows 10 PC.

Read more…

 

Removal instructions for Youndoo FakeFFProfile

What is Youndoo?

The Malwarebytes research team has determined that Youndoo is a browser hijacker. These so-called “hijackers” manipulate your browser(s), for example to change your startpage or searchscopes, so that the affected browser visits their site or one of their choice. This one also displays advertisements.
This version of the Youndoo search hijacker adds an extra Firefox profile and uses a Scheduled Task to re-infect or update the infection.

https://forums.malwarebytes.com/topic/196569-removal-instructions-for-youndoo-fakeffprofile/

How to Add or Remove Edit with Paint 3D context menu in Windows 10

The Paint 3D UWP (Universal Windows Platform) app has been included in Windows 10 starting with Windows 10 build 14971.

It has also added a new Edit with Paint 3D context menu item for images that will open the image in the Paint 3D app when used.

This tutorial will show you how to add or remove the Edit with Paint 3D context menu for all users in Windows 10.

Read more…

What general steps do I need to take for a successful SCCM OSD?

What general steps do I need to take for a successful SCCM OSD?

There are several general steps you need to take to ensure the successful deployment of an operating system using the ConfigMgr Operating System Deployment (OSD) feature.

You need a subscription to access the answer.

The post What general steps do I need to take for a successful SCCM OSD? appeared first on FAQShop.

Source:: http://faqshop.com/feed

Poor man’s backup

Introduction

When you have something digital, having backups is something fundamental to keep your data safe. There are many threats over there that can destroy your data: hardware failures, viruses, natural disasters are some of the ways to make all your data vanish from one moment to the other.

I use to keep my data in several places (you can never be 100% sure Smile), making cloud and local backups, and I can say that they have saved me more than once. For cloud backups, there are several services out there and I won’t discuss them, but for local backups, my needs are very specific, and I don’t need the fancy stuff out there (disk images, copying blocked data, and so on). I just need a backup that has these features:

  • Copies data in a compressed way – it would be better that it’s a standard format, like zip files, so I can open the backups with normal tools and don’t need to use the tool to restore data.
  • Allows the copy of selected folders in different drives. I don’t want to copy my entire disk (why keep a copy of the Windows installation, or the installed programs, if I can reinstall them when I need).
  • Allows the exclusion of files and folders in the copy (I just want to copy my source code, there is no need to copy the executables and dlls).
  • Allows incremental (only the files changed) or full backup (all files in a set)
  • Can use backup configurations (I want to backup only my documents or only my source code, and sometimes both)
  • Can be scheduled and run at specified times without the need of manually starting it.

With these requirements, I started to look for backup programs out there and I have found some free ones that didn’t do everything I wanted and some paid ones that did everything, but I didn’t want to pay what they were asking for. So, being a developer, I decided to make my own backup with the free tools out there.

The first requirement is a compressed backup, with a standard format. For zip files, I need zip64, as the backup files can be very large and the normal zip files won’t handle large files. So, I decided to use the DotNetZip library (https://dotnetzip.codeplex.com/), an open source library that is very simple to use and supports Zip64 files. Now I can go to the next requirements. That can be done with a normal .NET console program.

Creating the backup program

In Visual Studio, create a new Console Program and, in the Solution Explorer, right-click the References node and select “Manage NuGet packages” and add the DotNetZip package. I don’t want to add specific code for working with the command line options, so I added a second package, CommandLineParser (https://github.com/gsscoder/commandline), that does this for me. I just have to create a new class with the options I want and it does all the parsing for me:

class Options
{
    [Option(DefaultValue = "config.xml", 
      HelpText = "Configuration file for the backup.")]
    public string ConfigFile { get; set; }

    [Option('i', "incremental", DefaultValue= false,
      HelpText = "Does an increamental backap.")]
    public bool Incremental { get; set; }

    [HelpOption]
    public string GetUsage()
    {
        return HelpText.AutoBuild(this,
          (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
    }
}

To use it, I just have to pass the command line arguments and have it parsed:

var options = new Options();
CommandLine.Parser.Default.ParseArguments(args, options);

It will even give me a –help command line for help:

image

The next step is to process the configuration file. Create a new class and name it Config.cs:

public class Config
{
    public Config(string fileName)
    {
        if (!File.Exists(fileName))
            return;
        var doc = XDocument.Load(fileName);
        if (doc.Root == null)
            return;
        IncludePaths = doc.Root.Element("IncludePaths")?.Value.Split(';');
        ExcludeFiles = doc.Root.Element("ExcludeFiles")?.Value.Split(';') ?? new string[0] ;
        ExcludePaths = doc.Root.Element("ExcludePaths")?.Value.Split(';') ?? new string[0];
        BackupFile = $"{doc.Root.Element("BackupFile")?.Value}{DateTime.Now:yyyyMMddhhmmss}.zip";
        ExcludeFilesRegex =
            new Regex(string.Join("|", string.Join("|", ExcludeFiles), string.Join("|", ExcludePaths)));
    }

    public Regex ExcludeFilesRegex { get; }
    public IEnumerable IncludePaths { get; }
    public IEnumerable ExcludeFiles { get; }
    public IEnumerable ExcludePaths { get; }
    public string BackupFile { get; }
}

To make it easy to select the paths and files to be excluded, I decided to give it a Regex style and create a Regex that will match all files. For example, if you want to remove all mp3 files, you would add something like “.mp3$” (starts with a “.”, then mp3 and then the end of the string). If you want to remove mp3 and mp4 files, you can add this: “.mp[34]$”. For the paths, you get the same thing, but they start and end with a slash (double slash, for the regex).

With this in place, we can start our backup. Create a new class and call it Backup.cs. Add this code to it:

class Backup
{
    private readonly FileFinder _fileFinder = new FileFinder();

    public async Task DoBackup(Config config, bool incremental)
    {
        var files = await _fileFinder.GetFiles(config.IncludePaths.ToArray(), 
               config.ExcludeFilesRegex, incremental);
        using (ZipFile zip = new ZipFile())
        {
            zip.UseZip64WhenSaving = Zip64Option.AsNecessary;
            foreach (var path in files)
                zip.AddFiles(path.Value, false, path.Key);
            zip.Save(config.BackupFile);
        }
        foreach (var file in files.SelectMany(f => f.Value))
            ResetArchiveAttribute(file);
        return 0;
    }

    public void ResetArchiveAttribute(string fileName)
    {
        var attributes = File.GetAttributes(fileName);
        File.SetAttributes(fileName, attributes & ~FileAttributes.Archive);
    }
}

This class uses a FileFinder class to find all files that match the pattern we want and creates a zip file. The GetFiles method from FileFinder returns a dictionary structured like this:

  • The key is a path related to the search path. As the paths can be on any disk of your system and they can have the same names (ex C:Temp and D:Temp), and that would not be ok in the zip file, the paths are changed to reflect the same structure, but their names are changed to allow to be added to the zip files. That way, if I am searching in C:Temp and in D:Temp, the keys for this dictionary would be C_DriveTemp and D_DriveTemp. That way, both paths will be stored in the zip and they wouldn’t clash. These keys are used to change the paths when adding the files to the zip
  • The value is a list of files found in that path

The files are added to the zip and, after that, their Archive bit is reset. This must be done, so the incremental backup can work in the next time: incremental backups are based on the Archive bit: if it’s set, the file was modified and it should be backed up. If not, the file was untouched. This is not a foolproof method, but it works fine for most cases. A more foolproof way to do this would be to keep a log file every full backup with the last modified dates of the files and compare them with the current file dates. This log should be updated every backup. For my case, I think that this is too much and the archive bit is enough.

The FileFinder class is like this one:

class FileFinder
{
    public async Task<ConcurrentDictionary<string, List>> GetFiles(string[] paths, 
        Regex regex, bool incremental)
    {
        var files = new ConcurrentDictionary<string, List>();
        var tasks = paths.Select(path =>
            Task.Factory.StartNew(() =>
            {
                var rootDir = "";
                var drive = Path.GetPathRoot(path);
                if (!string.IsNullOrWhiteSpace(drive))
                {
                    rootDir = drive[0] + "_drive";
                    rootDir = rootDir + path.Substring(2);
                }
                else
                    rootDir = path;
                var selectedFiles = Enumerable.Where(GetFilesInDirectory(path), f => 
                     !regex.IsMatch(f.ToLower()));
                if (incremental)
                    selectedFiles = selectedFiles.Where(f => (File.GetAttributes(f) & FileAttributes.Archive) != 0);
                files.AddOrUpdate(rootDir, selectedFiles.ToList(), (a, b) => b);
            }));
        await Task.WhenAll(tasks);
        return files;
    }

    private List GetFilesInDirectory(string directory)
    {
        var files = new List();
        try
        {
            var directories = Directory.GetDirectories(directory);
            try
            {
                files.AddRange(Directory.EnumerateFiles(directory));
            }
            catch
            {
            }
            foreach (var dir in directories)
            {
                files.AddRange(GetFilesInDirectory(Path.Combine(directory, dir)));
            }
        }
        catch
        {
        }

        return files;
    }
}

The main method of this class is GetFiles. It is an asynchronous method, I will create a new task for every search path. The result is a ConcurrentDictionary, and it has to be so, because there are many threads updating it at once and we could have concurrency issues. The ConcurrentDictionary handles locking when adding data from different threads.

The GetFilesInDirectory finds all files in one directory and, after all files are found, the data is filtered according to the Regex and, if the user asks for an incremental backup, the files are checked for their archive bit set. With this set of files, I can add them to the zip and have a backup file that can be read with standard programs.

Just one requirement remains: to have a scheduled backup. I could make the program stay in the system tray and fire the backup at the scheduled times, but there is an easier way to do it: use the Windows task scheduler. You just need to open a command prompt and type the command:

schtasks /create /sc daily /st "08:15" /tn "Incremental Backup" /t
r "D:ProjetosUtilsBackupDataBackupDatabinDebugBackupdata.exe -i"

That will create a scheduled task that will run the incremental backup every day at 8:15. The main program for this backup is very simple:

static void Main(string[] args)
{
    var options = new Options();
    CommandLine.Parser.Default.ParseArguments(args, options);
    if (string.IsNullOrWhiteSpace(options.ConfigFile))
        return;
    if (string.IsNullOrWhiteSpace(Path.GetDirectoryName(options.ConfigFile)))
    {
        var currentDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
        if (!string.IsNullOrWhiteSpace(currentDir))
            options.ConfigFile = Path.Combine(currentDir, options.ConfigFile);
    }
    var config = new Config(options.ConfigFile);
    var backup = new Backup();
    var result = backup.DoBackup(config, options.Incremental).Result;

}

I will parse the arguments, read and parse the config file, create the backup and exit. As you can see, the last line calls DoBackup.Result. This is because the Main method cannot be async and, if I just run it without calling async, it would not wait and would exit without running the backup. Calling result, the program will wait for the task completion.

Just one issue, here – if you wait for the task schedule to fire, you will see that a console window appears, and we don’t want that this happens while we are doing something else. One way to hide the console window is to go to the app properties and set the output type as a Windows application. That will be enough to hide the console window:

image

Conclusions

As you can see, it’s not too difficult to make a backup program using open source tools we have available. This program is very flexible, small and not intrusive. It can run anytime you want and have different configuration files. Not bad, huh?

The full source code for the project is in  https://github.com/bsonnino/BackupData

“Angular Routing” Problem Solver

This blog post supports the sample code for the “Angular Routing” course on Pluralsight, identifying common issues along with their solutions.

The content of this post is based on Angular version >= 2.x unless explicitly stated otherwise.

Nested Hyper-V Networking

As I was trying to configure a new lab setup that takes advantage of nested Hyper-V so that I can build a lab to do Hyper-V host clustering, I ran into a problem with networking. Everything looked good on the “host1” virtual machine, but the domain controller I created for TreyResearch.net that runs as a nested VM on host1 couldn’t connect to anything outside of host1. Which would end up being a pain fairly quickly. But after a good bit of poking around, I found the solution – either enable MAC Address Spoofing on host1, or configure a NAT switch on host1. For most of us, the MAC Address Spoofing is the simplest solution and works just fine. But if you’re in a public cloud scenario, you’ll likely have to go the NAT route.

To enable Nested Hyper-V, shutdown host1 and then run the following command on the top level host:

Set-VMProcessor -VMName host1 -ExposeVirtualizationExtensions $True

Start host1 and install the Hyper-V role with:

Install-WindowsFeature -Name Hyper-V -IncludeAllSubFeature -IncludeManagementTools

Once the reboots finish on host1, enable MAC Address Spoofing on the network adapter(s) of  host1:

Get-VMNetworkAdapter -VMName host1 | Set-VMNetworkAdapter -MacAddressSpoofing On

And you’re done.

ProfesiĂłn

El tĂ­tulo de este post está inspirado en un relato de Isaac Asimov, “Profession”. Más informaciĂłn en:

https://en.wikipedia.org/wiki/Profession_(novella)

Pueden leerla en:

http://www.inf.ufpr.br/renato/profession.html

Transcurre en el siglo LXVI (sesenta y seis), cuando la humanidad todavĂ­a ocupa la Tierra como planeta central, pero donde la actividad excitante está en los Mundos Exteriores. Los jĂłvenes se educan con “cintas” donde van aprendiendo sobre temas, antes de llegar a la “OlimpĂ­ada”, una competencia donde poner a prueba sus conocimientos, y son elegidos entocnes por distintos empleadores de los Mundos Exteriores, en base a su resultado.

George quiere ser programador de computadores, pero se le rechaza la oportunidad de estudiar y especializarse, aduciendo que su mente no es adecuada. Queda internado en un lugar, la Casa. Mientras, un compañero de estudios, estudia con la “cinta” y llega a la “OlimpĂ­ada”. George se escapa de la Casa, y al llegar a la ciudad de la “OlimpĂ­ada” se encuentra con este compañero, que se lamenta de no haber obtenido el mejor empleo posible, porque su “cinta” estaba desactualizada, y no trataba de los Ăşltimos modelos del espectrĂłgrafo Beechman.

Al final, George es encontrado (en realidad, siempre lo vigilaron) y luego de algunos pasos más, se le revela que fue apartado y ahora aprobado, para ser parte de otro grupo, desconocido. La Casa no es un lugar para inadaptados mentales, es un Instituto de Altos Estudios, donde la gente creativa se dedica a crear, a mejorar el conocimiento de la sociedad, no solo a aprender “cintas”. Alguien llamado Beechman tuvo que ser el inventor del espectrĂłgrafo Beechman, y no estudiĂł eso de una “cinta”.

Siempre me impresionó este relato, que habré leido hace unas décadas en el siglo pasado. En los ochenta, me encontré trabajando como pasante en una sucursal en Buenos Aires de una multinacional. En un piso, estaba el especialista en el Sistema Operativo X17, digamos. Sabía todo de eso, cómo instalar, que instalar, cómo corregir tal cosa; era el especialista preferido del tema. Estaba siempre ocupado, y reclamado desde otros paises incluso. Pero no sabía mucho más. Había entrado en el camino de la especialización.

No digo que “estĂ© mal”, pero no era eso lo que yo querĂ­a. Antes y despuĂ©s, en otros ámbitos, volvĂ­ a encontrar ese “sĂ­ndrome” de estudiar algo especializado. Desde entonces, he tratado de estudiar algo concreto pero siempre teniendo en el panorama el paisaje general, los fundamentos de algo, más que los detalles circunstanciales del momento. Además, nuestra profesiĂłn está signada por el cambio permanente, asĂ­ que veo interesante tener siempre en vista el aspecto general de algo, más allá de las “technicalities” del framework, lenguaje o librerĂ­a de moda.

De ahí que rara vez me especialicé en algo, con la SuperLibrary 17.2, o el MegaFramework MVC 18.2. Prefiero entender las fuerzas, contexto, casos de uso de esa librería, antes que los métodos detallados. Prefieron conocer por qué adoptamos MVC en estos tiempos, o modelos similares, y luego ver de aplicar eso en cada caso.

Hay un caso concreto actual, del camino estudio algo especializado, sin ver lo general. Lo noto en “machine learning”. Muchos quieren aprender TensorFlow o algĂşn framework en particular de redes neuronales, sin tomarse el trabajo de aprender los fundamentos de los distintos “approaches” que hoy tenemos en “machine learning”. Hay que estudiar algoritmos genĂ©ticos, redes neuronales, árboles de decisiĂłn, distintos algoritmos de clasificaciĂłn, y hasta recordar los sistemas expertos y la historia de la “inteligencia artificial”, para realmente comenzar a entender y poder tomar decisiones y extender todo lo que hay para hacer en “machine learning”.

Nos leemos!

Angel “Java” Lopez
http://www.ajlopez.com

 

 

“Toymaster” has released Security Mailer Volume 17 Number 7

Security Mailer V17 #7

  • Adobe updates for Flash Player and Shockwave
  • Cisco Security Advisories
  • Open Source updates for BIND and Open SSL, Linux updates
  • Microsoft – no updates for February + 0-day for Windows

How to Change Text Size for Message Boxes in Windows 10

A message box is a predefined dialog box that displays application-related information to the user. Message boxes are also used to request information from the user.

This tutorial will show you how to change the font size of text for message boxes to what you want for your account in Windows 10.

Read more…

How to Change Text Size for Tooltips in Windows 10

A tooltip is a small pop-up that displays the label of an unlabeled control or glyph in Windows.

This tutorial will show you how to change the font size of text for tooltips to what you want for your account in Windows 10.

Read more…

Building a Lab in Hyper-V with PowerShell, Part 3

Creating VMs with New-myVM.ps1 – Part 2

So, as I showed in the previous post, I’ve got my new VM built, but it’s not really ready for use yet. For one thing, it needs a DVD attached and the boot order set, plus I want to add a second NIC, and change the number of processors assigned to it. First, setting up the memory, processors, static MAC address for the NIC and configuring the DVD if we’re booting from DVD. (Which, I admit, I don’t often do. Mostly I copy over a SysPrep’d VHDX file.)

To do this, I have a function, of course, called Set-myVMConfig, to do most of it, and a separate one that I use to configure the second NIC, Add-myNetAdapter

Function Set-myVMConfig {
   Write-Verbose "Setting Processor Count to 4 for $VMName"
   Set-VMProcessor      -VMName $VMName -Count 4
   Write-Verbose "Enabling Dynamic Memory"
   Set-VMMemory         -VMName $VMName -DynamicMemoryEnabled $True
   Write-Verbose "Assigning static MAC address of $MacAdd"
   Get-VMNetworkAdapter -VMName $VmName `
      | Set-VMNetworkAdapter -StaticMacAddress "$MacAdd"
   if ($DVD) {
      Write-Verbose "Building from DVD, so adding DVD drive, and configuring boot order"
      if (! $client) { 
         Add-VMDvdDrive -VMName $VmName
         Set-VMDvdDrive -VMName $VmName  -Path $ServerISO 
         $vmDVD     = Get-VMDvdDrive -VMName $VmName
         $vmDrive   = Get-VMHardDiskDrive -VMName $VmName 
         Set-VMFirmware -VMName $VmName  -FirstBootDevice $vmDVD 
         Set-VMFirmware -VMName $VmName -BootOrder $vmDVD,$vmDrive
      } else {
         Add-VMDvdDrive -VMName $VmName
         Set-VMDvdDrive -VMName $VmName -Path $ClientISO 
         $vmDVD     = Get-VMDvdDrive -VMName $VmName
         $vmDrive   = Get-VMHardDiskDrive -VMName $VmName 
         Set-VMFirmware -VMName $VmName   -FirstBootDevice $vmDVD 
         Set-VMFirmware -VMName $VmName   -BootOrder $vmDVD,$vmDrive
      }
   }
}

This sets the # of processors to 4, enables dynamic memory, sets a static MAC address on the first NIC, adds a DVD drive if appropriate, and sets the boot order to boot from the specified ISO file.

Almost done – now, all we need to do is add a second network adapter, and set it to a fixed MAC address as well.

Function Add-myNetAdapter {
   Write-Verbose "Adding second network adapter"
   Add-VmNetworkAdapter -VMName $VmName `
                        -SwitchName '199 Network' `
                        -StaticMacAddress "$199MacAdd" `
                        -Name '199 Ethernet'
}

Now, that we have all the functions, all we need to do is execute them, and that all happens with:

If (! ( Get-VM -Name $VmName -ErrorAction Continue 2>$NULL) ) {
   Test-SourcePath
   Test-Clean
   Copy-myVHD -wait
   Write-Verbose "VHD's copied if we were doing that, now creating the VM..."
   Create-myVM
   Write-Verbose "VM Created"
   $myVM = Get-VM -VMName $VMName
}
Set-myVMConfig
Add-myNetAdapter
$myVM | Format-List

And, since this whole thing has been broken up across a couple of posts, here’s the whole script, including full Get-Help support.

<# 
.Synopsis
    Creates a new VM
.Description
    New-myVM and New-myClientVM make a new VM of Name $1 and MAC Address in the $MacBase 
    range of MAC addresses. If the command is run as New-myClientVM, then the -Client 
    parameter is assumed unless overridden at the command line. 
.Example 
   New-myVM -VMName Trey-DC-02 02
   Creates a new Server VM of name "Trey-DC-02" in the default MAC address range
   with the "02" as the final octet of MAC address. 
.Example 
   New-myVM -Name trey-client-22 -MacFinal 16 -DVD -Client $True
   Creates a new Client VM of name "trey-client-22" in the default MAC address range
   with 16 as the final octet of MAC address. The VM is installed from the default 
   Server 2016 DVD. 
.Example 
   New-myVM Trey-DC-02 02 -DVD
   Creates a new Server VM of name "Trey-DC-02" in the default MAC address range
   with the "02" as the final octet of MAC address. The VM is installed from the 
   default Server 2016 DVD. 
.Example
    New-myVM -VmName "Trey-WDS-11" -MacFinal "0B" -MacBase "00-15-5D-32-64-"
    Creates a new Server VM of name Trey-WDS-11 in a non-default MAC address range. 
.Example
   New-myClientVM -Name trey-client-01 
   Creates a new Windows 10 client VM, 'trey-client-01' using the default VHD, and 
   will prompt for the final 2 digits of the MAC address. 
.Example
   New-myVM -Name trey-client-01 -MACFinal 65 -Client $True -Source 'V:Source' -Path 'Y:'
   Creates a new Windows 10 client VM, 'trey-client-01' using the sysprep'd image at V:Source, 
   and creating the VM at Y:trey-client-01. The final two digits of the MAC address will 
   be 65. 
.Parameter VmName
   The name of the new VM
.Parameter MacFinal
   The last two digits in the MAC address of the VM
.Parameter MacBase
   The base MAC address for this VM. The default base is  "00-15-5D-32-10-"  
.Parameter DVD
   A switch that controls whether a DVD is added to the VM and used to mount an ISO for the 
   install. The default is to build the VM with no DVD drive. 
.Parameter Client
  A Boolean. When run as New-myVM, $Client defaults to False. If run as New-myClientVM, 
  the default is true. In either case, the command line parameter overrides the default. 
.Parameter Path
   The target path for the virtual machine. Default is to V:. This is the base path, to 
   which the VMName is added to build the final path.
.Parameter Source
   The source path of the DVD or VHD used to build the virtual machine. Default is V:Source. 
.Parameter vmSwitch
   The Hyper-V network switch to connect the VM to. New-myVM creates two network adapters. 
   One is connected to the 199 Network, and the second is controlled by the vmSwitch parameter. 
   The default is "Local-10", the internal lab switch. 
.Parameter 2012R2
   The 2012R2 switch specifies the use of the Server 2012 R2 image. 
.Inputs 
    [string]
    [string]
    [string]
    [switch]
    [Boolean]
    [string]
    [string]
    [string]
.Notes
    Author: Charlie Russel
 Copyright: 2017 by Charlie Russel
          : Permission to use is granted but attribution is appreciated
   ModHist: 1/1/2014 Initial
          : 1/31/2015 Mod for new parameter handling and comment header
          : 3/20/2015 Mod to use Sysprepped VHD and -10 MAC
          : 4/19/2015 Mod for verbose and running in a wrapper
          : 5/16/2016 Mod for new labhost 
          : 9/24/2016 Mod for New-myClientVM
          : 12/21/2016 Added additional parameters, updated help. (cpr)
          : 02/17/2017 Fixed problem with DVD and Gen2, updated help. (cpr)
#>

[CmdletBinding()]
Param ([Parameter(Mandatory = $True,Position = 0)][alias("Name")][string]$VmName,
       [Parameter(Mandatory = $True,Position = 1)][alias("Final")][string]$MacFinal,
       [Parameter(Mandatory = $False)][alias("Base")][string]$MacBase = "00-15-5D-32-0A-",
       [Parameter(Mandatory = $False)][string]$199MacBase = "00-15-5D-32-CE-",
       [Parameter(Mandatory=$False)][Switch]$DVD,
       [Parameter(Mandatory=$False)][Boolean]$Client=($myInvocation.myCommand.Name -match "Client"),
       [Parameter(Mandatory=$False)][alias("Target")][string]$Path = "V:",
       [Parameter(Mandatory=$False)][alias("VHDSource","DVDBase")][string]$Source = "V:Source",
       [Parameter(Mandatory=$False)][alias("LocalSwitch","Network")][string]$vmSwitch = "Local-10",
       [Parameter(Mandatory=$False)][switch]$2012R2
       )

$MacAdd = $MacBase + $MacFinal
$199MacAdd = $199MacBase + $MacFinal
Write-Verbose "MacFinal is $MacFinal" 
Write-Verbose "MacAdd is $MacAdd on switch $vmSwitch" 
Write-Verbose "VMName is $VMName"
Write-Verbose "Client is $Client"
Write-Verbose "Path is $Path, Source is $Source, and 199 MAC address is $199MacBase + $MacFinal"
Write-Verbose "Sleeping for 5 seconds to give you a chance to exit..."
sleep 5

$VMBase     = "$Path$VMName"
$VHDSource  = $Source
$DVDBase    = $Source
$VHDBase    = "$VMBaseVirtual Hard Disks"
$SysVHD     = "$VMBaseVirtual Hard Disks$VmName-System.vhdx"
$MachineBase= "$VMBaseVirtual Machines"
$ServerISO  = "$DVDBaseen_windows_server_2016_x64_dvd_9718492.iso"
$ClientISO  = "$DVDBaseen_windows_10_enterprise_version_1607_updated_jan_2017_x64_dvd_9714415.iso"
$ClientVHD  = "$SourceGeneralized-client.vhdx"
if ($2012R2) { 
   $ServerVHD = "$SourceGeneralized-2012R2.vhdx"
} else {
   $ServerVHD  = "$SourceGeneralized-System.vhdx"
}

Function Test-SourcePath () {
   if ($Client) {
      if ($dvd) {
         if (Test-Path $ClientISO) {
            Write-Verbose "Install DVD found at $ClientISO"
         } else {
            Throw "Client ISO not found at $ClientISO" 
         }
      } elseif (Test-Path $ClientVHD) { 
         Write-Verbose "Source VHD found at $ClientVHD"
      }
   } else {
      if ($dvd) {
         if (Test-Path $ServerISO) {
            Write-Verbose "Install DVD found at $ServerISO"
         } else {
            Throw "Server ISO not found at $ServerISO" 
         }
      } elseif (Test-Path $ServerVHD) { 
         Write-Verbose "Source VHD found at $ServerVHD"
      }
   }
}

if (! (Test-Path $VHDBase ) ) { 
   mkdir $VHDBase
}
if (! (Test-Path $MachineBase ) ) { 
   mkdir $MachineBase
}

Function Test-Clean () {
   If (Test-Path $VHDBase*.vhdx ) {
      Throw "Found an existing VHD. Please clean up the target path and try again."
   }
}

function Copy-myVhd () {
      if ( $DVD ) {
         Write-Verbose "DVD specified. Not copying source VHD to $SysVHD"
      } else { 
         if ( $Client ) { 
            Write-Verbose "Creating VM from Sysprep'd VHD base $ClientVHD"
            cp $ClientVHD $SysVHD 
         } else { 
         Write-Verbose "Creating VM from Sysprep'd VHD base $ServerVHD"
            cp $ServerVHD $SysVHD
         } 
      }
}

function Create-myVM () { 
if ($DVD ) { 
  Write-Verbose "Creating $vmname from DVD with the following command:"
  Write-Verbose "New-VM -Name $VmName -MemoryStartupBytes 1024MB -BootDevice VHD -Generation 2 -SwitchName $vmSwitch -NewVHDPath $SysVHD -NewVHDSize 200GB -Path $MachineBase "
  Sleep 3
  New-VM -Name $VmName `
       -MemoryStartupBytes 1024MB `
       -BootDevice VHD `
       -Generation 2 `
       -SwitchName $vmSwitch `
       -NewVHDPath $SysVHD `
       -NewVHDSize 200GB `
       -Path $MachineBase
} else { 
  New-VM -Name $VmName `
       -MemoryStartupBytes 1024MB `
       -BootDevice VHD `
       -Generation 2 `
       -SwitchName $vmSwitch `
       -VHDPath $SysVHD `
       -Path $MachineBase
  }
}

Function Set-myVMConfig {
   Write-Verbose "Setting Processor Count to 4 for $VMName"
   Set-VMProcessor      -VMName $VMName -Count 4
   Write-Verbose "Enabling Dynamic Memory"
   Set-VMMemory         -VMName $VMName -DynamicMemoryEnabled $True
   Write-Verbose "Assigning static MAC address of $MacAdd"
   Get-VMNetworkAdapter -VMName $VmName `
      | Set-VMNetworkAdapter -StaticMacAddress "$MacAdd"
   if ($DVD) {
      Write-Verbose "Building from DVD, so adding DVD drive, and configuring boot order"
      if (! $client) { 
         Add-VMDvdDrive -VMName $VmName
         Set-VMDvdDrive -VMName $VmName  -Path $ServerISO 
         $vmDVD     = Get-VMDvdDrive -VMName $VmName
         $vmDrive   = Get-VMHardDiskDrive -VMName $VmName 
         Set-VMFirmware -VMName $VmName  -FirstBootDevice $vmDVD 
         Set-VMFirmware -VMName $VmName -BootOrder $vmDVD,$vmDrive
      } else {
         Add-VMDvdDrive -VMName $VmName
         Set-VMDvdDrive -VMName $VmName -Path $ClientISO 
         $vmDVD     = Get-VMDvdDrive -VMName $VmName
         $vmDrive   = Get-VMHardDiskDrive -VMName $VmName 
         Set-VMFirmware -VMName $VmName   -FirstBootDevice $vmDVD 
         Set-VMFirmware -VMName $VmName   -BootOrder $vmDVD,$vmDrive
      }
   }
}

Function Add-myNetAdapter {
   Write-Verbose "Adding second network adapter"
   Add-VmNetworkAdapter -VMName $VmName `
                        -SwitchName "199 Network" `
                        -StaticMacAddress "$199MacAdd" `
                        -Name "199 Ethernet"
}

If (! ( Get-VM -Name $VmName -ErrorAction Continue 2>$NULL) ) {
   Test-SourcePath
   Test-Clean
   Copy-myVHD -wait
   Write-Verbose "VHD's copied if we were doing that, now creating the VM..."
   Create-myVM
   Write-Verbose "VM Created"
   $myVM = Get-VM -VMName $VMName
}
Set-myVMConfig $myVM
Add-myNetAdapter $myVM
$myVM | Format-List

I hope you find this script useful, and I’d love to hear comments, suggestions for improvements, or bug reports as appropriate. As always, if you use this script as the basis for your own work, please respect my copyright and provide appropriate attribution.

 

Next up in the Building a Lab with PowerShell series will how to configure your DHCP server with PowerShell. This will take advantage of the fixed MAC addresses I create for all my lab machines and use these to populate DHCP Reservations.

Recent Comments

Archives