Add GUI to Bash Scripts
HL-2170W Laserjet Reset Drum
5.0 out of 5 starsBefore you buy.... Simply reset the drum counter
October 24, 2013
Verified Purchase
I love my Brother HL-2170W printer and always get Brother brand toner for it. After using several toner cartridges, I started to get "replace the drum" messages but I ignored them because the print quality was fine. Then finally the 'Replace Drum' light came on and the printer refused to print at all. I ordered this Brother brand drum, and when I got it I saw in the instructions that I needed to reset the drum counter after installing the drum. (Keep the power on and the front door open. Hold down the ON button until all four lights light up, then release the button and close the door.)
Just for kicks, I put the old drum back into the printer and reset the drum counter. Sure enough, the printer is now all set, printing just fine. Someday, when the print quality suffers due to streaking, etc., I'll actually open up the new drum that I have just purchased and install it. In the meantime, I'll keep resetting the drum counter.
I wish I'd tried resetting the drum counter before I ordered this. But it's good to have it on hand, just in case.
Grep Only For Certain File Extension and Remove Warnings
grep -ir --include \*.conf "prdweb2" 2>/dev/null
XML Lint – XML Validation Recursive
Search direct and sub-directories, looking for invalid XML
Refer: https://www.commandlinefu.com/commands/view/7723/validate-all-xml-files-in-the-current-directory-and-below
$ find -type f -name "*.xml" -exec xmllint --noout {} \;
Backup of Firefox Settings
Refer: https://support.mozilla.org/en-US/questions/1126509
You can look at this extension:
- Password Exporter: https://addons.mozilla.org/firefox/addon/password-exporter/
You can copy files like these to the current Firefox profile folder to restore specific data.
- bookmarks and history: places.sqlite
- bookmark backups: JSON backups in the bookmarkbackups folder
- SQLite files like cookies.sqlite (cookies) and formhistory.sqlite (saved form data)
- logins.json and key3.db (decryption key) for Passwords saved in the Password Manager
- cert8.db and possibly cert_override.txt for (intermediate) certificates stored in the Certificate Manager
- persdict.dat for words you added to the spelling checker dictionary
- permissions.sqlite for Permissions and possibly content-prefs.sqlite for other Site Preferences
- sessionstore.js for open tabs and pinned tabs and tab groups
You can use this button to go to the current Firefox profile folder:
- Help > Troubleshooting Information > Profile Directory:
Windows: Show Folder; Linux: Open Directory; Mac: Show in Finder - http://kb.mozillazine.org/Profile_folder_-_Firefox
See also:
- https://support.mozilla.org/kb/restore-bookmarks-from-backup-or-move-them
- https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile
WD TV Live Streaming Media Player
Clear Thumbnails and then recycle power, turn off for 30 seconds and power on again:
Setup > System > Media Library > Clear Media Library
Also, default setting only has re-index when device is in standby mode
Get a list of Google Photo Folder Names
Go to https://photos.google.com and run from the browser console
Remove the quotes around the resulting string and import as a spreadsheet separated by tabs.
Refer: https://webapps.stackexchange.com/questions/90614/how-can-i-get-a-list-of-albums-in-google-photos
List of Folder Names
var links = document.getElementsByTagName('A');
var s = '';
for (var i = 0; i< links.length; i++) {
if (/\b(album|share)\b/.test(links[i].href)) {
var albumName = links[i].children[1].children[0].innerText;
s = s + albumName + '\t' + links[i].href + '\n';
}
}
List of Shared Albums
var links = document.getElementsByTagName('A');
var s = '';
for (var i = 0; i< links.length; i++) {
if (/\b(album|share)\b/.test(links[i].href)) {
s = s + links[i].innerText + '\t' + links[i].href + '\n';
}
}
Grep with SubString
Refer: https://stackoverflow.com/questions/38270261/how-to-extract-a-string-from-between-two-patterns-in-bash
Looking for parameter between -Dappdynamics.agent.nodeName= and closing space
$ ps aux | grep -i appdynamics | grep -oP '(?<= -Dappdynamics.agent.nodeName=)[^ ]+'
$ grep -oP '(?<= -Dappdynamics.agent.nodeName=)[^ ]+' input.txt
-o tells grep to only output the matching part(s) of each line.
-P activates support for PCREs (Perl-compatible regular expressions), which support look-behind assertions such as (?<= inet:), which allow a sub-expression (inet:, in this case) to participate in matching, without being captured (returned) as part of the matched string. [^ ]+ then simply captures everything after inet: up to the first space char. (character set [^ ] matches any char. that is not (^) a space, and + matches this set 1 or more times).
Disable Autoplay in Firefox
Type about:config into the URL bar, and confirm you'll be careful by clicking the I'll be careful, I promise button. 2. Search for the string labeled media.autoplay and double-click it to flip its status to off. Opera and Chrome have an extension that prevents videos from playing automatically.
