How to setup sendmail to relay outgoing emails

If you don’t use postfix and just sendmail to sendmail may want to relay your emails to your relay server.

Navigate to /etc/mail/sendmail.mc

then add define(`SMART_HOST’, `relay.exmple.com’)dnl

sudo service sendmail restart

You can then check your logs on /var/log/mail.err to see if it’s all working.

How to fix Iphone stuck in headphones mode – set of fixes.

have to say it’s amazing how many different fixes can fix this problem!!! Apple go back to work!

List of things that I have already tried:

  1. Replaced the headphone/charging port.
  2. Replaced ear speaker
  3. Reset the iPhone. Press and hold Sleep/Wake button and Home button together until Apple logo appears.
  4. Factory Full Reset and setup as new iphone
  5. Play a song (lengthy duration) and allow iPhone to completely lock.Now insert iPhone compatible headset jack.Unlock iPhone. Stop audio and unplug jack.
  6. Plug in headset when phone is locked.Hold down power button. It will bring “slide to power off” bar.Now remove the headphones.

    Press the “cancel” button at the bottom of the screen.

    Now check the sound.

  7. Signing up for Beta and Updating to the latest software.
  8. Turned off/flicked keyboard clicks in Sounds option.
  9. Checked for  LCI Liquid Contact Indicator https://support.apple.com/en-us/HT204104 ( All good)
  10. Cleanup headphone jack before replacing the board (there are little metal balls which can get stuck)
  11. Go to Sound and Try to play some ringtones (you can hear ringtones but it did not switched back)
  12. Turning on “Airplane” mode then adjusting the volume up and down.
  13. set an alarm, let that go off, and the headphone mode turned off!
  14. Play with the ringtones in the settings keep flipping the mute switch and volume keys. And rebooting the phone it worked for me
  15. plugged the apple headphones in and out it
  16. 5/10 minutes of hairdryer on the cold setting
  17. Restore Phone using DFU method and Itunes
  18. Clean logic board connector which connect headphones/thunderbird using 99 isoprop
  19. plugged in my headphones, opened my Control Center, and then pulled them out
  20. Try to use Isopropyl alhocal to clean the speaker/microphone Thunderbird connector.

 

Installing Mediawiki with Vision Editor, parsoid active directory as private wiki notes/fixes

My Notes:

Setup: Mediawiki 1.27

AD: Windows 2012

Web Server: Linux Debian

Installing missing libraries first:

  • php5-curl
  • stunnel4
  • curl

GOLDEN RULES:

  • Make sure that the correct spacing is set in parsoid.conf

  • Make sure that it has started by checking the /var/log/parsoid.log

  • Mare sure that you enables stunnel after in etc/default/stunnel4

Change to one to enable stunnel automatic startup
ENABLED=1

Add to Wiki config: LocalSettings.php

\\ Make Wiki Private

$wgGroupPermissions[‘*’][‘read’] = false;
$wgGroupPermissions[‘*’][‘edit’] = false;

\\Enable API for VisionEditor //Parsoid

$wgEnableAPI=true;

\\ Configure LDAP

require_once( “$IP/extensions/LdapAuthentication/LdapAuthentication.php” );
require_once(“includes/AuthPlugin.php”);
$wgLDAPDebug=3;
$wgAuth = new LdapAuthenticationPlugin();
$wgDebugLogGroups[‘ldap’] = ‘/tmp/mediawikiADDebug.log’;
$wgShowExceptionDetails = true; //for debugging MediaWiki

\\LDAP AD config

$wgLDAPDomainNames = array(
 ‘domain.int’,
);

$wgLDAPServerNames = array(
 ‘domain.int’ => ‘myserverName.domain.int myServerName2.domain.int’,
 );

$wgLDAPEncryptionType = array(
 ‘domain.int’ => ‘tls’,
);

$wgLDAPSearchStrings = array(
 ‘domain.int’ => “domain\\USER-NAME”,
 );

//Enable Visual Editor

wfLoadExtension( ‘VisualEditor’ );
// Enable by default for everybody

$wgDefaultUserOptions[‘visualeditor-enable’] = 1;
$wgVirtualRestConfig[‘modules’][‘parsoid’] = array(
// Use port 8142 if you use the Debian package or 8143 if running parsoid under https
 ‘url’ => ‘https://wiki.domain.int:8143’, // or use 8142 if you don’t use stunnel4
 ‘domain’ => ‘domain.int’,
 );

https://www.mediawiki.org/wiki/Extension:VisualEditor

Linking with Parsoid in private wikis

Forwarding Cookies to Parsoid
// This feature requires a non-locking session store. The default session store will not work and
// will cause deadlocks (connection timeouts from Parsoid) when trying to use this feature.
$wgSessionsInObjectCache = true;

// Forward users' Cookie: headers to Parsoid. Required for private wikis (login required to read).
// If the wiki is not private (i.e. $wgGroupPermissions['*']['read'] is true) this configuration
// variable will be ignored.
//
// WARNING: ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS
// of sending Cookie headers to Parsoid over HTTP. For security reasons, it is strongly recommended
// that $wgVirtualRestConfig['modules']['parsoid']['url'] be pointed to localhost if this setting is enabled.
$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;

Parsoid over HTTPS

By default, Parsoid only supports HTTP connections. However, it’s easy to provide HTTPS Parsoid by using Stunnel, a utility which offers SSL wrapping for arbitrary sockets. Most Unix distributions have ‘stunnel’ or ‘stunnel4’ package available from the repository. The following config file shard (e.g. /etc/stunnel/parsoid.conf) should do the trick:

