apt install python-pip, Unable to locate package – Ubuntu

When trying to install pip on Ubuntu with

sudo apt install python-pip

get the following error

Unable to locate package python-pip

Does the same thing for other basic packages. One of which was nasm “Dependency for Chipsec”

Issue ended up being that the Community-maintaned source was not enabled. Enabled via the Software & Updates. Should be able to search for it and it should come up.

BitLocker – Command Prompt Commands

You’ll need administrator privileges to use these command. You can also run them from a command prompt in recovery

Check Status

manage-bde -status

Turn off Encryption

manage-bde -off C:

Change C: to the drive that has BitLocker on it. Check with the status command. May not be C if your in recovery.
Also note that after the encryption is turned off it takes awhile to decrypt. Check with status command

Unlock BitLocker Encrypted Drive

manage-bde -unlock C: -recoverypassword 11111-...-99999

Replace C: with actual drive

Replace the numbers at the end to your actual recovery key.

Secure Erase Hard Drive using DD

The following commands are dangerous! Proceed with caution!

Change /dev/sdX to your drive. Make sure you get the correct drive, or you could wipe you main system.

dd if=/dev/zero of=/dev/sdX bs=1M status=progress

The status=progress part shows how much dd has writen. Helpful to gauge how far along it is.

If you want a more secure way to erase the drive, change zero to random. Makes it slower, but should be more secure.

dd if=/dev/random of=/dev/sdX bs=1M status=progres

Side note, these commands should work in macOS, but you may need to drop the status=progress option.

LibreNMS manually clean up MySQL Syslog Database

Adding the following option to the config.php file is supposed to delete anything over 30 days.

$config['syslog_purge']                                 = 30;

You can also manually delete the entries out of the MySQL database by logging into MySQL, selecting the librenms database, and running the command below.

The command deletes all entries older than 12/9/2018 at 08:00. Change the date and time as needed.

DELETE FROM syslog WHERE timestamp < '2018-12-9 08:00:00';

The following link has some more clean up options.
https://docs.librenms.org/Support/Cleanup-options/

Setup SNMPv3 on Mikrotik Router

Setting up SNMP via WinBox is straight forward, the following commands are how to set it up from the command line with some troubleshooting info at the end.

Setup SNMPv3

Setup Community (Change v3Private,encpass, and authpass to their respective names or passwords)

snmp community add name=v3Private encryption-protocol=AES encryption-password=encpass authentication-protocol=SHA1 authentication-password=authpass security=private

Enable and set SNMP community (Trap Community needs to match the above command.  Change contact and the location as needed.)

snmp set contact=admin@incredigeek.com location=DeviceLocation trap-community=V3Private

Troubleshooting

Sometimes, for no apparent reason it seems, routerOS will have issues using the default community.  Work around is to create and use a new community.

Cannot connect with AES encryption

AES doesn’t always seem to work reliably.  Seems to work on some and not other.  Work around is to use DES.

Note that DES is deprecated on newer systems.  For example, you will not be able to read the SNMP details on a router that uses DES from a machine running AlmaLinux 9.  AES seems to be working fine now in 2023.

Log shows Permission Denied

Double check the allowed from addresses, user, and passwords

Microsoft Office Programs laggy when dragging with mouse

Problem: When clicking and dragging Office Programs by the title bar, the window is slow to move and respond to the mouse location.

Resolution: The problems appears to be related to the USB polling frequency for the mouse. Look at the mouse settings and try reducing the polling frequency. And/or try another mouse.

BASH Script to add new SFTP user and setup permissions

This script adds a new SFTP user with only sftp access.  Refer to this post on setting up a SFTP server.

Download script

wget www.incredigeek.com/home/downloads/scripts/sftpUserAdd.sh

Make executable

chmod +x sftpUserAdd.sh

Run with the new user you want to create.

./sftpUserAdd.sh sftpUsername

You may need to edit the script and modify the location parameters.

#!/bin/bash
# Automatically setup and add SFTP user
# Script creates new user and setups permissions
newUser=$1
sftpDir="/sftp/"
if grep -q ${newUser} /etc/passwd ;then
echo ${newUser} Already exsists. Aborting!
exit 1
else
mkdir -p ${sftpDir}/${newUser}/files
useradd -g sftpusers -d ${sftpDir}/${newUser}/files -s /sbin/nologin ${newUser}
passwd ${newUser}
chown ${newUser}:sftpusers /sftp/CareMark/files
fi