Install FreeFileSync 11.18 on Ubuntu 20.04

 

FreeFileSync is a useful multi-platform application that helps us to synchronize our files and folder across various devices. It creates the backup of our data on the local system or any external device.

I'm not sure if FreeFileSync is not available from the Ubuntu 20.04 standard repository. However, its source tarball is available from the official webpage. As of preparing this guide, the latest FreeFileSync version is 11.18.

Installing FreeFileSync on Ubuntu 20.04


Step 1 - Download from official website - https://freefilesync.org

Download

Step 2 - Extract tarball

After successfully downloading the FreeFileSync tarball, navigate to the ‘Downloads’ directory, and extract the tarball with tar the command:

sudo tar -zxvf FreeFileSync_11.5_Linux.tar.gz

You will have this file now:


Run this command line:

sudo ./FreeFileSync_11.18_Install.run 

this will appear:



Instalation done!


Creating VMware Snapshots with PowerCLI

This is - Getting started with PowerShell and VMware vSphere - Part 1



Creating a snapshot, is a trivial and needed task most of the time. It is a very good idea to have it prior some changes in a virtual host.

    To create it, the virtual machine can be on or off. Also the snapshot will be created using that state. This might be important because if you roll back a running virtual machine to a snapshot where the virtual machine was stopped, the virtual machine will be stopped.     You will use the New-Snapshot cmdlet.

    When we create the snapshot you will need to give it a name... Also a good idea to provide a description. If the virtual machine is running, we can also elect to save the memory state as well with the –Memory parameter. Moreover, if the it has virtual tools installed, we can opt for a quiescent snapshot with –Quiesce

    This has the effect of saving the virtual disk in a consistent state. That is, the snapshot occurs without the operating system in the middle of trying to write something to disk. Personally, I remember to have less problems restoring a snapshot with –Quiesce, although there is a slight trade-off....  time it takes to create the snapshot. In fact, because a snapshot can take a few minutes to create, you may want to create it in the background on the VMware host using –RunAsycn.

2 ways I have tested:

  • New-Snapshot -VM MACHINE-NAME -Name 'NAME OF SNAP' -Description 'This is a test powershell snapshot' -Quiesce -Memory
  • Get-Vm MACHINE-NAME | New-Snapshot -Name "NAME OF SNAP" -Description 'This is a test powershell snapshot' -Quiesce -Memory


    Now, the beauty of scripting.... Naturally, if we can do it for one VM, we can do it for many :-)

Get-Vm MACHI* | new-snapshot -name "NAME OF SNAP" -Description "Created $(Get-Date) powershell" -Quiesce -Memory –RunAsync

    This will trigger a snapshot of all virtual machines which have names starting with MACHI*

Listing Snapshots

    To enumerate snapshots, just use Get-Snapshot. The snapshots are associated with the virtual machine, so you’ll need to specify one or we can use wildcards:

Get-Snapshot -vm MACHINE-NAME


Now that we have names, we can also get relevant information about the snap:

 Get-Snapshot -vm MACHINE-NAME -name SNAP-NAME | select *


Restoring from a Snapshot

To restore, we will use the Set-VM cmdlet. 
1st thing to do, assing the snap you want to a variable:

$snap = Get-Snapshot -vm MACHINE-NAME -name SNAP-NAME

Now we can easily use Set-VM to revert:

set-vm -VM MACHINE-NAME -Snapshot $snap -whatif




*Use -whatif to discover guess what? "What if" you ran that command what actions will take course. 

Removing Snapshots 

    Periodically you may want to clean up old snapshots using Remove-Snapshot. The easiest way is to get the snapshot or snapshots and pipe them to Remove-Snapshot. Some snapshots may have child snapshots so use –RemoveChildren to clean as well.

Get-Snapshot -name SNAP-NAME -VM MACHINE-NAME | remove-snapshot


    Now, imagine, we have multiple virtual machines with snapshots on that use the same name. We can use wildcards of course... be aware that this action would take some time to complete.... so let's running it asynchronously :-)

