Bing has several search engine shortcuts and advanced features that can be used to get better and accurate search results. These Bing search tips and tricks will help you narrow down search results to find exactly what you are looking for.
Source: 23 Advanced Bing Search Tips And Tricks You Should Know (Fossbytes)
Ever wondered why programming in Bash is so difficult? Bash employs the same constructs as traditional programming languages; however, under the hood, the logic is rather different.
Source: Understanding Bash: Elements of Programming | Linux Journal
I knew that day that the Shortcuts app has paved the way for automation in iPhone, but I didn’t realize that it can also be used to keep a track on the proliferating police abuse.
Source: This Siri Shortcut Automatically Triggers Camera Every Time Cops Pull You Over (Fossbytes)
Every so often something really useful appears on Reddit, and this is such a case. You may encounter a situation where you want to execute the contents of a bash script, but not more frequently than every few seconds. A Reddit user wanted to know How to check if a command in .bashrc has been executed within last 10 seconds if yes don’t execute the command again. The response by Reddit user mdaffin is brilliant in its simplicity, and can be used in any bash script where you don’t want the contents executed too often:
Write a time stamp to some file, check said file before you run the command if now – timestamp > 10s run the command and update the timestamp.
EDIT: Like this (with modification times instead):
if [[ ! -f "$TS_FILE" ]] || [[ "$(expr "$(date +%s)" - "$(stat -c %Y "$TS_FILE")")" -gt 10 ]]; then
You’d replace the
echo "running" line with the part of the bash script you want to run only if it’s been 10 seconds since the last time the script was run, or whatever number of seconds you specify after the
-gt. If the bash script actually outputs a file as part of its normal operation then you could specify that file in the
TS_FILE= line; there would be no need to create a separate timestamp file (unless some other process could also modify that same file).
This doesn’t actually stop the bash script from running; it just prevents it from executing the part of the script that you don’t want executed too frequently. This could be very useful in a situation where without such protection, the too-frequent execution of the script might cause something undesirable to happen (such as getting locked out of an online site for hammering it with requests). Depending on the situation there may be other, perhaps even better ways to avoid this possibility, but in other cases this may indeed be the best approach.
Grepping is awesome, as long as you don’t glob it up! This article covers some grep and regex basics.
Source: Globbing and Regex: So Similar, So Different | Linux Journal
SSH-key-based authentication provides a more secure alternative to password-based authentication. In this tutorial we’ll learn how to set up SSH key-based authentication on a Debian 9 installation.
Source: How to Set Up SSH Keys on Debian 9 | DigitalOcean
Some websites don’t allow copying and pasting into input fields. Use this add-on to enable copying and pasting at sites that don’t allow it.
Source: Unblock Copy and Paste in Chrome and Firefox | Gizmo’s Freeware
I almost always setup a samba share on every Raspberry Pi I install, it allows me to easily share files and work on my projects – so I thought I had better write down how I do it.
Source: Setup Raspberry Pi Samba share (Stuff about code)
If you’re trying to remove a Time Machine backup from a drive and find that it’s stuck in the Mac Trash with a specific error message stating the trash can’t be emptied because “Some items in the Trash cannot be deleted because of System Integrity Protection”, then read on to learn how to resolve this particular Time Machine backup removal problem.
Source: How to Remove Stuck Time Machine Backups from Mac Trash Due to System Integrity Protection Error
We originally set out to do this because we were having problems getting an older model laser printer, specifically a Konica Minolta PP1350W, to work with MacOS High Sierra (10.13). With previous versions of MacOS we’d been able to connect the printer directly to the computer, and with some fiddling with drivers and other software, get it to work. But newer versions of MacOS seem to be far less tolerant of this, and we had a spare Raspberry Pi, so the idea came to us to use the Raspberry Pi as a bridge between the printer and any computers on the local network from which we wanted to be able to print. The bonus is that the printer is no longer tethered to a single machine, but instead can potentially be used by any computer on the local network.
You do not need to have a Raspberry Pi to make this work – any computer that can run Linux will do. And of course the Raspberry Pi or other Linux computer can be used for other purposes besides this. We do not guarantee that this technique will work for every older printer out there, but this will work with a surprising number of them.
Source: Convert an older model USB printer to a networked printer using a Raspberry Pi or other Linux-based computer — also works well for making an older printer compatible with a newer version of MacOS – Two “Sort Of” Tech Guys