package management – ubuntu 16.04.07 trying to overwrite ‘/etc/dhcp/dhclient-exit-hooks.d/google_set_hostname (error while upgrading the GCP ubuntu 16.04 )

**
I was trying to upgrade ubuntu but getting this while running command ( sudo apt-get update && sudo apt-get upgrade -f)

Do you want to continue? (Y/n) Y Get:1 http://europe-west4-b.gce.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 google-compute-engine all 20201222.00-0ubuntu216.04.0 (12.9 kB) Fetched 12.9 kB in 0s (44.1 kB/s) (Reading database … 175234 files and directories currently installed.) Preparing to unpack …/google-compute-engine_20201222.00-0ubuntu216.04.0_all.deb … Unpacking google-compute-engine (20201222.00-0ubuntu216.04.0) … dpkg: error processing archive /var/cache/apt/archives/google-compute-engine_20201222.00-0ubuntu216.04.0_all.deb (–unpack): trying to overwrite ‘/etc/dhcp/dhclient-exit-hooks.d/google_set_hostname’, which is also in package gce-compute-image-packages 20201222.00-0ubuntu216.04.0 Errors were encountered while processing: /var/cache/apt/archives/google-compute-engine_20201222.00-0ubuntu216.04.0_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

**

Basic java text-based management game

In a few hours I threw together this little text-based java game. Pretty much you’re managing a forest and have to try and keep it together while keeping enough of a profit to move forward.

package com.company;

import java.util.Arrays;
import java.util.Scanner;
import java.util.concurrent.ThreadLocalRandom;

import static java.lang.Integer.parseInt;

public class Main {

    static int gold = 60, trees = 15, unr_trees = 0, r_trees = 0, fertilizer = 1, animal_protection = 0;

    static int refinesLeftThisTurn;

    static int turn = 1, actionsUsedThisTurn = 0;

    static int wildlifeProtection;

    public static void main(String() args) {
        cls();
        System.out.println("Treemnger:nn");
        game();
    }

