apt get life

Life around technology

  • Technology
    • Guides
    • Linux
    • Development
      • Laravel
    • Misc
    • Raspberry Pi
  • Writing
  • Crafts
    • Crochet
    • Model Making
    • Painting
  • Privacy Policy
You are here: Home / Home

Fixing Ubuntu black screen with blinking cursor

2023/02/16 by sudo 6 Comments

After doing a system update, my Ubuntu 22.04 desktop would not present a login screen. Instead it displayed a black screen with a white blinking cursor at the top. Resetting the PC didn’t fix the issue. The following outlines steps I took to solve the problem.

The first thing to do is drop into a terminal using ctrl + alt + F4 This should present you with a command line login screen. Since in my case the cursor appears before the login screen it’s probably that there’s an issue with a graphics driver or gnome display manager. Running sudo systemctl restart gdm may yield a result if you then return to the original session using ctrl + alt + F1 however if you still see the blinking cursor return to the terminal session on F4.

Knowing my issue occurred after an update, I decided the next best thing to do would be purge the nvidia drivers from the system. They’ve caused me problems in the past and splatting them has fixed the issue before. To remove all references to the nvidia drivers on the system run the following commands one after the other (note that they do prompt in their current state and the first one may take some time to complete):

sudo apt pruge ~nvidia
sudo apt autoremove
sudo apt clean

Once that’s done, I ran the following update and upgrade commands to make sure the system was as up to date as it could be:

sudo apt update
sudo apt full-upgrade

finally I rebooted the system

sudo reboot

This brought up the login prompt – all be it in the wrong resolution, which given that the display drivers have been stripped from the system is to be expected. I was able to login and then I could use the additional drivers tool to select a new set of nvida drivers. After installing those and rebooting again the system resolution was restored to default and the login was still working.

Filed Under: Guides, Technology Tagged With: nvidia issues, ubuntu, ubuntu 22.04

Raspberry Pi Keyboard Mini Review

2022/09/10 by sudo Leave a Comment

The raspberry pi keyboard is small and compact, perfect for traveling with if you have a phone or tablet but want a physical qwerty keyboard that you can connect with a cable. The cable connection saves significant battery power compared to Bluetooth keyboards. The key spacing of the keyboard is reasonable, but it does feel somewhat cheap when compared to premium keyboards like he MX keys. It’s got a very plasticy feel to it and there’s some sloppy key movement which might put off some more professional typists. For small pieces of work or ones that don’t require significant speed it is tenable as a keyboard, but if you’re in it for typing speed and accuracy there’s just something about it that seems to slow you down.

The keyboard itself requires a reasonable amount of force to trigger key presses and it makes quite a lot of noise for a low profile keyboard. I was quite surprised by this and I’m not sure what about the mechanics and construction make it work in this way. Coming from an IBM model M you might feel quite at home with the stompy key presses but from something like the MX Keys as a more modern low profile example I would say my preferences lead towards the more premium keyboard. You can soft type with the keyboard but something about it, either the construction quality or key travel distance really makes me want to hard-press instead of gently touch each key.

The integrated USB hub makes the device slightly more interesting than most run of the mill keyboards. It has been quite useful when the keyboard is setup on a desktop PC or with a laptop with few USB ports It’s allowed quick insertion of USB drives and even the wireless dongle for my mouse. I would not say it is a killer feature though.

I’ve been able to use the Pi keyboard, using a micro-USB to USB-C shim with both my phone (Google Pixel) and tablet (Samsung s6 lite). It has worked well with Google Docs in particular, although the keyboard did need changed from English US to English GB layout to work with quote marks, etc.

Overall I’d rate the Raspberry pi keyboard with half marks, 5 out of 10. It’s not unpleasant to work on and entirely serviceable but it does leave me longing for a better keyboard when writing longer pieces and it does get a little bit tiring to type on with the key stomp. Good for it’s price range but nothing to write home about.

Filed Under: Review, Technology, Uncategorized Tagged With: keyboards, raspberry pi, review

Alternative GPIO pins for Wemos D1 Mini BME280 sensor

2021/12/07 by sudo Leave a Comment

The Adafruit BME280 sensor library supports passing in alternative GPIO pins from the default D2 (GPIO 4) and D1 (GPIO 5) for SDA and SCL respectively for the Wemos D1 Mini. Since the I2C is software driven on the D1 Mini, it is reasonably straight forwards to assign different ports. Ports D6 and D7 line up well with the particular BME280 carrier board I’m using, which allows me to directly attach the BME280 over the D1 Mini, attaching SDA to D6, SCL to D7 and VIN to 3v.

In order to change ports, include the Wire library and define the ports:

#include <Wire.h>

#define SDA_1 12
#define SCL_1 13

Then call Wire.begin to initialise the ports, passing in the default sensor address space 0x76 and the wire object into the bme call.

Wire.begin(SDA, SCL)

unsigned status;

status = bme.begin(0x76, &Wire);

The complete sample code looks like this:

/***************************************************************************
  This is a library for the BME280 humidity, temperature & pressure sensor

  Designed specifically to work with the Adafruit BME280 Breakout
  ----> http://www.adafruit.com/products/2650

  These sensors use I2C or SPI to communicate, 2 or 4 pins are required
  to interface. The device's I2C address is either 0x76 or 0x77.

  Adafruit invests time and resources providing this open source code,
  please support Adafruit andopen-source hardware by purchasing products
  from Adafruit!

  Written by Limor Fried & Kevin Townsend for Adafruit Industries.
  BSD license, all text above must be included in any redistribution
  See the LICENSE file for details.
 ***************************************************************************/

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define SDA_1 12
#define SCL_1 13

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme; // I2C