Get-Snapshot -name SNAP-NAME -vm * | remove-snapshot -RemoveChildren -RunAsync





If you lost howto install click here



Next topic will be New-VM.


=======================================================================

"Do you already know my Linux training !?" Available in portuguese only.


"Você já conhece meu treimanento de linux!?"

Neste treinamento vamos abordar de forma simples, rápida e sem “enrolação”  como instalar o Linux CentOS 8 utilizando o VirtualBox e a nuvem da Amazon AWS do zero.



Getting started with PowerShell and VMware vSphere



VMware provides PowerCLI which is a set of modules for VMware vSphere. Now I bring to you old news.... you should know that PowerShell is a powerful scripting language.... Initially, PowerShell enabled to manage only Windows Workstation or Server, but since sometimes, a lot of vendors make their own modules to manage their solutions (such as Veeam, VMware and so on....). PowerShell is available on Linux as well.

Install or update PowerCLI

Very simple instalation... just install the module and go:

To install PowerCli from the PowerShell gallery you need Internet Access. Then run:

Install-Module -Name VMware.PowerCLI 


If you have already installed PowerCLI from the PowerShell gallery, you can run the following command:

Update-Module -Name VMware.PowerCLI


When PowerCLI is instalation is over, you can run: You can see that 922 cmdlet exists for VMware vSphere. That’s a lot!


Get-Command -module *VMware* | measure




Attention:
You need PowerShell v5 at least. If you are not using Windows 10 or Windows Server 2016, you can install the latest 
Windows Management Framework.


Connect to VMware vCenter


To manage VMware vSphere you have to connect to VMware vCenter. First, run a Get-Credential to store in variable credentials to connect to vCenter. Then run the following command:

Connect-VIServer -Server <vCenter FQDN> -Credential <Credential variable>


$admin_credential = Get-Credential
Connect-VIServer -Server your_server.you-domain.com -Credential $admin_credential



Also you can run for example:

Get-VM |ft Name, Guest, VMHost, PowerState



Of course you can combine versatilitie of powershell with 911  cmdlet exists for VMware vSphere to do a lot of things....

:-)





Breaking Linux files into pieces

 


  

  Simple Linux commands allow you to break up files and reassemble them as needed in order to accommodate size restrictions.



    Linux provide a very easy-to-use command for breaking files into pieces. This is something that you might need to do prior to uploading your files to some storage site that limits file sizes or emailing them as attachments. To split a file into pieces, you simply use the split command.

$ split filename

By default, the split command uses a very simple naming scheme. The file chunks will be named xaa, xab, xac, etc., and, presumably, if you break up a file that is sufficiently large, you might even get chunks named xza and xzz.dsc

You can also contribute to the file naming by providing a prefix. For example, to name all the pieces of your original file bigfile.xaa, bigfile.xab and so on, you would add your prefix to the end of your split command like so:

image

Note that a dot is added to the end of the prefix shown in the above command. Otherwise, the files would have names like bigfilexaa rather than bigfile.xaa.

Also, note that the split command does not remove your original file, just creates the chunks. If you want to specify the size of the file chunks, you can add that to your command using the -b option. For example:

split -b100M your_file

If you want your file to be split based on number of bytes, you can use the -b option. In this example, each file will 50b chuncks.

$ split --verbose -b50K zip zip.
creating file 'zip.aa'
creating file 'zip.ab'
creating file 'zip.ac'

If you need to reassemble your file from pieces on a remote site, you can do that fairly easily using a cat command like one of these:


cat x?? > original.file
cat log.?? > original.file


"Do you already know my Linux training !?" Available in portuguese only.


"Você já conhece meu treimanento de linux!?"

Neste treinamento vamos abordar de forma simples, rápida e sem “enrolação”  como instalar o Linux CentOS 8 utilizando o VirtualBox e a nuvem da Amazon AWS do zero.



Query BitLocker status on remote machines

    This PowerShell script will remotely query each machines found in the specified answer file (using manage-bde.exe) to determine if BitLocker protection is ON or OFF.  Results will be saved to a CSV file. Very useful trick if you not have a specialized tool for. Just change the necessary variables and run...

    This is a very easy and simple script to use across your environment using manage-bde command line tool.

