Linux, Unix and BSD: Tips, Tricks, Useful Commands and Interesting ways to get things done! Share your knowledge!


Recommended Posts

When I get off of The TP Program in June or July, I am going to give Linux another shot. Not sure how it would boot with Win 10 and I do not want to do it while I am Testing Previews.

  • 2 weeks later...

check the status of your bios/mainboard battery with the following command (can be run without root privileges)

 

[~] cat /proc/driver/rtc | grep batt_status                            15:15:35 
batt_status     : okay

if it says not okay but dead you better exchange it asap. 

  • Like 2

Next couple of Tips N Tricks articles are forthcoming ... you folks are gonna love these. :yes: I'll post them as time permits (starting College Term #2 this week). Shoulder is doing a bit better too, thankfully. Maybe I'll escape another surgery after all.

Get a Canon Multifunction (All-In-One) Printer/Scanner/Copier Working:

 

References:

http://ubuntuhandbook.org/index.php/2014/12/canon-driver-scangear-mp-ubuntu-14-04/

https://wiki.ubuntu.com/HardwareSupportComponentsPrintersCanon

http://askubuntu.com/questions/168089/how-do-i-install-my-new-canon-mg5250-printer-mg5200-series

http://www.canon.com.my/personal/productlanding?languageCode=EN

 

Background

This one was a real problem, up until I ran across a very obscure (and actually quite simple) procedure. Thought I'd pass this one along. Hope it helps someone else. The reason the fix eluded me was primarily because the Proprietary blobs are available for my device, but aren't listed as such for my very common model (Canon-MG-2970, also called a Pixma-2970). The Printer part of the driver? No problem getting that working. The Scanner part was a different story entirely; for weeks I was banging my head against a brick wall trying to get it working. No solution worked, until I tried (literally!) "Door #3 -- the 'this is what the Simple-Scan and the SANE routines should have been doing from the start, but aren't doing for whatever reason!'" solution. To my utter shock and complete amazement, the Scanner which thus far had been totally non-compliant was working -- and working BETTER than on Windows! HUZZAH! The obscure reference about invoking scangearmp2 from the command line had worked!

 

So here's how I got it installed and working:

 

The difference is that instead of following the VERY convoluted and INCORRECT instructions about installing SANE and Simple-Scan, which will result in nothing working except the Printer part; we install the Proprietary Debian Printer Driver (called "cnijfilter") then the Scanner Driver (called "scangearmp2") manually. Download each of the drivers from Canon-Asia (link to the website above), agree to their T&C. Open Terminals in each archive after decompressing, run the ./install.sh files for each as sudo. The only real constraint is that you should probably install the Printer Driver (cnijfilter) first to get the device registered with the system, and that I didn't have any luck getting it working wirelessly so you'll need to connect it via USB cable. After we install cnijfilter, install scangearmp2. Afterwards, make a launcher in whatever way works best for you (I use Linux Mint/Cinnamon, so I had the use of a GUI Menu Editor available) to create a launcher for "scangearmp2". That's the actual application we use to scan with, too.

 

Your results may differ according to Model, but generally the instructions should work for all Canon Multifunction Printer/Scanner/Copiers.

 

Good luck!

Edited by Unobscured Vision

Sadly, my next article for the Tips N' Tricks thread "Install an OS (including Windows) using an ISO from Hard Disk via GRUB" has run into a major snag; meaning that the information and procedures are woefully convoluted, tangled, and don't always work. The major factor is the ISO preparation (for whatever reason, which makes no sense to me). Windows, oddly enough, is pretty forgiving and installs relatively fine -- it's the LINUX Distros that are the problem! Imagine that.

 

And bear in mind that it isn't the "stock" Distros -- Ubuntu, Debian, Red Hat, they're straightforward. It's the more "specialty/derivative" ones that put up a fuss. Mint, for example, has one of the more oddball setups I've ever seen. Why? Who knows. Might explain why LM 17.3 is impossible to get onto a USB Stick cleanly. I've always, always had to use 17.2 and then upgrade ... 

 

