Category Archives: sysadmin
How to hide Send Private Message and Send Public Message – BuddyPress User | https://buddyuser.com/
How to Hide Send Private Message and Send Public Message from the members profile view
Sometimes it becomes prudent to make it more difficult for site members to email other members, for example where you are suffering from spammers.
Where to put code Snippets
Code Snippets for BuddyPress can typically be placed in two locations:
/wp-content/themes/yourchildtheme/functions.php/wp-content/plugins/bp-custom.phpThe preference is to create a bp-custom.php file, since this is independent of the theme you happen to be using.
The code snippet must be wrapped in <?php and ?> tags in order to tell you server that it is to run the code as PHP.
Remove “Send Private Message” from users who are not friends of the member whose profile they are viewing
1 2 3 4 5 6 7add_filter( 'bp_get_send_message_button', function( $array ) { if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) { return $array; } else { return ''; } } );Remove “Send Public Message” from users who are not friends of the member whose profile they are viewing
1 2 3 4 5 6 7 8add_filter( 'bp_get_send_public_message_button', function( $r ) { if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) { return $r; } else { $r['component'] = ''; return $r; } } );These code snippets were originally posted by Henry Wright in the BuddyPress Forums:
https://buddypress.org/support/topic/disable-or-hide-private-message-button/
Source: How to hide Send Private Message and Send Public Message – BuddyPress User | https://buddyuser.com/
Turn Off Updates • mozillaZine Forums
Here is the policies documentation.
Manage updates, policies & customization
http://support.mozilla.org/en-US/produc … enterpriseCustomizing Firefox Using policies.json
http://support.mozilla.org/en-US/kb/cus … liciesjsonCreate a folder called distribution where the firefox.exe is located and place the policies.json file there.
- CODE: SELECT ALL
{
"policies": {
"DisableAppUpdate": true
}
}Customizing Firefox Using Group Policy
http://support.mozilla.org/en-US/kb/cus … cy-windowsLocal Group Policy Editor (gpedit.msc) is not available in Home versions of Windows 7, 8 or 10.
How to stop Firefox from showing the update nag screen?
http://superuser.com/questions/1407844Enterprise Policies
http://klaus-hartnegg.de/gpo/2018-05-26-Firefox-Policies.htmlEnterprise Policy Generator
http://addons.mozilla.org/firefox/addon/976971I never tried the Enterprise Policy Generator addon.
policies.json being removed on browser updates via setup.exe (wontfix)
http://bugzilla.mozilla.org/show_bug.cgi?id=1502188P.S.
I got the DisableAppUpdate policy working with the policies.json file in Firefox Portable 71.0 32-bit.
* C:\FirefoxPortable\App\Firefox\distribution\policies.json
However, I had to remove the following registry keys before I got it working.
* HKEY_CURRENT_USER\Software\Policies\Mozilla
* HKEY_LOCAL_MACHINE\SOFTWARE\Policies\MozillaHere is how to test if the DisableAppUpdate policy is working.
Test DisableAppUpdate policy: viewtopic.php?p=14848020#p14848020
Mozilla Enterprise Policies for Firefox and Thunderbird
![]()
The Mozilla Enterprise Policies for Firefox (and Thunderbird)
This feature is meant to help enterprise admins, who deploy Firefox as software package to computers in their organization.
Versions
Policies were first added in Firefox 60, and back then were purely optional.
In Firefox 68 some settings from autoconfig stopped working (for example the option to disable automatic updates), thus it became necessary to at least partially switch to policies.
Thunderbird started to implement policies in version 68, and at the same time also stopped respecting some of the autoconfig options.
Overview
The Enterprise Policy feature provides two new ways to configure Firefox (besides the old autoconfig aka mozilla.cfg):
- Windows Group Policy Objects (GPO)
- A config file named policies.json
Interactions:
- If any policies are set with GPO, the json file is ignored.
- If autoconfig (old) and policies (new) provide conflicting settings, policies win.
Requirements:
- Firefox version 60 or later.
- Thunderbird version 68 or later.
- In Windows some policies work only if you have either Firefox ESR or domain-joined PCs.
(It is currently unclear how Firefox detects the domain membership, and whether it must be an Active Directory domain)Howto use the admx templates (for GPO)
Firefox
- Copy firefox.admx to C:\Windows\PolicyDefinitions
- Copy firefox.adml to C:\Windows\PolicyDefinitions\en-US
- Run <class=”tt”>gpedit.msc or <class=”tt”>RSAT (Remote Server Administration Tools), and open Computer Configuration, Administrative Templates, Firefox.</class=”tt”></class=”tt”>
Thunderbird
Some of the Firefox policies also work in Thunderbird.
There are official (but non-functioning) admx-templates on https://github.com/thundernest/policy-templates. They are just a clone of the templates for Firefox, and thus do not have an effect on Thunderbird.
Inofficial templates are on https://github.com/drlellinger/thunderbird-policies (announced here), and they acually work.
- Copy thunderbird.admx to C:\Windows\PolicyDefinitions
- Copy thunderbird.adml to C:\Windows\PolicyDefinitions\en-US
- Run <class=”tt”>gpedit.msc or <class=”tt”>RSAT (Remote Server Administration Tools), and open Computer Configuration, Administrative Templates, Thunderbird.</class=”tt”></class=”tt”>
You can also copy registry keys from Firefox and rename them. For example this one works:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Thunderbird] "DisableAppUpdate"=dword:00000001Howto use create the json file (alternative for GPO)
The currently supported policies are listed here. New policies are added with every version, and so far all new policies are available both in the latest RR (Rapid Release), and in the latest ESR (Extended Service Release).
Multiple policies must be separated with commas. Multiple options to one policy must be placed in curly brackets, and separated with commas.
A Generator addon was published (german). More info.
The json file must be placed in a subdirectory named distribution in the program directory. In Windows the path will be something like
C:\Program Files\Mozilla Firefox\distribution\policies.json
This directory does usually not yet exist, you must create it.Sample file:
{ "policies": { "DisableAppUpdate": true, "DisableBuiltinPDFViewer": true, "DisableFirefoxAccounts": true, "DisableFirefoxStudies": true, "DisablePocket": true, "DisableProfileRefresh": true, "DisableTelemetry": true, "DontCheckDefaultBrowser": true, "EnableTrackingProtection": { "Value": true, "Locked": false }, "Proxy": { "Mode": "none", "Locked": false }, "SearchBar": "separate" } }Errors in the file are reported on the page “about:policies”, but this feature needs at least Firefox version 63. This is the typical way how Mozilla develops new feature: publish it long before its ready.
Howto not document a feature
Mozilla has created this labyrinth:
- https://wiki.mozilla.org/Firefox/EnterprisePolicies
- https://support.mozilla.org/en-US/products/firefox-enterprise/policies-customization-enterprise/policies-overview-enterprise
- https://developer.mozilla.org/Firefox/Enterprise_deployment
- https://support.mozilla.org/products/firefox-enterprise
- https://support.mozilla.org/products/firefox-enterprise/policies-customization-enterprise
- https://support.mozilla.org/kb/customizing-firefox-using-policiesjson
- https://github.com/mozilla/policy-templates/blob/master/README.md
It seems that Github is now the official place for documentation. But even there a lot of info is missing. For example that this is supposed to replace autoconfig. And that in Windows several of these options only work if either the ESR version is used, or the PCs are members of a Windows Domain. Also how do the two methods relate to each other and to autoconfig: which one does take precedence?
Lets hope that eventually Mozilla will write some decent documentation for this new feature.
No, I’m not gonna read the source to extract infos from there.
Changelog:
- 2018-10-22 Thunderbird
- 2018-09-17 corrected directory, add interactions, add sample
- 2018-05-31 cleanup
- 2018-05-30 add howto use the admx templates, and links to generator and source.
- 2018-05-25 new
Source: Mozilla Enterprise Policies for Firefox and Thunderbird
mod_rewrite Cheat Sheet by DaveChild
A mod_rewrite Cheat Sheet – a quick reference guide for mod_rewrite, with rewrite flags, regular expression syntax and sample rules.
mod_rewrite Tutorialsmod_rewrite RewriteRule Flags
mod_rewrite RewriteCond Flags
Redirection Header Codes
mod_rewrite Directives
|
Regular Expressions Syntax
There’s an excellent regular expression tester at: http://regexpal.com/
mod_rewrite Server Variables: HTTP Headers
mod_rewrite Server Variables: Server Internals
|
mod_rewrite Sample Rule: Site Moved
Rewrites domain.com to domain2.com
mod_rewrite Sample Rule: Temporary Page Move
Rewrites domain.com/page.html to domain.com/new_page.html
mod_rewrite Sample Rule: Nice URLs
Rewrites domain.com/category-name-1/ to domain.com/categories.php?name=category-name-1
mod_rewrite Server Variables: Special
mod_rewrite Server Variables: Request
mod_rewrite Server Variables: Time
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
filtering spam with procmail | http://www.benya.com/
This is a collection of procmail recipes which I use to pre-filter the incoming mail before letting SpamBayes take a crack at it. This combination seems to provide a fairly decent level of protection. Naturally, your mileage may vary.
procmail is a mail processor installed on most Linux systems and used to by the mail server to deliver mail to your mailbox. If your mail server is hosted on linux you may use procmail to remove spam and sort messages before they are placed into your mailbox. If, like me, you prefer to use pine in a shell window to check your e-mail, this type of filtering may be your only defense against spam.
In order to understand these recipes, at least some knowledge of procmail and regular expressions syntax is required. The basics can be learned from procmail man pages and from links on procmail home page. Here is a great procmail documentation project and a library of recipes
Spam filters and other useful procmail recipes
Source: filtering spam with procmail | http://www.benya.com/
The NSA Makes Ghidra, a Powerful Cybersecurity Tool, Open Source | WIRED
List of All Environment Variables in Windows 10
Windows Environment Variables List
ENVIRONMENT VARIABLE CORRESPONDING PATH %SystemDrive% C:\ (Operating System drive) %SystemRoot% C:\Windows %WINDIR% C:\Windows %HOMEDRIVE% C:\ (Operating System drive) %HOMEPATH% C:\Users\<Username> %USERPROFILE% C:\Users\<Username> %APPDATA% C:\Users\<Username>\AppData\Roaming %ALLUSERSPROFILE% C:\ProgramData %PROGRAMFILES% C:\Program Files %PROGRAMFILES(X86)% C:\Program Files (x86) %PROGRAMDATA% C:\ProgramData %TEMP% C:\Users\<Username>\AppData\Local\Temp %LOCALAPPDATA% C:\Users\<Username>\AppData\Local %PUBLIC% C:\Users\Public %COMMONPROGRAMFILES% C:\Program Files\Common Files %COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files
How to Uninstall Edge Chromium When Windows 10 Won’t Let You
Edge Chromium is a decent web browser. I’d even go as far as to say it’s worth swapping over to from Google Chrome, given its improvements with memory usage. However, Microsoft has been incredibly annoying about stuffing Edge Chromium down everyone’s throats, and a recent Windows update locks this browser into your OS even more.
The thing is, if you try to uninstall the browser from the Apps & Features menu in system settings, the “Uninstall” button next to Edge is now grayed out. If you’re like me, you probably hopped over to the Control Panel to uninstall it via the “Programs and Features” tab…except the update also removed Edge from the list of installed programs, so it can’t be uninstalled that way, either.
There’s a reason for this: some Microsoft apps require Edge to run properly, so Microsoft made it harder to uninstall Edge to avoid unnecessary issues that could be caused by its absence (and it just really wants you to use Edge).
This doesn’t mean Edge Chromium has to take up permanent residence on your computer—you’ll just have to get a little more creative to delete it. And no, you won’t break Windows by uninstalling Edge, though if all you intend to do is disable it and set a different browser as your default app, we’ll show you how to do that, too.
How to disable Edge and set a different default browser

