Thursday, July 6, 2017

Redhat EL7.3 XRDP install



http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-xrdp-on-centos-7-rhel-7.html

xrdp is an Open Source Remote desktop Protocol server, which allows you to RDP to your Linux server from Windows machine; it is capable of accepting connections from  rdesktop, freerdp, and remote desktop clients. This how to will help you to setup xrdp server on CentOS 7 / RHEL 7.

Prerequisites:

1. This was written when xrdp is available neither on CentOS repositories nor on EPEL repository, after a lot of Google search; i found desktop repository (http://li.nux.ro/) which was having xrdp for CentOS 7 / RHEL 7. We need to manually setup the repository on CentOS 7.
2. Don’t forget to install Gnome on CentOS 7

Automatic (recommended):

Install EPEL and nux Desktop repository rpms.
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

Manual:

Create a repository file.
# vi /etc/yum.repos.d/xrdp.repo
Place the following content. Once added, save and close the file.
[xrdp]
name=xrdp
baseurl=http://li.nux.ro/download/nux/dextop/el7/x86_64/
enabled=1
gpgcheck=0

Installation:

Issue the  following command to install xrdp
# yum -y install xrdp tigervnc-server
You will get the following output, make sure you are getting package from the newly created repository.
 --> Running transaction check
---> Package xrdp.x86_64 0:0.6.1-2.el7.nux will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
================================================================================
Package        Arch             Version                   Repository      Size
================================================================================
Installing:
xrdp           x86_64           0.6.1-2.el7.nux           xrdp           271 k
 
Transaction Summary
================================================================================
Install  1 Package
 
Total download size: 271 k
Installed size: 1.5 M
Is this ok [y/d/N]: y
Downloading packages:
xrdp-0.6.1-2.el7.nux.x86_64.rpm                            | 271 kB   00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : xrdp-0.6.1-2.el7.nux.x86_64                                  1/1
Verifying  : xrdp-0.6.1-2.el7.nux.x86_64                                  1/1
 
Installed:
xrdp.x86_64 0:0.6.1-2.el7.nux
Once it is installed, lets start the xrdp service.
# systemctl start xrdp.service
xrdp will listen on 3389, lets confirm this by issuing following command.
# netstat -antup | grep xrdp
tcp        0      0 0.0.0.0:3389            0.0.0.0:*               LISTEN      1508/xrdp
tcp        0      0 127.0.0.1:3350          0.0.0.0:*               LISTEN      1507/xrdp-sesman
By default, services wont auto start after system reboot. Issue the following command to enable the service at system start up.
# systemctl enable xrdp.service
Next is to create iptables rule to allow rdp connection from the external machines, following command will add the exception for rdp port (3389).
# firewall-cmd --permanent --zone=public --add-port=3389/tcp
# firewall-cmd --reload
Configure SELinux
# chcon --type=bin_t /usr/sbin/xrdp
# chcon --type=bin_t /usr/sbin/xrdp-sesman

Test:

Now take rdp from any windows machine using Remote Desktop Connection, enter ip address of Linux server in computer field and click on  connect.
CentOS 7 – xrdp MSTSC
You would be asked to enter the user name and password, you can either use root or any user that you have it on system. Make sure you use module “sesman-Xvnc”.
CentOS 7 – xrdp Login page
If you click ok, you will see the processing. In less than a half min, you will get a desktop.
CentOS 7 – xrdp Desktop

Sunday, June 11, 2017

Restoring Ultra 5 NV ram info


This set of notes resets a serial into a Sun ultra 5 after power on, or replacement


Note that the BIOS battery in this unit has expired (the system was manufactured 17 years ago after all).  When you initially power on the system, you will need to program the PROM serial number and manually boot the system.  The procedure to program the PROM serial number follows:

1.) Invalidate the PROM XOR checksum:
57 f mkp <enter>
2.) Program the PROM's Serial number:
8 0 20 2b 59 d2 2b59d2 mkpl <enter> <ctrl-d> <ctrl-r>
3.) Reset the system so that the system detects a proper serial number during POST:
reset <enter>
4.) Boot internal hard drive:
boot disk <enter>

*If you need to stop the system, press <stop-a> to get to the "OK>" prompt.
 
 

Friday, June 9, 2017

Downgrading php from 7.0 to 5.0


Php7 is installed by default on Ubuntu 16.04. 

The copy of gregarius, an RSS aggregator / reader uses php revision greater than 4.  Many of the mysql php core functions, and string editing is needlessly mangled in 7.0, and editing and updating the gregarius package is a very large task.

It is easier to downgrade the php for now than editing gregarius.  FWIW gregarius is pretty much dead in support after 2006, very old, which is sad since it is a nice stable tool.

it requires mysql, but luckily the downgraded php 5 works along with the mysql extensions.