still want to do this article .. just not sure how to go about it. Until then, it's delayed. Apologies to all.

Get newer Nvidia binary Drivers sooner on currently supported Debian, Ubuntu, Debian-derivative and Ubuntu-derivative Distributions:

(Credits go to @Boo Berry for this one.)

Reference:

https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa

 

Background and Purpose:

Generally we all like having the latest driver for our GPU. Bugfixes, new/improved features, better performance; the list goes on. While we generally can deal with the drivers we've been offered, there are occasionally issues -- most often when new cards are released that the old drivers don't support properly (if at all), or when we're using an LTS release and those old drivers don't get updated for two years ... Case and point, Linux Mint. Great Distribution, large following -- but much to our eternal sadness their hands are tied. They can't offer driver updates because that's Ubuntu territory and they can't pre-add PPA's to the sources list because it violates some kind of licensing with Ubuntu ... ugh. Who knows.

 

So, users are left to deal with the problem themselves when getting newer hardware. Either switch to Ubuntu's non-LTS releases or "find our own drivers". In the past, that option was limited to the Xorg-Edgers PPA; and their offerings weren't always completely reliable or up-to-date. They did try, though.

 

Now there's another option that is much more current, and receives far more benchmarking and testing. Problems are addressed immediately and fixes are pushed to users as quickly as they have been tested and found to be good to go.

 

Currently, the Graphics-Drivers PPA Team is only doing Nvidia Drivers for now. Hopefully that will change in the future.

 

Enough talk! How do I install the new hotness?

In your Terminal:

sudo add-apt-repository ppa:graphics-drivers/ppa

Press Enter to add it after the obligatory text about what the PPA contains. Then issue the command:

sudo apt-get update

