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

Shrink PDF In Linux

Here is a great reference how to compress and reduce the size of PDF files with Ghost Scrip (gs) in Linux: http://blog.virtualzone.de/2012/11/how-to-reduce-pdf-file-size-in-linux…

Example: "gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=output.pdf input.pdf"

Running Linux on T450s T495s T14, Thinkpads and Others

I used a couple of moments to figure out if I wanted to stay on Kubuntu 14.04 LTS (Long Term Support), but then I decided to go with the new version 15.10. I want the new KDEnLive, so I can create more bad videos no one watches on my Youtube Channel PlantSugar.

Initial Setup

Update 2022-12-22: Optimized and started to strike through old not needed info when using Windows 11 and Kubuntu 22.10 end of 2022.

Get the bootloader working with Windows 10

Adjust Screen Brightness Ubuntu 19.10 - 22.04

Terminal: xrandr -q | grep " connected"
Output: eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 173mm

So my connected screen name is eDP-1

xrandr --output eDP-1 --brightness 0.5

0.5 = 50% of current brightness. Back to normal use:

xrandr --output eDP-1 --brightness 1

brightness 1 = 100%

Source and thanks to https://askubuntu.com/questions/149054/how-to-change-lcd-brightness-fro…

Skype For Linux Fix High CPU Consumption

Possible fix:

Delete the cache: ~/.config/skypeforlinux/Cache/

Skype start command: nice -n 19 rm -r ~/.config/skypeforlinux/Cache/* ; nice -n 19 /usr/bin/skypeforlinux %U skypeforlinux --disable-accelerated-video-decode=true

Skype start command vanilla: /usr/bin/skypeforlinux %U

Keyboard Mapping Kubuntu 20.04

Quick instructions:

insert: "keycode 49 = less greater backslash backslash backslash" in "$HOME/.Xmodmap" and run "xmodmap .Xmodmap" - this will setup your keys on the system.
To make these keys persistent run: "xkbcomp $DISPLAY $HOME/.xkbmap"

Very interesting: https://medium.com/@saplos123456/persistent-keyboard-mapping-on-ubuntu-using-xmodmap-cd01ad828fcd

Mounting Your Android Phone In Linux

Update 2022-07-14: kill kiod or kiod5 and then do jmtpfs

Update 2021-07-10: sudo aptitude install gmtp

It can be a challenge to mount your Android phone (MTP device) in Linux if you have some strange files from your old Iphone. I needed to do it the hard way.

You need to install mtpfs and use this command: sudo mtpfs -o allow_other /media/android-device

Reference.

 

Converting PNG to SVG

In a lot of cases it is useful to convert bitmaps like jpg, png to vector graphics like SVG or AI.

Inkscape -> Path -> Trace Bitmap

BASH

convert file.png file.pnm
potrace file.pnm -s -o file.svg

Delete Files and Folders Older Than X days

find /[FOLDER_NAME]/* -mtime +[OLDER_THAN_DAYS] -exec rm -rf {} \;

Example deletes all files and folders in tmp folder that are older than 180 days: find /tmp/* -mtime +180 -exec rm -rf {} \;

Ubuntu Select Touch Device

Quick note: xinput map-to-output 11 eDP

I have a thinkpad laptop with a touchscreen. When I connect my external screen, then the touch sensor on my laptop screen moves the cursor on the external screen, which is not what I want. I want to keep my touch on my laptop screen.

I followed the instructions here: https://askubuntu.com/questions/51445/how-do-i-calibrate-a-touchscreen-…

First run:

xinput

Output:

Example of battery status from TLP 2021-12-06 T495s
Linux Laptop Power Management TLP

TLP is an advanced power management tool I use for my laptop that runs Linux. I have not tested the different settings, but it seems that the battery time is increased compared to not running it. :-) I only use it in battery-mode. There are some extra features for Thinkpad laptops.

TLP settings file Ubuntu: /etc/tlp.conf

Reload config: sudo tlp start

Check TLP status: sudo tlp-stat 

Check battery: upower -i /org/freedesktop/UPower/devices/battery_BAT0

SSH Tips and Tricks

Kick user from SSH server: sudo pkill -HUP -u [USERNAME]

 

KDE 5 Plasma Fix After Upgrade

Missing icons on the login screen and everywhere else after upgrade to Kubuntu 21.04? You have come to the right place!

Easy fix: sudo apt install libqt5quick5

Source: https://askubuntu.com/questions/1288506/black-icons-after-reinstalling-…

I did not have any problems on my main machine, but my old machine which had not been updated for more than a year did not swallow the upgrade easily.

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

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…

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.

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

Pagination

  • First page
  • Previous page
  • …
  • Page 3
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Page 11
  • …
  • Next page
  • Last page

Review Greg on Google

Greg Nowak Google Reviews

 

  • WooCommerce Checkout Blocks: Default by Design, Rollback for Compatibility
  • When Google can call the business, your local data stops being cosmetic
  • Drupal CMS 2.0 Speeds Marketing Site Rebuilds, but It Is Not Autopilot
  • Your OpenAI and Cloudflare Keys Need an Expiry Date
  • Structured Outputs Shift Intake Automation From Prompts to Schema Design
RSS feed

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