    public static void game() {
        boolean endCommand = false;
        Scanner s = new Scanner(System.in);

        while (true) {
            endCommand = false;
            refinesLeftThisTurn = 10;
            actionsUsedThisTurn = 0;
            System.out.println("Turn: " + turn);

            System.out.println("n");
            while (!endCommand) {
                System.out.println("Enter a command (type 'help' for list)");
                String commandEntered = s.nextLine();

                String() splitCommand = commandEntered.split(" ");

                String command = splitCommand(0);
                String() subcommands = Arrays.copyOfRange(splitCommand, 1, commandEntered.length());

                switch (command.toLowerCase()) {
                    case "help":
                        System.out.println("Commands: 'help', 'resources', 'chop', 'sell', 'refine', 'buy', 'use', 'clear', 'end'");
                        endCommand = false;
                        break;

                    case "resources":
                        printResources();
                        endCommand = false;
                        break;

                    case "chop":
                        if (subcommands(0) != null) {
                            if (trees - parseInt(subcommands(0)) >= 0) {
                                trees -= parseInt(subcommands(0));
                                unr_trees += parseInt(subcommands(0));
                                if (rng(1, 30) == 1) {
                                    System.out.println("Lucky! You got 5 extra wood!");
                                    unr_trees += 5;
                                }

                            } else {
                                System.out.println("You need more trees!");
                                break;
                            }
                        } else {
                            System.out.println("Please provide number of trees to be cut, e.g. 'chop 3'.");
                            break;
                        }
                        endCommand = false;
                        actionsUsedThisTurn++;
                        break;

                    case "sell":
                        if (subcommands(0) == null) {
                            System.out.println("Please provide the type of wood to sell!");
                            break;
                        }
                        if (subcommands(1) == null || NotIntString(subcommands(1))) {
                            System.out.println("Please provide the amount of wood to sell!");
                            break;
                        }

                        switch (subcommands(0)) {
                            case "unrefined":
                                if (unr_trees - parseInt(subcommands(1)) >= 0) {
                                    unr_trees -= parseInt(subcommands(1));
                                    gold += rng(4, 6) * parseInt(subcommands(1));

                                } else {
                                    System.out.println("You need more unrefined logs!");
                                }
                                break;
                            case "refined":
                                if (r_trees - parseInt(subcommands(1)) >= 0) {
                                    r_trees -= parseInt(subcommands(1));
                                    gold += rng(13, 17) * parseInt(subcommands(1));
                                } else {
                                    System.out.println("You need more refined logs!");
                                }
                                break;
                            default:
                                System.out.println("Please specify either 'unrefined' or 'refined' logs.");
                                break;
                        }
                        actionsUsedThisTurn++;
                        break;

                    case "refine":
                        if (refinesLeftThisTurn < 0) {
                            System.out.println("You cannot refine any more times this turn! Wait till next turn to regain your 10 refines!");
                        }
                        if (subcommands(0) == null) {
                            System.out.println("Please provide the amount of wood to refine!");
                            break;
                        }

                        if (unr_trees - parseInt(subcommands(0)) >= 0 || gold - (parseInt(subcommands(0)) * 5) >= 0) {
                            unr_trees -= parseInt(subcommands(0));
                            r_trees += parseInt(subcommands(0));
                            gold -= parseInt(subcommands(0)) * 5;
                            refinesLeftThisTurn -= parseInt(subcommands(0));
                        }
                        actionsUsedThisTurn++;
                        break;

                    case "buy":
                        if (subcommands(0) == null) {
                            System.out.println("Please provide what you would like to buy!");
                            break;
                        }
                        if (subcommands(1) == null || NotIntString(subcommands(1))) {
                            System.out.println("Please provide the amount you would like to buy!");
                            break;
                        }

                        switch (subcommands(0)) {
                            case "fertilizer":
                                if ((gold - parseInt(subcommands(1))) * 50 >= 0) {
                                    fertilizer += parseInt(subcommands(1));
                                    gold -= parseInt(subcommands(1)) * 50;
                                    if (rng(1, 20) == 1) {
                                        System.out.println("Lucky! You got 2 extra fertilizer!");
                                        fertilizer += 2;
                                    }
                                }
                                break;
                            case "wildlifeprotection":
                                if ((gold - parseInt(subcommands(1))) * 50 >= 0) {
                                    animal_protection += parseInt(subcommands(1));
                                    gold -= parseInt(subcommands(1)) * 40;
                                    break;
                                }

                            default:
                                System.out.println("Please specify either 'fertilizer' or 'wildlifeprotection'");
                                break;
                        }
                        actionsUsedThisTurn++;
                        break;

                    case "use":
                        if (subcommands(0) == null) {
                            System.out.println("Please provide what you would like to use!");
                            break;
                        }
                        if (subcommands(1) == null || NotIntString(subcommands(1))) {
                            System.out.println("Please provide how many of that item you would like to use!");
                            break;
                        }

                        switch (subcommands(0)) {
                            case "fertilizer":
                                if (fertilizer - parseInt(subcommands(1)) >= 0) {
                                    fertilizer -= parseInt(subcommands(1));
                                    trees += rng(2, 4);
                                    if (rng(1, 10) == 1) {
                                        System.out.println("Lucky you! You get 5 extra trees!");
                                        trees += 5;
                                    }
                                } else {
                                    System.out.println("You need more fertilizer!");
                                }
                                break;
                            case "wildlifeprotection":
                                if (animal_protection - parseInt(subcommands(1)) >= 0) {
                                    animal_protection -= parseInt(subcommands(1));
                                    wildlifeProtection++;
                                } else {
                                    System.out.println("You need more wildlife protection!");
                                }
                                break;
                            default:
                                System.out.println("Please specify either 'fertilizer' or 'wildlifeprotection'");
                        }
                        actionsUsedThisTurn++;
                        break;

                    case "clear":
                        cls();
                        break;

                    case "end":
                        cls();
                        System.out.println("Thank's for playing!");
                        System.exit(0);

                    default:
                        System.out.println("Invalid command!");
                        break;
                }

                if (actionsUsedThisTurn >= 5) {
                    turn++;
                    endCommand = true;
                }
            }
            if (wildlifeProtection == 0) {
                trees -= rng(2, 4);
            }
            if (trees < 0) {
                cls();
                System.out.println("You lost, making it to " + turn + " turns! Make it longer next time!");
                System.exit(0);
            }
        }
    }