Procedure snarfed from another blog to remove php 7 and install 5.6 from another repository, ondrej.

Remove all the stock php packages
List installed php packages with dpkg -l | grep php| awk '{print $2}' |tr "\n" " " then remove unneeded packages with sudo aptitude purge your_packages_here or if you want to directly remove them all use :
sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
Add the PPA
sudo add-apt-repository ppa:ondrej/php
If you get add-apt-repository: command not found run the following command first :
sudo apt-get install software-properties-common
Install your PHP Version
sudo apt-get update
sudo apt-get install php5.6
You can install php5.6 modules too for example
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
Verify your version
If you have installed php5.6-cli
sudo php -v
If you don't have php5.6-cli, put this on a .php file
<?php 
      //outputs php configuration info
      phpinfo(); 
?>

restarting apache

dpkg-reconfigure phpmyadmin

x

Tuesday, May 30, 2017

foscam dvr and camera web plugins blocked by flash


In Firefox 52 (? I think) the flash execution is blocked by default.  There is no key present to disable the blocker in the Firefox config.  Instructions from Foscam support shows what to do go go round it.

If you are vulnerable to exploits this may allow malware to run flash exploits, so any PC this is installed on should be evaluated for public or even local exposure to malware.  Suggest no email, no browsing, limited lan exposure, or even private router natted if you are really paranoid.

****************
Firefox has just released new version 52.0, in this version it has disabled support for NPAPI plugin which Foscam and other manufactures are using.

With this update, Foscam plugin can no longer run properly.
 But you can still setup Firefox following below steps to get your Foscam devices work again on Firefox 52.

Step1: Input about:config in Firefox address bar, hit enter

You’ll see warning message below, please click ‘I accept the risk’.

Step2: Right click and choose New, then Boolean
Please input name plugin.load_flash_only
Then click OK, choose false and click OK again.
Step3: Please restart Firefox and try again.

Saturday, May 27, 2017

Openmediavault notes


Openmediavault is an opensource nas system that supports intel and arm.

Most notes here will be related to the Friendlyarm Nanopi Neo and Nanopi Neo2

First tests with v1.0 media dock had some problems.  The USB port on the dock board worked, but the original attempt to use a Seagate 2tb drive didn't work.

After much help from Friendlyarm and debugging the kernel, it appeared that there was a probably known bug manifested for the drive in this case.  Will be testing later with other drives and also new builds of the kernel as well to see if that problem works out.

Great support from Friendlyarm in working on this.

V1.0 JM20329 SATA -> USB bridge.  The board has a 12V supply which runs both the SATA drive and the NEO or NEO2 board.

Updates for V1.2 to follow.

The Friendlyarm NEO and NEO2 both have debian builds with openmediavault already built.  Most of the instructions for installing the OMV on the Intel or generic build up install can be ignored, because as supplied, the Friendlyarm images have been installed with generic settings, then the SD images saved.

The instructions below have instructions on a "from bare metal" install on Intel and perhaps others, and the info for configuring the Openmediavault post install from the web interface is the reason for including the links or information here.


Links:

Howto forge page on installing scratch openmediavault.

https://www.howtoforge.com/tutorial/install-open-media-vault-nas/

Current OMV version for NEO2 in use:

5/25/2017, link below

http://www.mediafire.com/file/89ugz0iig8jt6lv/nanopi-neo2_debian-nas-jessie_4.11.2_20170525.img.zip

Thursday, May 25, 2017

c# json. Converting json to c#; convert xml to c#




For those who land here from google searching for the reverse
(generate the C# class from JSON) - I use those fine online tools:
From reverse jsonclassgenerator tool is great. Another simple option is to use Edit->Paste Special-> Paste JSON as Classes in Visual Studio. This creates a class too! Quite handy sometimes. – sandiejat Mar 16 at 5:25
Json <--> csharp
part1:
part2

Tuesday, May 16, 2017

Ebay history download tool

Ebay doesn't let you download your buy history.  This tool exports it in various formats.

The most useful being xml.  However the XML is actually exported as a multivalue format,
and generic parsers do not get it right.

schema is:

<order>
  <items>
     <item></item>
     <item></item>
  </items>
  <items>
    ...
</order>

within each <items> object there are multiple <item> objects each representing a separate transaction with the vendor of <items> object.  So a multi-valued database would have no problem.  However
linear xml parsing results in a mess if translating later to such as an XML or flat file.

however beats nothing as an export tool

There is a chrome plugin called "ebay purchase history report". This is the best I have found so far. Only problem is it does not show the tracking# of the ordered item.

https://chrome.google.com/webstore/detail/ebay-purchase-history-rep/ohoebnmmkndcieckfjblpdlfjpaeonbc