Skip to main content
GrN.dk

Main navigation

  • Articles
  • Contact
  • Your Digital Project Manager
  • About Greg Nowak
  • Services
  • Portfolio
  • Container
    • Excel Freelancer
    • Kubuntu - tips and tricks
    • Linux Apache MySQL and PHP
    • News
    • Image Gallery
User account menu
  • Log in

Breadcrumb

  1. Home

Articles

Signing PDF documents

When you need to sign a PDF document, it's quite easy to do in Libreoffice Draw for instance. You can just insert an image of your signature and print to PDF afterwards. Sometimes LibreOffice will not do a great job with opening some types of PDF documents. In these cases you can try to use "Lumin PDF" which can be accessed directly from Google Drive when you open a PDF document. You will be asked to accept the Lumin PDF connection to your Google account. You will need to accept the conditions and you are ready to go.

Canon 2010 Printer Tips and Tricks

Replace cartridge: Open access to printer, press stop 5 seconds and repeat. You don't need to replace the cartridge, you can clean it carefully with some soft tissue.
Youtube: How to remove the print head

WP CLI Tips And Tricks

Rename wordpress database prefix (https://iandunn.name/2016/07/21/rename-wordpress-database-prefix-with-w…)

Change site URL:

wp search-replace 'example.dev' 'example.com' --skip-columns=guid
Or, if you only want to change the option, you can do:

wp option update home 'http://example.com'
wp option update siteurl 'http://example.com'

Check defined constants - PHP Code Snippet
<?php 

define('DISALLOW_FILE_EDIT', true);

echo "\n DISALLOW_FILE_EDIT is: " . constant('DISALLOW_FILE_EDIT') . "\n";

//$constants = get_defined_constants();
//var_dump($constants); // pretty large list
?>

Key words: define defined constant constants

Run process in the background Linux

To detach a process started in the terminal, you can always add & at the end. For example: npm run evaluation &

Or: nohup bash script.bash &

After that you can run "jobs", to see the running jobs for that user.

Otherwise you can use "htop" or "ps -ef |grep bash" to find all bash jobs for instance.

References:

https://www.dev2qa.com/how-to-run-node-js-server-in-background/

Bash Tip and Tricks

Check if file or directory exists, multiple ways: https://linuxize.com/post/bash-check-if-file-exists/

Ubuntu Logs Journalctl and Dmesg

You can see a lot of good information for debugging and fixing errors on your Ubuntu server with journalctl and dmesg

journalctl --since "1 days ago"

journalctl --since "10 hours ago"

journalctl --since "12 hours ago" -p 3 -x --utc --no-pager

dmesg | less

dmesg -H --time-format iso| less

Resources:

https://unix.stackexchange.com/questions/50098/linux-network-troublesho…

Wordpress Cron

Wordpress runs it's cron job automatically approximately every 10 minutes. Sometimes it is blocked by .htaccess or other server configuration. To avoid issues, it might be a good idea to run from the server crontab itself.

References:

https://kinsta.com/knowledgebase/disable-wp-cron/

https://wpbeaches.com/set-up-wordpress-wp-cron-php-to-run-manually/

Bash Find and Delete Files Older Than X Days

find [FOLDER_NAME]/* -prune -mtime +14 -exec rm {} \;

Find and replace string in files recursively

This is the best option I have found so far: find . -type f -exec sed -i 's/foo/bar/g' {} +
foo is replaced with bar.

Source: https://linuxize.com/post/how-to-use-sed-to-find-and-replace-string-in-…

Also quite handy to be able to search and replace filenames.

Nagios Check HTTP notes

Example bash on argument 1. It checks if HTTPS is up and if the domain-name is on the site. Most sites have the domain name on the front page somewhere: /usr/local/nagios/libexec/check_http -H $1 --ssl --onredirect=follow --string "$1"

If log file you can run grep on the following keywords: grep -i -e "critical" -e "invalid" -e "warning"  [LOGFILE.log]

Keywords: check_http

Suspend Issue AMD Graphics Driver Kubuntu 20.04

If you have the black screen of death when trying to get back from suspend mode, you might want to check out this bug description and possible resolutions: https://bugs.launchpad.net/ubuntu/+source/plasma-desktop/+bug/1849084

Otherwise disable compositor: qdbus org.kde.KWin /Compositor suspend

Check if compositor is enabled: qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.active
Or: qdbus org.kde.KWin /KWin supportInformation

Remove whoopsie-upload

sudo systemctl stop apport
sudo systemctl stop whoopsie 
sudo systemctl disable apport
sudo systemctl disable whoopsie
sudo aptitude purge apport whoopsie

Source: https://askubuntu.com/questions/1245078/woopsie-upload-all-process-cons…

SystemD Notes Tips and Tricks

A nice little guide: https://tecadmin.net/run-shell-script-as-systemd-service/

Linux Browser Tweaks

In firefox I have enabled a couple of tweaks described here for hardware acceleration: https://askubuntu.com/questions/1216192/why-is-kubuntu-using-much-more-…

 

Maybe more info here: https://itectec.com/ubuntu/ubuntu-why-is-kubuntu-using-much-more-cpu-th…

Mysqldump encoding

If you experience false characters in your mysqldump, you might want to try to set the encoding specifically. Example with latin1:

mysqldump -u [USER] -p --opt --skip-set-charset --default-character-set=latin1 [DATABASE_NAME] > [OUTPUT_FILE_NAME].sql

Check different encoding settings in mysql when using a specific database: show variables like 'char%';

More info and tips: https://www.toptal.com/php/a-utf-8-primer-for-php-and-mysql

KDE contextual menu shortcut (mouse right click wannabe)

Use "xdotool key Menu" in a global shortcut. That's it!

Source: https://askubuntu.com/a/1008343/1016583

Android Flutter Notes

Currently running flutter in ubuntu 20.04.

Flutter cli doc: https://flutter.dev/docs/reference/flutter-cli

Flutter pub doc: https://dart.dev/tools/pub/cmd

KVM installation: sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst virt-manager
Old info: sudo apt install qemu qemu-kvm virt-manager (Remember to enable VT Virtualization in the Bios) - run: sudo kvm-ok (to check)

Handling Multibyte Characters And Strings In R Project

If you encounter this problem when reading csv-files, you might want to try to change the encoding from UTF-8 to latin1. This worked for me when using the tolower function in R.

Pretty nice solution here with gsub (https://stackoverflow.com/questions/38828620/how-to-remove-strange-char…):

Nano Text Editor

The text editor "nano" is an easy to use editor for linux etc.

Here are som great options to add:

File: ~/.nanorc

Content:

set linenumbers
set softwrap
set tabsize 4

Pagination

  • First page
  • Previous page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • …
  • Next page
  • Last page

Review Greg on Google

Greg Nowak Google Reviews

 

  • Youtube Subtitles in Any Language
  • Your CMS Upgrade Is Now a Stack Project: A 2026 PHP Roadmap for WordPress and Drupal Sites
  • AI Crawler Control for Business Websites: Protect Your Content Without Disappearing From Search
  • Portfolio
  • Gregs IT and Logistics Optimization
RSS feed

GrN.dk web platforms, web optimization, data analysis, data handling and logistics.