* You need to run as Admin 

# bitlocker status
$TextFilePath = Read-Host "What is the path to the text file?"
If (Test-Path $TextFilePath){
    $ComputersArray = Get-Content $TextFilePath
    $ComputerStatusCol = @()
ForEach ($Computer in $ComputersArray) {
        If (Test-Connection $Computer -Count 1){
            $ComputerStatus = manage-bde -status -cn "$Computer" 
            $ComputerStatusCol += $ComputerStatus
        } Else {
            Write-Host("$Computer appears to be offline.")
        }
    }
    $ComputerStatusCol | Out-File -filepath "c:\utils\Bitlocker-Status.txt" -append -force
Else {
    Write-Error "The text file was not found, check the path."
}


Visit my Powershell GitHub repository and contribute if you want... :-)
look for query_bitLocker.ps1

You need to insert the local path for a answer file with machines name to scan. After run on all machines, script will write data to a Out-File.  If you want to append data to this file instead of cleanning every time, do not forget to use -append -force


How to use it??




Liked !? Leave your comment !!

Do you know my linux Essentials course??

Disclaimer
    The sample scripts are not supported under any Microsoft standard support program, service or even by me. The sample scripts are provided AS IS without warranty of any kind. Use on your own risk.

(fim) Horário de Verão 2019.



O horário de verão foi inicialmente adotado para aproveitar a iluminação natural no fim da tarde, quando o consumo de energia "era" mais alto. Porém na atualmente isto deixou de ser relevante.

O governo determinou que este ano não haverá horário de verão.

Sendo assim, os relógios não serão adiantados em 1 hora conforme ocorreu ano passado (2018) e nos últimos 34 anos.

Bom para alguns, nem tão bom assim para outros, mas para os administradores de TI esse tipo de alteração sempre gera uma certa preocupação...
Ocorre que nos sistemas operacionais (neste caso em específico microsoft windows) já estão pré-configurados para adiantarem automaticamente seus relógios devido aos ciclos anteriores de atualização.


Para alterarmos isso, será necessário atualiza-los com updates da Microsoft que removem a configuração de horário de verão.

Atenção 1:

A Microsoft em seu update de julho-2019 incluiu a desativação do horário de verão.

Atualização: kb4507704
Versão suportada: Windows Server 2008, 2008 R2, 2012, 2012 R2, Windows 7, 8, 8.1
Download em: https://www.catalog.update.microsoft.com/Search.aspx?q=4507704

Atualização: kb4507459
Versão do Sistema Operacional: Windows Server 2016, Windows 10
Download em: https://www.catalog.update.microsoft.com/Search.aspx?q=4507459


Atenção 2:

  1. Caso os hosts estejam desatualizados a há muito tempo pode ser que ainda tenham a configuração de 2017/2018 e a alteração ocorrerá dia 20 de Outubro ao invés de 3 de Novembro.
  2. As atualizações do Windows Server 2012 R2 e 8.1 não exigem reinicialização. Para as atualizações do Windows 10 e Server 2016 exigem a reinicialização do sistema.

Dica para atualização em massa.



Caso você não tenha um SCCM ou um WSUS ou qualquer outra ferramenta de gerenciamento de atualizações, você pode utilizar o Power Shell para isso! Veja como aqui!






What is Umask and how to setup - mini guide


What is Umask and how to setup


When user create a file or directory under Linux or UNIX, it is create it with a default set of permissions. In most case the system defaults may be open or relaxed for file sharing purpose. For example, if a text file has 666 permissions, it grants read and write permission to everyone. Similarly a directory with 777 permissions, grants read, write, and execute permission to everyone.

Default umask Value

    The user file-creation mode mask (umask) is use to determine the file permission for newly created files. It can be used to control the default file permission for new files. It is a four-digit octal number. A umask can be set or expressed using:

  • Symbolic values
  • Octal values

Procedure To Setup Default umask