    public static void cls() {
        System.out.print("33(H33(2J");
        System.out.flush();
    }

    public static void printResources() {
        String s = "Trees: " +
                trees +
                "nGold: " +
                gold +
                "nnUnrefined Trees: " +
                unr_trees +
                "nRefined Trees: " +
                r_trees +
                "nnFertilizer: " +
                fertilizer +
                "nAnimal Protection: " +
                animal_protection;
        System.out.println(s);
    }

    private static boolean NotIntString(String string) {
        try {
            parseInt(string);
            return false;
        } catch (NumberFormatException e) {
            return true;
        }
    }

    private static int rng(int min, int max) {
        return ThreadLocalRandom.current().nextInt(min, max + 1);
    }
}

GitHub

project management – Revenue stream options of a closed-source software distributed free of charge

Assume software is distributed free of charge. It’s closed-source but free. It has a good user base. These revenue streams can be imagined:

  1. Customization requests and subsequent contracts
  2. Locking some future features and unlocking them only for a subscription fee
  3. …?

What are the other options? Are there any more? Anything? Any idea? Any reference which I can study? Thanks :]

Update

Mentioned by @Ewan :

  1. Advertisements
  2. Selling anonymous user data collected by the user consent
  3. …?

project management – Does exist any methodology, which helps decide which elements to choose into the technology stack?

In most cases, it is prescribed what kind of programming language to use with what framework. In my question, I’m pointing to those situations when there is no requirement for the stack.

I understand that many people are limited by their previous experience, what kind of languages they used before, but I would like to abandon this factor.

When a project is starting and the participants have the freedom to select the elements of the technology stack, they have to decide somehow why do they choose one option despite the other alternatives.

Due to my previous search, I identified some website, which has a categorization and review system for technologies:

The list is not complete, and I’m curious if there is a “best” for these “comparative” sites. Like there is a “best” for searching something on the internet, although it has working and available alternatives.

To show an example: It’s about a web development project, there is a frontend, backend, and a database. It must be determined which language and technologies to use for each part of the system.
It is obvious that popularity and support is an important factor, but that’s lead to my question of detail:

How can someone determine the popularity and supportability of the options?

key management – How does a Certificate get associated to the private key pair?

I am new to SSL certs and trying to understanding once the certificate is imported into the Certificate Store (in Windows), how does the certificate get associated with the private key pair? Is that by creating a pfx that would contain the certificate and private key and import that pfx into Certificate Store? We intent to use the TPM to store the private key (but not using it to generate the keypair). How do we tell the certificate store where the associated private key is to a certificate?

Staffing Service for Software Development & Infrastructure Management | Proxies-free

Staffing Service for Software Development & Infrastructure Management

Netedge Technology is a leading technical support and server management company. We are running this business since more than 14 years. We have a great team of certified Systems Administrators who can take care of your servers from initial server setup to critical server and infrastructure management.

We help businesses to manage risk and control costs by reducing the ownership. We are providing 24×7 infrastructure management, Infrastructure Automation and cloud infrastructure design, implementation and management. We can manage any kind of infrastructure like Datacenter, webhosting servers, corporate network, and servers etc.. We can provide all the service for handling NOC (Network Operation Center ).

We are providing dedicated and shared technical staffing services. Our team works dedicated to the client like as their employee on our payroll.

There is no false commitment. Dedicated person is 100% dedicated to client only.

Dedicated staffing = 8 hours a day 5 days a week.

Shared staffing = 4 hours a day 5 days a week.

Please check this link for more details of the staffing service.

Dedicated Staffing Services

Shared Staffing Services

There are so many other services we are dealing with. Please find here with the details.

Server Management

Linux Server Management

Windows Server Security

Control Panel Security

Game Server Management

PCI Compliance

Dedicated Staffing

Shared Staffing

Remote Desktop Support

Technical Support