Given Windows 10’s bug-ridden history and the OS’s reliance on Edge, it may be safer to just switch to a new browser instead of uninstalling it completely.
- Open the Start Menu
- Click Settings and go to Apps > Default apps.
- Scroll down and click “Web browser.”
- Select the browser you want to use, which you’ll obviously need to have first installed in order to make the switch. Check our lists for the best browsers for ad-blocking and the best browsers for privacy if you need recommendations.
- You can also unpin Edge from your taskbar by right-clicking the taskbar icon and selecting “Unpin from taskbar.”
This will hide Edge most of the time, but Windows will still occasionally suggest using the browser, and some apps will open links in Edge even after changing the default program—but you can delete it from your PC if those behaviors bug you.
How to uninstall Edge Chromium
Despite Microsoft’s efforts to prevent users from delete Edge, you can uninstall it from Windows 10 with some simple PowerShell wizardry. We’ll cover two possible options just in case one doesn’t work for you.
Method one:

- Open Windows File Explorer
- Type “C:\Program Files (x86)\Microsoft\Edge\Application” into the address bar and hit Enter. This should open the Edge installation folder—if not, try navigating to the folder manually, or search for “Edge” in File Explorer.
- There should be a folder with a numerical name. The name is the same as the current version of Edge installed on your PC. For example, at the time of writing, the folder on my machine is “83.0.478.58.” Open that folder.
- Find and open the “Installer” folder.
- In this folder, click the “File” tab in the upper-left of the File Explorer window, then go to File > Open Windows PowerShell > Open Windows PowerShell as administrator.
- Click “Yes” when prompted to allow the program to make changes to your system.
- Type
.\setup.exe -uninstall -system-level -verbose-logging -force-uninstallinto PowerShell and press Enter to run the command and let it run.
Assuming everything went according to plan, Edge should now be uninstalled. However, if this method doesn’t work for you, there’s another option you can try.
Method 2:

- Search for “PowerShell” from the taskbar or Windows Start menu.
- Right-click “Windows PowerShell” from the search results and select “Run as an administrator.”
- Select “Yes” when asked if the program is allowed to make changes to your system.
- In the PowerShell window, type
get-appxpackage *edge*and press Enter. - Several lines of information will show up. Look for “PackageFullName” and copy the text in the column.
- Type
remove-appxpackageinto PowerShell and paste the text you copied from the PackafeFullName column. - Press Enter to run the command. Edge should now be removed from your system.
This story was updated to add more information on why Microsoft is preventing the browser from being removed, plus two additional methods for removing/disabling the browser.
Source: How to Uninstall Edge Chromium When Windows 10 Won’t Let You
Deep scriptblock logging: Record PowerShell commands in the event log
As a powerful tool, PowerShell is not only of interest for admins but also for hackers. To detect suspicious activities, it is helpful to have all executed commands recorded. In addition to recording the history in a text file, PowerShell has also supported logging in the event log since version 5.
Source: Deep scriptblock logging: Record PowerShell commands in the event log