You can setup umask in /etc/bashrc or /etc/profile file for all users. By default most Linux distro set it to 0022 (022) or 0002 (002). Open /etc/profile or ~/.bashrc file, enter:

# vi /etc/profile

OR

$ vi ~/.bashrc

Append/modify following line to setup a new umask:

umask 022

Save and close the file. Changes will take effect after next login only. All UNIX users can override the system umask defaults in their /etc/profile file, ~/.profile (Korn / Bourne shell) ~/.cshrc file (C shells), ~/.bash_profile (Bash shell) or ~/.login file (defines the user’s environment at login).

Octal umask Mode 022 And 002

If the default settings are not changed, files are created with the access mode 666 and directories with 777. In this example:

  1. The default umask 002 used for normal user. With this mask default directory permissions are 775 and default file permissions are 664.

  2. The default umask for the root user is 022 result into default directory permissions are 755 and default file permissions are 644.

  3. For directories, the base permissions are (rwxrwxrwx) 0777 and for files they are 0666 (rw-rw-rw).

Then,

  1. A umask of 022 allows only you to write data, but anyone can read data.

  2. A umask of 077 is good for a completely private system. No other user can read or write your data if umask is set to 077.

A umask of 002 is good when you share data with other users in the same group. Members of your group can create and modify data files; those outside your group can read data file, but cannot modify it. Set your umask to 007 to completely exclude users who are not group members.

But, How Do I Calculate umasks?

The octal umasks are calculated via the bitwise AND of the unary complement of the argument using bitwise NOT. The octal notations are as follows:

  • Octal value : Permission

  • 0 : read, write and execute

  • 1 : read and write

  • 2 : read and execute

  • 3 : read only

  • 4 : write and execute

  • 5 : write only

  • 6 : execute only

  • 7 : no permissions

Now, you can use above table to calculate file permission. For example, if umask is set to 077, the permission can be calculated as follows:

To set the umask 077 type the following command at shell prompt:

$ umask 077
$ mkdir dir1
$ touch file
$ ls -ld dir1 file


Sample outputs:

drwx------ 2 vivek vivek 4096 2011-03-04 02:05 directoryx

-rw------- 1 vivek vivek    0 2011-03-04 02:05 filenumber1

Sample: Calculating The Final Permission For FILES

You can simply subtract the umask from the base permissions to determine the final permission for file as follows:

666 – 022 = 644

  • File base permissions : 666
  • umask value : 022
  • subtract to get permissions of new file (666-022) : 644 (rw-r–r–)

Sample: Calculating The Final Permission For DIRECTORIES

You can simply subtract the umask from the base permissions to determine the final permission for directory as follows:

777 – 022 = 755

  • Directory base permissions : 777
  • umask value : 022
  • Subtract to get permissions of new directory (777-022) : 755 (rwxr-xr-x)

How Do I Set umask Using Symbolic Values?

The following symbolic values are used:

  1. r : read

  2. w : write

  3. x : execute

  4. u : User ownership (user who owns the file)

  5. g : group ownership (the permissions granted to other users who are members of the file’s group)

  6. o : other ownership (the permissions granted to users that are in neither of the two preceding categories)

The following command will set umask to 077 i.e. a umask set to u=rwx,g=,o= will result in new files having the modes -rw——-, and new directories having the modes drwx——:

$ umask u=rwx,g=,o=
$ mkdir dir2
$ touch file2
$ ls -ld dir2 file2

Sample umask Values and File Creation Permissions
all = read, write and executable file permission

Limitations of the umask

  1. The umask command can restricts permissions.

  2. The umask command cannot grant extra permissions beyond what is specified by the program that creates the file or directory. If you need to make permission changes to existing file use the chmod command.

umask and level of security

The umask command be used for setting different security levels as follows:



"Você já conhece meu treimanento de linux!?"

Neste treinamento vamos abordar de forma simples, rápida e sem “enrolação”  como instalar o Linux CentOS 8 utilizando o VirtualBox e a nuvem da Amazon AWS do zero.

"Do you already know my Linux training !?" Available in portugues only.