At this point, you can either fire up your Driver Manager (Linux Mint Cinnamon and MATE or any other Distro using Driver-Manager) or the Drivers tab in Software and Updates (Ubuntu and derivatives); or (Debian users will most likely need to do it this way) via the open Terminal (replace the '364' with whatever version is current now ... check the above link. They'll have it there):

sudo apt-get install nvidia-364

Press 'y' to accept the changes, wait for everything to install, restart.

 

Please note that it is possible that some users of the Geforce GTX 900-series cards will need to enter 'nomodeset' to GRUB options when loading their Distro. I say 'possible' because some do, and some don't. There's something else going on with that particular issue that I haven't been able to replicate (sorry @T3X4S). Is it different combinations of chipsets and CPU's and GPU's? I've no idea.

  • Like 2

it might also be suggested to disable the ppa afterwards to avoid potential security risks.  i don't know a case yet where malicious software got installed due to an optional ppa and i had many enabled in my ubuntu days, however at the end, i also disabled them after they did their purpose. plus, sudo apt-get update will be quite faster when it does not have to read many ppas. 

  • Like 2
8 hours ago, T3X4S said:

Thanks for the tips.

For my end, not a problem. Sorry I wasn't able to track down what's happening.

8 hours ago, Simon Lang 9047 said:

it might also be suggested to disable the ppa afterwards to avoid potential security risks.  i don't know a case yet where malicious software got installed due to an optional ppa and i had many enabled in my ubuntu days, however at the end, i also disabled them after they did their purpose. plus, sudo apt-get update will be quite faster when it does not have to read many ppas. 

That's not a bad idea; however I prefer to have updates across-the-board. The nvidia-364 driver is a little on the flaky side, and needs some further optimizations. I might revert back to the one I was using before if things keep up the way they are.

  • 1 month later...

if you have got one of these top notch laptops where windows just would not let linux dualboot even if you set UEFI correctly in BIOS and have turned off secure boot, here is your help:

http://itsfoss.com/no-grub-windows-linux/

 

 

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

this magic code did the trick for me. 

  • Like 1
  • 10 months later...

Just to push topic ahead, i'd like to mention useful utility unshare: sometimes it's very needful to block any network activity for given app ==>> unshare -n --user opera --no-sandbox

netless.thumb.png.3e674c13035ad23be7f661ba1776acad.png

ah, that's russian :) would you like to change locale?  ==>> LANG=en_UK.utf8 unshare -n --user opera --no-sandbox

netless1.thumb.png.5623f49e37a2d280d89ed09cc6c5a6ee.png

for some apps, var LANG doesn't work well or doesn't run at all, so use LC_ALL.

  • 4 weeks later...

How to deal with a hibernated NTFS drive or partition:

 

References:

https://www.google.com/search?q=mount+a+hibernated+ntfs+partition

https://ubuntuforums.org/showthread.php?t=2327737

https://askubuntu.com/questions/204166/how-do-i-mount-a-hibernated-ntfs-partition

https://superuser.com/questions/678274/trouble-mounting-ntfs-disk-on-linux

https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/

 

Problem:

You've installed Linux after using Windows 8 or 10 and you attempt to mount your NTFS-formatted partition(s). You're presented with an error message that reads (for example):

Error mounting: mount exited with exit code 14: Windows is hibernated, refused to mount.
Failed to mount '/dev/sda5': Operation not permitted
The NTFS partition is hibernated. Please resume and shutdown Windows
properly, or mount the volume read-only with the 'ro' mount option, or
mount the volume read-write with the 'remove_hiberfile' mount option.

In essence, the filesystem is in a hibernated (locked) state. Frozen. (Let it go ... let it gooo .... darn it, now that stupid song is in my head. :laugh:)

 

Solution:

There's an easy way to unfreeze it. No fuss, no muss -- although the Terminal output will suggest otherwise, things are gonna be okay. -ish. Nah, just kidding. All is well. :yes: 

 

Step 1: Fire up the Terminal.

Step 2: Type in the following and hit Enter:

sudo ntfsfix /dev/sdc1 (for example -- whichever drive or partition is hibernated)

(The Terminal output will complain about it being an unclean filesystem, etc etc ... yeah, we already know.)

 

Things should be fine now. It won't take any time at all to complete. You can mount the location normally, or use udiskctl to create your startup mounts. Whatever floats your boat.

  • Like 1

The "Easier Way" to handle Filesystem Mounts at Startup:

(Updated from: Forum post: Mount a local Hard Disk/Partition at Login instead of at Startup)

 

Some time ago, I described a safe way for a user to automount Hard Disks and Partitions at login rather than at system start that won't hose your system if one or more of these filesystems aren't available. Over the course of time, it occurred to me that I was actually making the process more difficult than it needed to be.

 

Instead of using archaic "crypto-speak" which makes things harder, I'd forgotten that we can reference our disks and partitions by label. Furthermore, we can mount those items in the same manner. And chances are we'll even remember the names of our items too. Better this way, all-around. :yes: 

 

So. Let's get to it.

 

Step 1We still need the Terminal. Fire it up. Issue the command:

ls -al /dev/disk/by-label

You'll get something like this:

Term1.thumb.jpeg.63fdf11bbda9b505c9f85b32faebed74.jpeg

Now you've got your proper labels for the disks and partitions. Easy peasy.

 

Step 2: Go into your Control Center -> Application Autostart. Add a new entry. If it asks, you're looking for 'custom command'.

 

Your command will be:

udisksctl mount --block-device /dev/disk/by-label/<label>

Where <label> is the label of the disk or partition you'd like to have automounted when you log in. In my example, my commandline would read:

udisksctl mount --block-device /dev/disk/by-label/Storage

Step 3: Give it a name that you want the autostarted command to be known by, and click ok.

 

Step 4: Rinse and repeat. :)

 

And yes, it's really that easy. Enjoy!

  • Mindovermaster unlocked this topic

After several years I'm resurrecting the Tips N Tricks thread here, thanks to the kind permission of @Mindovermaster. :D

lot has happened in seven (yes, seven) years and I feel it's important - especially with Windows 10 support ending in a year, leaving millions of otherwise useful systems in the dust due to Microsoft's arbitrary practices - to do my part.

I've got 3 posts cooking but I work a LOT so it's gonna take some time. I appreciate everyone's patience.

New content coming!

On 11/08/2024 at 13:33, BetaguyGZT said:

