How to find out the IP-address of a remote desktop client on Windows server

From a command shell (cmd) issue the command:

netstat -a | find “:3389” | find “ESTABLISHED”

This will a result in a list of all remote IP-addresses connected using RDP to the server.

If the server is using a non-standard port for RDP, replace 3389 with the non-standard port.

Microsoft remote desktop (RDP) shows black screen after login [SOLUTION]

After connecting by remote desktop to a machine, the initial welcome screen is displayed then the screen goes black.

Press CTRL-ALT-END and wait (it might take a while). When the Cancel button is visible, hit Cancel. Now the screen goes back to normal.

How to remove unwanted formatting, like class=”MsoNormal”, in Joomla content

If a content administrator pastes text containing styling into the editor in Joomla, the formatting is kept as it is in the source (another web page or a Microsoft Office Word document for example). The general idea using a template on a website is that the template should control the looks of headers, paragraphs etc. By keeping the formatting on the pasted text, it will cause your website to have a variety of fonts, styles and sizes.

It can also be a problem when a content administrator receives text material for the website, it can be written in Microsoft Office Word, causing a paste to include unwanted formatting, like the class=”MsoNormal” (Mso = Microsoft Office formatting).

This solution removes all class and style tags from the content. This means the user will no longer be able to set a different font style or size on the content. So that will be entirely controlled by the template. However, if you as the super super admin, who knows what you are doing, need to be able to create content with class and style you can add an unfilterered group for your own account. Note that if your content then is being edited and saved by a filtered user, your classes and styles will be lost.

We assume for this example that all content administrators are Super Users.

  1. Go to System -> Global options -> Text filters
  2. For Super Users, select Filter type = My own blacklist
  3. In the column Filter tags enter span
  4. In the column Filter attributes enter class,style
  5. Click Save

If you need to be able to save unfiltered content for a user, such as yourself, do this:

  1. Go to Users -> Groups
  2. Click New to add a new group
  3. Name it Unfiltered and make it a subgroup to Super Users
  4. Click Save & Close
  5. Go to Users -> Users
  6. Click on the user you want to edit (presumbaly yourself)
  7. Click on the Groups tab
  8. Unselect Super Users and select Unfiltered (make sure it really is a subgroup to Super Users, otherwise you have just removed your accounts super users priviliges)
  9. Click Save & Close
  10. Go to System -> Global settings -> Text filters 
  11. Make sure the group Unfiltered has No filtering selected as Filter type
  12. Click Save

 

Delete old PHP5 session files automatically

If not specified the PHP5 session files will be located in a directory like /var/lib/php5 and the builtin garbage collection will delete them, normally after 24 hours.

But often systems like CMS:es will put session files somewhere else and if the system doesn’t have it’s own garbage collection those session files will be kept forever. The reason can be to let a website visitor click “keep me logged in” or to remember a visitors preferences on the website. This normally doesn’t impose a problem as these session files are very small and the number of them counts in hundreds or possibly a couple of thousand files.

However, I encountered a site that created a very large number of session files and kept them forever. At some point the session files count was in the range of millions of files causing the system to run out of inodes. A solution could be to investigate how the system was handling session files but the internal workings of the site was outside of my responsibility. Another solution was to increase inodes but this will be a temporary solution.

The solution chosen was to create a garbage collection routine for the site in question, that deleted session files older than x days. The oldest session files was over 4 years old. The decision was to delete all session files older than a month (30 days), causing visitors who logged in, or had their preferences set, for more than a month ago had to re-login or set their preferences again on their next visit to the site. This was accomplished by the following command (which is run by cron every night):

find /var/www/somedomain.com/web/var/session/ -type f -mtime +30 -exec rm {} \;

bigclivedotcom Youtube channel

bigclivedotcom is a Youtube channel operated by Clive from Isle of Man. He dissects and investigates all kinds of electronics stuff, mostly ordered from questionable eBay sources. If you are into electronics this is a really enjoyable channel.

Unwanted code is displayed on Joomla articles when caching is enabled

Unwanted code, like below, is displayed on articles when System -> Global settings -> Cache is set to ON (both for conservative and progressive caching). The first time the article is loaded it looks ok but when reloading it garbage code like below is displayed. System is Joomla 3.4.8.

Example of unwanted code displayed:

{idkey=7001b0[url=http%3A%2F%2Fsomedomain.com%2Fom-site][title=Om+oss][desc=+%7Bloadposition+undermeny_4_text%7D+%7Bloadposition+undermeny_4_bild%7D+]}{cmp_start idkey=9514[url=http%3A%2F%2Fdomedomain.com%2Fom-site][title=Om+oss][desc=+%7Bloadposition+undermeny_4_text%7D+%7Bloadposition+undermeny_4_bild%7D+]}

This is generally caused by a third party plugin. To track down which one is causing this you need to disable plugins one by one and clear the cache before reloading (reload at least twice).

In my case, it was a plugin called Content – Facebook-Twitter-Google+1 causing the trouble. I tried reordering the plugin, from first to last without any success so I simply just had to ditch it and find another one.

I found out that the BT Social Sharing plugin was a better alternative. Apart from not giving the above trouble it doesn’t slow down the site as the Facebook-Twitter-Google+1 plugin did.

Telldus net and NEXA PER-1500 remote controlled switch

The NEXA PER-1500 remote controlled switch works fine with Telldus net. This unit does not have a learn button. Instead it goes into learn mode for about 5 seconds when power is applied and that is indicated by the LED blinking. To add the NEXA to to Telldus Live:

  • The NEXA PER-1500 should be disconnected from power
  • Log in to Telldus live and add new device
  • Select NEXA -> Self learning on/off
  • Power on the NEXA PER-1500 and immidiately click the Learn button in Telldus Live. You might need to hit it a couple of times.
  • The NEXA PER-1500 will click it’s relay to verify the pairing

Troubleshooting:

  • The NEXA PER-1500 can be paired to maximum 6 devices. If you are not certain there is a free memory slot, clear all memories by using the remote control. Power on the NEXA PER-1500 and while the LED is blinking you hit ALL OFF on the remote control
  • When pairing the NEXA PER-1500 with Telldus net it needs to be very close to the unit (I paired it within 1 meter from it). When paired it will work on further distances.

Joomla 1.5 PHP fatal error allowed memory size exhausted in libraries/joomla/error/exception.php [SOLUTION]

After a site move (from one webhosting to another) the site reported error 500 internal server error. When checking the logfile the file libraries/joomla/error/exception.php reported that allowed memor size was exhausted. I tried increasing it by adjusting the php.ini settings all the way up to 2 GB without resolving the problem. This is way more than Joomla should need.

The problem was that I had forgot to update the temp and log paths in Global settings to the ones on the new server. The path the site is running under can be found by the menu Help -> System info. Then I adjusted temp path and log path in Global settings and the problem was resolved.

If your site gives you error 500 internal server error, access your Joomla database using for example phpMyAdmin and delete all rows in the jos_session table.

Another solution if the problem is a corrupted database is to repair the database tables using phpMyAdmin.

In configuration.php, also try setting cache_handler=”file” instead of “memcache”.