unsigned long delayTime;

void setup() {
    Serial.begin(9600);
    while(!Serial);    // time to get serial running
    Serial.println(F("BME280 test"));

    // Init the ports for BME280
    Wire.begin(SDA_1, SCL_1);

    // Capture the BME init status, passing in custom Wire GPIO pins
    unsigned status;
    status = bme.begin(0x76, &Wire);

    if (!status) {
        Serial.println("Could not find a valid BME280 sensor, check wiring, address, sensor ID!");
        Serial.print("SensorID was: 0x"); Serial.println(bme.sensorID(),16);
        Serial.print("        ID of 0xFF probably means a bad address, a BMP 180 or BMP 085\n");
        Serial.print("   ID of 0x56-0x58 represents a BMP 280,\n");
        Serial.print("        ID of 0x60 represents a BME 280.\n");
        Serial.print("        ID of 0x61 represents a BME 680.\n");
        while (1) delay(10);
    }

    Serial.println("-- Default Test --");
    delayTime = 1000;

    Serial.println();
}


void loop() { 
    printValues();
    delay(delayTime);
}


void printValues() {
    Serial.print("Temperature = ");
    Serial.print(bme.readTemperature());
    Serial.println(" °C");

    Serial.print("Pressure = ");

    Serial.print(bme.readPressure() / 100.0F);
    Serial.println(" hPa");

    Serial.print("Approx. Altitude = ");
    Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
    Serial.println(" m");

    Serial.print("Humidity = ");
    Serial.print(bme.readHumidity());
    Serial.println(" %");

    Serial.println();
}

Filed Under: Arduino, Technology Tagged With: bme280, Environmental monitoring, Wemos D1 Mini

Fixing zsys daemon: timed out waiting for server handshake on Ubuntu 20.04 ZFS

2021/08/21 by sudo Leave a Comment

When running the apt package manager from the command line, if it starts coming up with the following error when you’re running ZFS it’s likely that your disk is too full to take more snapshots. This is a process that happens automatically on package installation or update.

<!-- wp:paragraph -->
<p>When running the apt package manager from the command line, if it starts coming up with the following error when you're running ZFS it's likely that your disk is too full to take more snapshots. This is a process that happens automatically on package installation or update.</p>
<!-- /wp:paragraph -->

In order to list your ZFS snapshots you can run

zfs list -t snapshot

To delete snapshots, as root, run either zfs destroy along with the specified snapshot name or delete a whole bunch at once:

zfs list -H -o name -t snapshot | xargs -n1 zfs destroy

For more information about zsys check out https://didrocks.fr/2020/06/04/zfs-focus-on-ubuntu-20.04-lts-zsys-state-collection/

Filed Under: Linux, Technology Tagged With: ubuntu 20.04, zfs

Solving Error on statfs() system call with cAdvisor and Docker

2021/01/14 by sudo Leave a Comment

With a docker setup running with Prometheus node exporter and a docker container running cAdvisor, I’ve been seeing error messages similar to the following repeatedly appearing in syslog:

Jan 14 15:15:25 dockerserver-live prometheus-node-exporter[603]: time="2021-01-14T15:15:25Z" level=error msg="Error on statfs() system call for \"/var/lib/docker/containers/719fe4c20d2d274bb034e914006ecfe6760d8aec98efdc8010c85a01cf4059aa/mounts/shm\": permission denied" source="filesystem_linux.go:57"
Jan 14 16:23:25 dockerserver-live prometheus-node-exporter[28623]: time="2021-01-14T16:23:25Z" level=error msg="Error on statfs() system call for \"/var/lib/docker/overlay2/8c25cb3049b4cfc9bebfd4df0ea6104560155bed2c18a9bd75d21323931570f4/merged\": permission denied" source="filesystem_linux.go:57"

These errors are being generated by a Prometheus node exporter process running with the following args:

      --collector.diskstats.ignored-devices=^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$ \
      --collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/) \
      --collector.netdev.ignored-devices=^lo$ \
      --collector.textfile.directory=/var/lib/prometheus/node-exporter

I’m not sure where this block originally came from, but in our case it’s in /etc/defaults/prometheus-node-exporter and easily edited to fix the regular expressions. Specifcally, because there’s problems with permissions on the shm and overlay they can be added to the ignored-mount-point regular expression as below:

      --collector.diskstats.ignored-devices=^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$ \
      --collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run|var\/lib\/docker\/containers\/.*\/mounts\/shm|var\/lib\/docker\/overlay2\/.*\/merged)($|/) \
      --collector.netdev.ignored-devices=^lo$ \
      --collector.textfile.directory=/var/lib/prometheus/node-exporter

following this change and restarting the prometheus-node-exporter process stopped new entries appearing in our syslog as it should be ignoring both troublesome directories.

Filed Under: Docker, Linux, Technology, Uncategorized

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • …
  • 14
  • Next Page »

Recent Posts

  • Disable iLO on HP Microserver Gen8
  • Ubuntu Desktop 24.04 Change Wallpaper Settings
  • Customising Ubuntu Desktop 24.04
  • Remove domains from Let’s Encrypt using Certbot
  • Install Jetbrains Toolbox on Ubuntu 22.04

Tags

API auditing crochet data recovery debian debudding development Dingo API docker email Getting started with Laravel 5 & Dingo API hard drive health HP Microserver KVM Laravel larvel 5 lenovo Linux Minion mint netgear nas networking network shares php PHP development Postfix raspberry pi review samba security SMART smartctl smartmontools smb testing traefik ubuntu ubuntu 18.04 ubuntu 20.04 ubuntu 22.04 ubuntu server vagrant Virtual machines xdebug xubuntu

© Copyright 2015 apt get life