New content coming!

Thank you for your help! Love member content like this!

  • Like 1
  • Love 1

zRAM refresher!

(Original Neowin thread for reference:

For anyone not familiar with zRAM, here's a bit of information about it:

https://en.wikipedia.org/wiki/Zram
https://wiki.archlinux.org/title/Zram
https://wiki.debian.org/ZRam

A number of distributions, such as Garuda, ship with it out of the box. Other distros will need to install it but it's fairly easy to get up and running.

So it begs the question "why would anyone need this in 2024?" -- systems are RAM-rich (16+gb) now. And it's honestly a good point; but there are use cases where zRAM is helpful. Examples being gaming-focused distributions, high-intensity workloads like content creation or computational tasks that require as much memory as it can get, etc.

"We already have memory compression!" -- yes, also true -- but built-in memory compression isn't this and there are (again) justifications on using zRAM in conjunction with compression techniques. Think of zRAM as another layer rather than a replacement for something. 

"It's just a swap space in RAM -- surely there's no reason!" -- actually, that's exactly what it is and yes, there is a good reason. Now you'll have two - one on-disk and one in-RAM. Disk is far slower -- which is why the system will chug along slowly if you're using disk swap -- versus moving right along nearly at-speed with zRAM. You have the disk-based Swap as a fallback if you really need it but the system won't go to it first, it'll go to the zRAM initially.

Another selling point of zRAM is that you can, if so desired, assign it MORE than the amount of physical RAM you actually have installed. zRAM will then engage the compression routines automatically giving you additional functional memory than not. I have personally gone +200% with no ill effects although the documentation states that the sweet spot is 150%.

So the next question is should one use zRAM? I can't think of a good reason not to. It'll only help your system.

The procedures for getting it running are exactly the same as before. I won't reinvent the wheel so I encourage users to simply follow the original thread's instructions. 😃

  • Like 1
  • 1 month later...

To Zen or not to Zen ...

Moving right along. 😃

https://wiki.archlinux.org/title/Kernel

To start, Zen kernels are not realtime. Those are for different application use cases (Audio or Video development, for example). Zen kernels are instead tuned in favor of performance and responsiveness with Gaming in mind (like Garuda). SteamOS uses its own modified kernel tuned to the needs of that particular hardware although a more general-use kernel (with patches for the hardware) is constantly being worked on in order to bring SteamOS to other systems.

Zen kernels aren't for every use case. There are things that Zen kernels aren't really suited for (such as Servers) -- and they can introduce instabilities that wouldn't otherwise be present with other kernels.

Ubuntu-based distributions (Mint, in particular) aren't really any worse at gaming than a focused, purpose-crafted gaming distro (again, Garuda). Certainly it has more to do with the base distribution (in Garuda's case, Arch) than anything.

In my personal experience, a Zen-based distribution is snappier on the Desktop level but can be unstable. I personally want stability over a bit of speed so I stick to whatever kernel (plus updates, obviously) is the latest for that distro.

Is it worth it? Not really, imho. All the effort that goes into maximum stability and driver support cannot be ignored and I think the average GNU/Linux user is more than happy to "let well enough alone".

Do I recommend using a Zen kernel? Honestly, no, especially if we consider that Ubuntu kernels are tuned for Ubuntu-based distributions and aren't prone to breaking.

The next topic is coming very soon -- my own testing & results concerning Cloud Gaming services on 'nix and how to mitigate a few issues.