Hourly Technical Support

Ticket & Chat Support

One Time Service

Software Development

Virtualization Management

VPS Server Management

VPS Node Management

Web Hosting Support

Control Panel Management

Datacenter Management

IT Infrastructure Automation

Remote Infrastructure Management

Cloud Infrastructure Management

NOC Management

Web Application Management

Mobile Application Management

IOT Application Management

Please feel free to contact us at

sales@netedgetechnology.com if in case of any question.

Website = https://www.netedgetechnology.com

stored procedures – SQL Server Management Send Mail as Part of a Job

I have a SQL Job that I would like to send an email through, but for some reason I can’t get any details on why the email is not sending. This code works as expected when executed in the query window, and SQL Server Agent will also send error emails to me, so my email profile seems to be set up correctly. The code:

BEGIN
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'MailProfile',
@recipients = 'myaccount@emailcom',
@subject = 'Bad Data Report',
@query = N' USE Database;
   DECLARE @yesterday date = getdate() - 1;  select * from Timecards WHERE Date = @yesterday AND (DailyHours > 24.1 OR DailyHours < 0 ) ',
@exclude_query_output = 1,
@attach_query_result_as_file = 1,
@query_result_header = 1,
@query_attachment_filename = 'BadDataQuery.txt'
END

Following some advice from similar issues on this site, I tried looking through sysmail_allitems and sysmail_faileditems, but neither log any attempts to send. I also created a stored procedure that I had the job call as a roundabout way to send the email, but that also did not send an email nor leave an error. Any ideas what might be going on?

key management – How can I store and manage my GPG key pair securely?

I’ve taken measures and thoughts on how to securely store and manage my key pair. In the process of it a few questions arose, which I’m not capable of answering yet. My key pair will be used to encrypt passwords and documents of banks, insurances, invoices, photos and the like. All this data is not publicly available. It is stored in a cloud with password restricted access. I’m evaluating right now, which one fits best.

This is how I set up my key pair:

# Generated a key pair in the past, following general tutorials
gpg> list
sec rsa2048/9AB628FC04C23871
    created: 2019-02-29 expires: 2022-02-29 usage: SC
    trust: ultimate    validity: ultimate
ssb rsa2048/17832C40CF826BA9
    created: 2019-02-29 expires: 2022-02-29 usage: E
( ultimate ) (1). Thomas Kelly <Tkelly@ua-corp.com>

> gpg --list-keys --with-fingerprint Tkelly@ua-corp.com
pub    rsa2048 2019-02-29 (SC) (expires: 2022-02-29)
       B69A 8371 FC28 402C C204 82CF 7138 A96B B8F4 C87A
uid         ( ultimate ) Thomas Kelly <Tkelly@ua-corp.com>
sub    rsa2048 2019-02-29 (E) (expires: 2022-02-29)

> fdisk /dev/sdb # n, 2048, +2G, w
> cryptsetup open --type plain -d /dev/urandom /dev/sdb1 data
> dd if=/dev/zero of=/dev/mapper/data status=progress bs=1M
> cryptsetup close data
> cryptsetup luksFormat /dev/sdb1 # pw ...
> sudo cryptsetup open /dev/sdb1 data
> mkfs.ext4 /dev/mapper/data

Then I went on and exported my keys towards this device, I’ve created. After I got used to it, that private keys are always a little bit different from another and you can’t export your sub-public key, the following questions remained:

  1. Are both of the following commands returning the ssb key (17832C40CF826BA9)?
gpg --export-secret-keys 17832C40CF826BA9
gpg --export-secret-subkeys 9AB628FC04C23871
  1. Is it fine to remove the key 9AB628FC04C23871 from my system, after I backed it up on the drive, created above?

  2. Should I save a revocation certificate with it?

  3. This key pair once expired and I changed the expire date. I can’t remember correctly, but I’ve found two additional certificates lying around that seem to be these old expires certificates. I’ve read that the process of changing the expiring value creates new certificates. Can you confirm this?

  4. I want to have two certificate stores like this on different locations. I’d renew the key on a yearly base. Should I use paperkey or the same digital method above?