If your mount.cifs has stopped working, try adding -o vers=3.0

If you have been using “mount.cifs …” or “sudo mount.cifs …” to mount a share located on a Windows machine in Linux, and it stops working after any kind of update or change to your network, try adding -o vers=3.0, or if you are already using some -o options, add vers=3.0 to the list (separated from any existing -o options by a comma). You could also try 2.0 rather than 3.0, but by default it tries to use 1.0 as the SMB protocol version, and Microsoft has removed support for that in some versions of Windows. So if you get a Windows upgrade that removes the 1.0 protocol, your existing mount-cifs invocation line may stop working, but it appears that sometimes other changes in the network can trigger this as well. The vers= option is explained on the mount.cifs man page as follows:

SMB protocol version. Allowed values are:

  • 1.0 – The classic CIFS/SMBv1 protocol. This is the default.
  • 2.0 – The SMBv2.002 protocol. This was initially introduced in Windows Vista Service Pack 1, and Windows Server 2008. Note that the initial release version of Windows Vista spoke a slightly different dialect
    (2.000) that is not supported.
  • 2.1 – The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2.
  • 3.0 – The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012.

Note too that while this option governs the protocol version used, not all features of each version are available.

So, a typical invocation to mount a Windows share accessible by all users of the machine might now look something like this:

sudo mount.cifs //WindowsIPaddress/WindowsShareName /path/to/mountpoint/ -o user=WindowsUserName,password=WindowsUserPassword,vers=3.0,uid=1000,gid=1000

(The bolded part above is all one line.)

Cronopete – An Apple Time Machine Clone For Linux

If you use Mac OS, you certainly have known about or used Time machine. It is a backup software application distributed with the Apple’s Mac OS X. It is used to backup your data to an external drive, so that you can restore them later from the backup. If you are a fan boy/girl of Time Machine, you need to check out “Cronopete”. It is the clone of Time Machine for Linux operating systems. Using Cronopete, we can easily create periodic backups of a Linux system. It supports popular Linux distributions, including Arch Linux, Debian, Fedora, and Ubuntu.

In this brief guide, we are going to see how to install and use Cronopete in Linux to backup and restore data.

Source: Cronopete – An Apple’s Time Machine Clone For Linux – OSTechNix
Related link: Easy Linux backup software with Time Machine like functionality | Nuxified.org

fkill – Interactive Tool to Kill Processes in Linux

In this guide, I’ll demonstrate how you can use fkill-cli to easily kill a process on Linux. fkill-cli is a command line tool written in Nodejs which makes process management on Linux, macOS, and Windows simpler. It provides a guided way to kill a running process with support for a search to easily filter process by name.

Source: fkill – Interactive Tool to Kill Processes in Linux (LinOxide)

How to Use Truncate Command in Linux

Welcome to our guide on how to use Truncate Command in Linux. The Linux truncate command is often used to shrink or extend the size of each FILE to the specified size. The final size of the file depends on the initial. If a FILE (for example archive or log files) is larger than the specified size, the extra data is lost, but if a FILE is shorter, it is extended and the extended part (hole) reads as zero bytes.

Source: How to Use Truncate Command in Linux (LinOxide)

If you Mac (particularly Mac Mini) goes to sleep or hibernates even though you have disabled sleep in the Energy Saver settings, try this

UPDATED March 19, 2018:

Apple Mac desktop system users (particularly Mac Mini users) that have attempted to disable system sleep or hibernation may have discovered that no matter what changes are made in the Energy Saver pane in System Preferences, when they go away for a while and come back they are greeted by a progress bar (perhaps accompanied by the Apple logo, similar to what would be seen during a reboot) and the only way to recover is to press the power button briefly (which may not always work).

What is weird about this is that in some cases the system for the most part continues to operate normally in the background. So, it is not truly sleeping. If you have music playing, it will continue to play. If someone sends you an instant message, you’ll hear the notification tone. If you click somewhere along the bottom of the screen, if and when the display comes back you will see you have launched some random application from the dock, depending on where you clicked. And so on. But still, that damn Apple logo and progress bar will randomly appear when you wake up the screen.

So, here are some ways to try to fix this, that may or may not work for you. First, open the Terminal application and from the command prompt enter this:

sudo pmset -g

Enter your password when requested and it should show you the System-wide power settings. Note particularly the values for these settings: autopoweroff, hibernatemode, and standby. They SHOULD all have a value of 0 (zero). If any of them have any other value (particularly autopoweroff), then try running this:

sudo pmset -a autopoweroff 0 hibernatemode 0 standby 0

Or you can change any of the values individually, for example:

sudo pmset -a autopoweroff 0

Also, you should increase the standbydelay (the time in seconds before the Mac will try to sleep, and yes it is in seconds no matter what Apple documentation says) to a larger value:

sudo pmset -a standbydelay 86400