cert = /etc/ssl/my_certs/parsoid.crt
key = /etc/ssl/my_keys/mykey.key
CAfile = /etc/ssl/my_ca/ca.crt

[parsoid]
accept  = 8143
connect = 8142

 

How to fix W: Duplicate sources.list entry http://apt.newrelic.com/debian/ newrelic/non-free amd64 Packages (/var/lib/apt/lists/apt.newrelic.com_debian_dists_newrelic_non-free_binary-amd64_Packages)

How to fix this error ?

W: Duplicate sources.list entry http://apt.newrelic.com/debian/ newrelic/non-free amd64 Packages (/var/lib/apt/lists/apt.newrelic.com_debian_dists_newrelic_non-free_binary-amd64_Packages)

This comes on my hosting once you typed in apt-get update.

The resolution is pretty simple if you know where to look to for and they don’t make it easy.

Instead of navigating to

$cd /etc/apt/

you need to navigate to:

# cd /etc/apt/sources.list.d/ and edit newrelic file

it might just simpler to type:

$vim /etc/apt/sources.list.d/newrelic.list

and edit to file from:

deb http://apt.newrelic.com/debian newrelic non-free

deb http://apt.newrelic.com/debian newrelic non-free

So you need to remove one line and run apt-get update again.

Problem solved!

Or simply you can use this command to find where it is

grep -rnw /etc/ -e “deb http://apt.newrelic.com/debian”
/etc/apt/sources.list.d/newrelic.list:1:deb http://apt.newrelic.com/debian/ newrelic non-free

Kaspersky How to fix database updates

If the database is not updating even if the “Update task worked” then follow the below

1. Log in to the Kaspersky Management console.

2. Navigate to affected server.

3. Run Database Update task.

4. Check if the task worked by checking the database timestamp in the Application->Kaspersky Server-> Database Date. If the timestamp hasn’t changed then do the following

5. Under Application Stop/Start Kaspersky Server.

6. Under Task Run a Database Rollback

7. Under Taks Run the database Update.

8. Go out of the server and refresh the view.

9. Check the database timestamp but it should be “green” already.

How to fix Less than 25% free in the configuration cache for Zabbix

  1. Remove old disabled host in configuration tab. This will free up your cache.
  2. Allow more cache in zabbix e.g change default value from 8mb to 16mb and restart zabbix servic /etc/ini.d/zabbix_server restart
 ### Option: CacheSize
   #       Size of configuration cache, in bytes.
   #       Shared memory size for storing host, item and trigger data.
   #
   # Mandatory: no
   # Range: 128K-8G
   # Default:
   # CacheSize=8M

How to Install MediaWiki with MySQL and PHP and LDAP/AD extension

Assumptions:

System: Linux Debian with PHP and Apache web server already installed and running.

Install the following:

  1. apt-get install mysql-server
  2. apt-get install php5-mysql
  3. Download wiki https://www.mediawiki.org/wiki/Manual:Installation_guide
  4. Setup Apache site then a2ensmode Name to enable it.
  5. Setup database for wiki follow this https://www.mediawiki.org/wiki/Manual:Installing_MediaWiki

mysql -u root -p

CREATE DATABASE wikidb;
GRANT ALL PRIVILEGES ON wikidb.* TO 'wikiuser'@'localhost' IDENTIFIED BY 'password';

6. Restart apache.

service apache2 restart

If the Wiki is not showing mysql then you need to restart service.

7. Install LDAP support for php.

on ubuntu apt-get install php5-ldap

8. Restart apache – service apache2 restart

9. Download ldap extention from wiki

https://www.mediawiki.org/wiki/Extension:LDAP_Authentication/Configuration_Options

then clik on the download the snapshot for the correct version then unpack

tar -xzf LdapAuthentication-REL1_28-770c89e.tar.gz -C /var/www/mediawiki/extensions

10. Run the updater php maintenance/update.php

If you get the following error then you need to run the update script again!

A database query error has occurred. This may indicate a bug in the software.[a6131d2bdeda3f290ca8cc67] 2017-02-15 11:28:39: Fatal exception of type “DBQueryError”

You need to have a ldap_domain table created in wiki database. You can run double check if it’s there by logging to mysql

mysql -p -u root

then show databases; use wikidb; show tables; you should see the ldap_domains

Once you setup ldap you will no longer be able to access the Admin account. Log first as a ldap/ad user then log in to mysql

mysql -p -u root

show databases;

use yourdatabase;

select * from user; (to get your user _id)

then run the following (2 is my user_id)

INSERT INTO user_groups (ug_user,ug_group) VALUES (2,”bureaucrat”);

Once completed log to wiki and you will have a full rights to it.

Once you LDAP setup is ready you may wan to change from clear to tls/ssl in the LocalSettings.php section.

To get ssl/tls working you need to trust the certification from your active directory.

  1. Get a Certification

openssl s_client -connect yourdomaincontroller-dc1:636

copy all section from ——-BEGIN to END —- Certficate

Install ldap-utils

apt-get install ldap-utils

Open up vim /etc/ldap/ldap.conf

then look for entry

TLS_CACERT /etc/ssl/certs/ca-certificates.crt

open up vim /etc/ssl/certs/ca-certificates.crt and paste your Certificate to the end.

I have found that this works only temporary until you run update-ca-certificates.

To get this permamment.

create a local file with certificates e.g local-ca.crt then copy it to /usr/local/share/ca-certificates and run update-ca-certificates.

Restart apache service apache2 restart

It should be working now.

If you have the following error  DatabaseBase::factory no viable database extension found for type ‘mysql’ then you need to install apt-get install php5-mysql and service apache2 restart.