package management – Cannot fix apt-get and always get an error message

When I run sudo apt-get -f install, it always gives the following error:

dpkg: error processing archive /var/cache/apt/archives/libglib2.0-bin_2.48.2-0ubuntu4.8_amd64.deb (--unpack):
 unable to create '/usr/bin/gapplication.dpkg-new' (while processing './usr/bin/gapplication'): Permission denied
Errors were encountered while processing:
 /var/cache/apt/archives/libglib2.0-bin_2.48.2-0ubuntu4.8_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

What can I do to fix this problem? Thanks.

web development – Ubuntu Server Management – How do I stop hard drive space from creeping up over time?

I have been using ubuntu servers for the last 5 years, I have consistently had the same issue with hard drive space creeping up over time.

I use AWS CloudWatch to notify me if a server crosses 80% hard drive space consumption, when they do, in general, I have followed the following steps in order to trim down my footprint.

Unfortunately though even after doing these steps it doesn’t always bring the hard drive space under 80% and I end up having to increase my hard drive space. I mainly develop using two programming languages and deploy REST API’s in Ruby and NodeJS.


  • On servers running NodeJS, we use PM2 for application management, and proxy pass NGINX traffic to ExpressJS
  • On servers running Ruby, we use passenger + NGINX
  • On every server I have logging enabled in my REST API’s, and I rotate my logs automatically

To trim down my memory footprint I do the following:

Step 1] keep my system updated

sudo apt update

Step 2] sometimes running upgrade, it can be scary to upgrade to a new major ubuntu version if you are not prepared to

sudo apt upgrade

Step 3] cleaning out apt package cache

sudo apt clean

Step 4] removing old kernals

sudo apt autoremove --purge


I need some way of being able to see what part of my OS creeps up in hard drive consumption over time, I have ran different scripts that tell me how large folders are etc, but I still haven’t found any conclusive solutions or evidences of the problem, ubuntu with my understanding just keeps creeping on memory.

Are there any solutions that others have to my problem?

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. …?

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?

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?

Staffing Service for Software Development & Infrastructure Management | Proxies123.com

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?

package management – Help Directing Question to Appropriate Forum Area, Please: Repository Issue in 20.04

I am using Ubuntu 20.4 and I am attempting to install DSD by debi http://ppa.launchpad.net/szechyjs/dsd/ubuntu 20.4 main

But I get this response:

debi: warning: debian/changelog(l12): found start of entry where expected more change data or trailer
LINE: sdrangel (6.7.0-1) unstable; urgency=medium
debi: warning: debian/changelog(l12): found end of file where expected more change data or trailer
debi: can’t read sdrangel_6.8.0-1_amd64.changes!

The developer of DSD really wants us to use DOCKER to install full versions of SDRAngel, which includes DSD, so I tried that, as well:

sudo add-apt-repository “deb (arch=amd64) https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”

BUT I receive this response:

Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 https://download.docker.com/linux/ubuntu focal InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease (114 kB)
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease (109 kB)
Ign:5 http://ppa.launchpad.net/szechyjs/dsd/ubuntu focal InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease (101 kB)
Err:7 http://ppa.launchpad.net/szechyjs/dsd/ubuntu focal Release
404 Not Found (IP: 91.189.95.85 80)
Get:8 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata (264 kB)
Get:9 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata (303 kB)
Get:10 http://us.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata (2,468 B)
Get:11 http://us.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata (1,768 B)
Get:12 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata (24.3 kB)
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata (58.2 kB)
Reading package lists… Done
E: The repository ‘http://ppa.launchpad.net/szechyjs/dsd/ubuntu focal Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

It appears from these two responses that the DSD component for Ubuntu 20.04 is absent. It appears that past and future releases of Ubuntu have valid DSD repositories. 20.04 seems to have an abnormally ended file repository. I am assuming here that the DSD repository needs to be rebuilt and replaced, then the Docker container for 20.04 be rebuilt and replaced.

I left a note with the DSD developer yesterday in github, but no response as of this afternoon from anyone.

I don’t know where is the appropriate forum to lodge this issue. I would have assumed the repository should have been submitted by the DSD developer. But, I can see the potential that the Ubuntu repository build might be managed by someone other than the developer, so maybe a repository maintainer issue. In the case of the Docker container, it might be some issue with the container publishing function.

Can those familiar with this whole process advise me on how to properly direct this (these?) issue(s)?

Many thanks,
Shane