Then run sudo pmset -g again and make sure your change was saved. What you are doing is disabling a specific type of sleep mode that has been problematic for many users. If you find that you system still tries to go to sleep, and you have disabled sleep in the Energy Saver settings, then you may need to do one of two things. One is to open a new Terminal window and enter this:

caffeinate

and just let it run until you are ready to shut down your system. Or if that does not work, try disabling display sleep – go to the Energy Saver settings in System Preferences, and move the slider bar for “Turn display off after” all the way to the right, to the “Never” setting. It will warn you that this could shorten the life of your display, but this may be the only thing that actually works. You can always turn off your display using the power switch on the display itself, or if that is in a place that’s difficult to find or hard to press, you could plug the display’s power cord into a switched outlet (such as on a small surge protector strip) and use that switch to turn the display on and off.

Note that you may want to run sudo pmset -g again to make sure that none of the above three settings have changed, if either of the following occur:

1. You make a change to the Energy Saver settings, or

2. You reset the System Management Controller (SMC) on your Mac (note that if your Mac is unplugged or loses power for more than a few seconds, the SMC may be reset).

If any of the three settings mentioned above have changed to a non-zero value, change them back to zero.

I say to TRY this because even doing all this may only reduce the frequency of the sleep states, not eliminate them entirely. The thing that finally made the difference for me was to make the changes to the pmset settings and to disable display sleep completely. There is a real bug in MacOS that needs to be addressed to truly fix this.

For more information on this, search on “autopoweroff” in your favorite search engine.

How to Disable Error Report Dialog Pop-up in Ubuntu 18.04

After a fresh installation of Ubuntu desktop, applications run into problem occasionally and error reporting dialog boxes pop-up. By sending the error reports, you can help developers debugging program crashes. For those who don’t want to see the annoying pop-ups, here’s how to disable Ubuntu Apport error reporting.
Source: How to Disable Error Report Dialog Pop-up in Ubuntu 18.04 – Tips on Ubuntu

How to Exclude Specific Package from apt-get Upgrade

When working on some projects, sometimes you need the stability of your environment. Updating a package can cause the entire project to fail. Sometimes, we accidentally upgrade those packages which and this creates a serious issue on the server. This is why it can be important to maintain a specific version of a package. This article will show you how you can exclude a specific package from the upgrade on Ubuntu 16.04

Source: How to Exclude Specific Package from apt-get Upgrade (LinOxide)

How to Install Specific Version of Package using apt-get

To handle Debian-based system packages, we use the apt-get command. This command requires administrative rights to work. It contains several options that make it possible to manipulate the packages through some operations like the installation, update or deletion, and many others. The beautiful thing is the fact that it allows installing a specific version of a package […]

Source: How to Install Specific Version of Package using apt-get (LinOxide)

How to boot from a USB mass storage device on a Raspberry Pi

USB boot is available on the Raspberry Pi 3B, 3B+, 3A+ and Raspberry Pi 2B v1.2 models only.

This tutorial explains how to boot your Raspberry Pi from a USB mass storage device such as a flash drive or USB hard disk. Be warned that this feature is experimental and does not work with all USB mass storage devices. See this blog post from Gordon Hollingworth for an explanation of why some USB mass storage devices don’t work, as well as for some background information.

Source: How to boot from a USB mass storage device on a Raspberry Pi – Raspberry Pi Documentation
Related article: How to Boot Up Raspberry Pi 3 from External Hard Disk – Make Tech Easier

Why your game console or home VoIP PBX won’t work with OPNsense or pfSense, and how to fix it

If you have been using a standard router and decide to upgrade to OPNsense or pfSense (I personally recommend OPNsense, solely because of the heavy-handed moderation in the pfSense user forum, where a user can apparently get banned for life for even a small inadvertent infraction), you may find that making a game console or a VoIP PBX work isn’t as simple as just forwarding some ports. The other thing you have to do is shown in this video:

Although the video specifically mentions the PS4 and XBOX, the advice shown is equally valid for other types of game consoles and for home PBX servers. Note the section starting at 3:20 in the video, where the “Static Port” checkbox is checked – this is the key to making it work!

The OPNsense user interface will look a bit different than the one in pfSense but the principle is the same; you still need to make sure the “Static Port” checkbox is checked. And in either case, you may still need to do port forwarding, the same as you did on your previous router, but generally speaking port forwarding alone will not work until the additional configuration shown in the video is applied. Here’s an example of setting up a static port rule in OPNsense (note that the source address field refers to a previously-set alias for the IP address of the Asterisk PBX):

VoIP PBX users, there is one other thing you may need to do, at least in OPNsense, particularly if you find that you have a non-local extension that is unable to connect to your PBX. If you are using a Dynamic DNS address, make sure you go to System: Settings: Administration and put that dynamic DNS address in the “Alternate Hostnames” field.