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

    • I'm still on Windows 10 22H2 because I didn't want to deal with all the issues in Windows 11, so I waited almost a week before installing the latest Patch Tuesday update (KB5094127), I went ahead and did it, and it was a huge mistake—ever since then, my File Explorer has seen a performance drop of about 30% when transferring large files... Once again, Microsoft has outdone itself! This update cannot be uninstalled, either through the Control Panel (via Settings) or by accessing Advanced Startup Options. The only possible alternative would be to use system restore points, but I’d have to reinstall all app and driver updates (and there’s no guarantee it would work). Or there’s the “nuclear option” of a in-place repair without losing files or apps, but even then, all my customizations would be lost! Microsoft just can’t help but mess everything up! Way to go, Microsoft! But I still don’t want your c****y Windows 11!
    • Microsoft: Windows 11 could finally solve a major issue across AMD, Nvidia, and Intel GPUs by Sayan Sen While Microsoft has been trying to improve it, Windows 11 is definitely not flawless, as even today some issues are taking a year to publicly acknowledge. However, one area of trouble that may finally see much better results soon is graphics driver crashes. Work on graphics driver timeouts, also called Timeout and Detection Recovery (TDR), is not new as the latest WDDM 3.2 also has specific improvements regarding it. Windows Display Driver Model (WDDM) version 3.2 is supported on Windows 11 24H2 and 25H2. However, with the upcoming version 26H2, TDR crash diagnosis could go to the next level as Microsoft is introducing a new DirectX 12 API feature called "DirectX Dump Files". Similar to how system memory dump files work when a system crashes or freezes or encounters any such major issue, DirectX Dump Files (DDF) will essentially record a snapshot of the GPU execution right at the moment a graphics-related crash or hang or freeze occurs, so that developers can better understand and diagnoze these TDR and timeout detection errors. The dump will be available as a .dxdmp file for analysis and it will be a comprehensive dump file generated with detailed insights about the hardware, drivers, Windows, as well as the affected application. This should be another welcome change in this department. Earlier at GDC 2026, when the technology was first debuted, Microsoft had shared more details regarding it. The company had explained how DDF is designed to gather data from every layer of the graphics stack into a single file, eliminating the need for developers to manually correlate logs from multiple tools. As mentioned above, the dump can contain a lot of useful details like GPU hardware state information such as register values, shader program counters, page fault virtual addresses, shader memory data, and command buffers. Alongside that, it also captures DirectX runtime and kernel information, including D3D objects, pipeline state objects, device error data, adapter details, and CPU call stacks. Microsoft says the feature has been built around two primary use cases: retail device removals and local device removals. The former allows developers to collect crash information from end users' systems in the field, while the latter helps QA teams and developers investigate issues on test machines. Developers will also be able to include up to 2 MB of custom application data through new D3D12 APIs, providing additional context for troubleshooting. In addition, Microsoft is introducing three dump collection modes ranging from zero-overhead capture, which has no runtime performance impact on supported hardware, to higher-detail modes that collect more vendor-specific debugging data. On compatible Tier 2 hardware, zero-overhead dumps will be enabled by default, meaning developers may begin receiving useful crash diagnostics without making any code changes. The table below explains the three tiers: Tier Description NO_OVERHEAD Enables crash capture with no runtime cost and is suitable for broad deployment MEDIUM_OVERHEAD Provides a balance, capturing additional diagnostic data with moderate impact HIGH_OVERHEAD Collects the most detailed GPU and driver state available, enabling deeper investigation at the cost of higher runtime overhead In terms of availability, the company expects broader release to be around the fall of 2026, which should be right around the time when Windows 11 version 26H2 lands. Right now, DirectX Dump Files are available as a preview and currently, only AMD has the compatible AgilitySDK Developer Preview driver version 26.10.07.02. You can find the official announcement post here on Microsoft's website.
    • And with SO much better perf than the laggy mess that is Files.
    • BrowserOS 0.46.0 by Razvan Serea BrowserOS is a free, open-source Chromium-based browser that runs AI agents natively, offering a smarter, more productive browsing experience. It supports Chrome extensions and integrates AI agents to automate tasks, fill forms, and streamline workflows. Your data stays on your computer: you can use your own API keys or run local models via Ollama, making it a privacy-first alternative to tools like Perplexity, Comet, or Dia. With built-in productivity tools and app integrations, BrowserOS boosts efficiency while keeping control firmly in your hands. Being Chromium-based, BrowserOS lets you effortlessly import your bookmarks, passwords, and Chrome extensions in just a few clicks. BrowserOS works with OpenAI GPT models, Anthropic Claude, Google Gemini, and local AI models via Ollama or LMStudio. You can use your own API keys and effortlessly switch between providers. BrowserOS Agent Your AI productivity assistant that organizes and manages your browsing effortlessly Quickly list, group, or close tabs Save and resume browsing sessions Search your history and organize bookmarks Switch instantly to the tab you need BrowserOS Navigator – Automate web tasks with ease Navigate websites and search automatically Interact with pages without manual effort Handle repetitive tasks in seconds What makes BrowserOS special Feels like home - same familiar interface as Google Chrome, works with all your extensions AI agents that run on YOUR browser, not in the cloud Privacy first - bring your own keys or use local models with Ollama. Your browsing history stays on your computer Open source and community driven - see exactly what's happening under the hood MCP store to one-click install popular MCPs and use them directly in the browser bar (coming soon) Built-in AI ad blocker that works across more scenarios! BrowserOS 0.46.0 changelog: Run Claude Code & Codex right in your browser — We've extended the agent harness to bring full coding agents into BrowserOS. Claude Code and Codex now come bundled and plug straight into the assistant, so you can drive your browser with the agent — and the subscription — you already use. A brand new experience — A redesigned new tab, a calmer composer, and a rebuilt command center for switching between agents. The whole assistant is cleaner, faster to reach, and easier to live in. New MCP tools — We rebuilt the browser tool surface from the ground up — a tighter, more reliable set of tools for agents to drive the browser. Plus one-click install of BrowserOS as an MCP server into the agents you already run, with automatic URL sync. Chromium 148 — Updated to the latest Chromium base with all recent upstream fixes and security patches. Streamlined — We've pulled back a few features that weren't getting much use — Skills, Soul, and Memory — so we can focus and ship better versions of them soon. Download: BrowserOS 0.46.0 | 181.0 MB (Open Source) Download: BrowserOS for macOS | 485.0 MB Links: BrowserOS Homepage | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • First Post
      BizSAR earned a badge
      First Post
    • Week One Done
      Jordan Smith earned a badge
      Week One Done
    • 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
  • Popular Contributors

    1. 1
      +primortal
      596
    2. 2
      +Edouard
      188
    3. 3
      PsYcHoKiLLa
      80
    4. 4
      Michael Scrip
      76
    5. 5
      Steven P.
      67
  • Tell a friend

    Love Neowin? Tell a friend!