Edited by BetaguyGZT

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Posts

    • Glow 26.10 by Razvan Serea Glow provides detailed reporting on every hardware component in your computer, saving you valuable time typically spent searching for CPU, motherboard, RAM, graphics card, and other stats. With Glow, all the information is conveniently presented in one clean interface, allowing you to easily access and review the comprehensive hardware details of your system. Glow provides detailed information on various system aspects, including OS, motherboard, processor, memory, graphics card, storage, network, battery, drivers, and services. The well-organized format ensures easy access to the required information. You can export all the gathered data to a plain text file, facilitating sharing with others for troubleshooting purposes. No installation needed. Just decompress the archive, launch the executable, and access computer-related information. Glow runs on Windows 11 and Windows 10 64-bit versions. Glow 26.10 changelog: New Features The bootstrapping algorithm has been completely redesigned. The software can now launch directly without requiring TS Preloader. As part of this change, the startup splash screen displayed during initialization has been removed. In addition, spikes in CPU usage have been eliminated, resulting in a more stable architecture with significantly lower memory consumption. The Microsoft Office detection infrastructure within the Operating System section has been enhanced. Additional detection support has been added for Office C2R (Click-to-Run) installations. Furthermore, the license status evaluation system has been improved, and the priority order has been revised as follows: Licensed > Grace Period > Other (NOTIFICATIONS, EVALUATION, etc.). Glow now includes preliminary support for Wi-Fi 8 technology, allowing more detailed information to be displayed for Wi-Fi 8-compatible network adapters. Glow now provides full support for Bluetooth 6.2. Adapters supporting Bluetooth 6.2 can be analyzed in greater detail and with improved accuracy. The disk distribution view in the Disk section has been modernized, replacing the traditional table layout with a new 2×2 card-based design. The TS Custom Controls module has been updated to v26.7. Thanks to the new custom controls, all Türkaysoft applications now offer a more modern and consistent user interface aligned with Windows 11 design standards. Bug Fixes Potential line-ending handling issues in the Office detection code within the Operating System section have been resolved. Additionally, the output format has been standardized to UTF-8 to prevent character encoding issues and ensure consistent data processing. Several stability and file management issues within the Debugging infrastructure have been addressed. Problems that prevented new log files from being created after Debugging was disabled, as well as issues causing debug records to be lost, have been fixed. File deletion and reaccess issues that occurred after file locks were released have also been resolved. In addition, a bug that caused newly recreated log files to remain locked after deletion has been eliminated. Unnecessary blank lines within debug logs and the extra empty line that could appear at the end of log files have also been corrected. A shortcut key conflict caused by assigning identical hotkeys to both the DNS Test Tool and the Donation page has been fixed. The DNS Test Tool can now be accessed using CTRL + Shift + D, while the Donation page is available via CTRL + Alt + D. Changes The service responsible for providing the Public IP Address and Internet Service Provider information in the Network section has been updated to use the ipinfo.io infrastructure. This change improves the accuracy and consistency of the displayed data. (No external requests are made while Hiding Mode is enabled.) Some terms in the Dutch and Korean language files have been updated to make them clearer and more user-friendly. [TS Updater] Before the update process begins, users are now prompted to choose whether they would like to view the release notes. Note: Always unzip the program before using it. Otherwise you may get an error. Download: Glow 26.10 | 1.8 MB (Open Source) Links: Glow Homepage | Screenshot | Github Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Maradona if hydration breaks had existed in Mexico 86.
    • The quantum search for Time's origin had an equally mind-boggling conclusion by Sayan Sen Image by Steve Johnson via Pexels A theoretical study from researchers at the University of Surrey suggested that the direction of time may not be fundamentally fixed in certain quantum systems. The work, published in Scientific Reports, examined how the “arrow of time” could emerge from microscopic physics and found that time-reversal symmetry can remain intact even in models used to describe processes such as energy loss and thermalisation. The arrow of time refers to the observed one-way direction from past to future in everyday life. In macroscopic processes, this is easy to see. Spilled milk spreads across a table and does not gather back into a glass, and heat flows from hotter objects to colder ones. These processes shape the common sense idea that time moves in a single direction. However, at the level of fundamental physics, many equations do not prefer a direction of time. Time-reversal symmetry means that the same physical laws can describe a system whether time moves forward or backward. This has made it difficult to explain why irreversible behaviour appears in the large-scale world even when the underlying rules do not require it. Dr Andrea Rocco, Associate Professor in Physics and Mathematical Biology at the University of Surrey, described this contrast: "One way to explain this is when you look at a process like spilt milk spreading across a table, it's clear that time is moving forward. But if you were to play that in reverse, like a movie, you'd immediately know something was wrong – it would be hard to believe milk could just gather back into a glass. However, there are processes, such as the motion of a pendulum, that look just as believable in reverse. The puzzle is that, at the most fundamental level, the laws of physics resemble the pendulum; they do not account for irreversible processes. Our findings suggest that while our common experience tells us that time only moves one way, we are just unaware that the opposite direction would have been equally possible." The study focused on open quantum systems, which are quantum systems that interact with a surrounding environment. This environment, often described as a heat bath, can exchange energy and information with the system. The researchers used this framework to study how a direction of time might appear even when the underlying physics does not enforce one. A key part of the analysis involved the Markov approximation. This is a simplification used in many models where the system is assumed not to retain memory of its past states. The idea is that changes depend only on the current state, not on earlier history. This is commonly used when studying thermalisation, which is the process where a system settles into equilibrium with its environment. The study also used concepts such as master equations, including the Lindblad and Pauli equations, which describe how probabilities of different quantum states change over time. Another related model discussed was quantum Brownian motion, which describes the random-like movement of a quantum particle interacting continuously with its environment. In these descriptions, a “memory kernel” can appear, which is a mathematical term that accounts for how past states influence current behaviour. The researchers found that applying the Markov approximation did not break time-reversal symmetry. Even when the system interacted with an effectively infinite heat bath, the resulting equations of motion remained symmetric in time. This meant that the same mathematical description could, in principle, run forward or backward in time without contradiction. The study further showed that standard frameworks used in open quantum systems, including quantum Brownian motion and master equations like the Lindblad and Pauli forms, could be written in a time-symmetric way. These equations are typically used to describe processes that look irreversible, such as dissipation and thermalisation, but the results suggested they can also be interpreted as allowing evolution in both time directions. Thomas Guff, Research Fellow in Quantum Thermodynamics, said: "The surprising part of this project was that even after making the standard simplifying assumption to our equations describing open quantum systems, the equations still behaved the same way whether the system was moving forwards or backwards in time. When we carefully worked through the maths, we found that this behaviour had to be the case because a key part of the equation, the "memory kernel," is symmetrical in time. We also found a small but important detail which is usually overlooked – a time discontinuous factor emerged that kept the time-symmetry property intact. It’s unusual to see such a mathematical mechanism in a physics equation because it's not continuous, and it was very surprising to see it appear so naturally." The researchers also noted that deriving a one-way arrow of time from time-reversal symmetric microscopic dynamics remains an open problem across fields such as thermodynamics, statistical mechanics, particle physics, and cosmology. Their results suggested that some standard descriptions of irreversible behaviour in open quantum systems may be better understood using a time-symmetric formulation of Markovianity. According to the study, processes such as thermalisation, which are usually treated as irreversible, could in theory be described in a way that allows evolution in either time direction under the same rules. This does not imply that time reversal occurs in everyday life, but rather that the underlying equations do not strictly enforce a single direction. Overall, the findings suggested that the perceived direction of time may emerge from how physical systems are modelled and approximated, rather than from a fundamental asymmetry in the laws themselves. The researchers noted that this perspective could have implications for ongoing work in quantum mechanics, thermodynamics, and cosmology on the origin of time’s arrow. Source: University of Surrey, Nature This article was generated with some help from AI and reviewed by an editor. Under Section 107 of the Copyright Act 1976, this material is used for the purpose of news reporting. Fair use is a use permitted by copyright statute that might otherwise be infringing
    • A bit premature... 100% Marketing. Bizarre.
  • Recent Achievements

    • Reacting Well
      BizSAR earned a badge
      Reacting Well
    • First Post
      AndreaB earned a badge
      First Post
    • Week One Done
      Huge Trailer earned a badge
      Week One Done
    • Week One Done
      Classifyskilleducation earned a badge
      Week One Done
    • One Month Later
      eurospharma62 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      581
    2. 2
      +Edouard
      182
    3. 3
      PsYcHoKiLLa
      75
    4. 4
      Michael Scrip
      73
    5. 5
      neufuse
      64
  • Tell a friend

    Love Neowin? Tell a friend!