donderdag 24 december 2015

Browser Remote Desktop : Access your computer from anywhere


System:
MINIX NEO Z64 - WINDOWS 10 MINI PC / TV BOX
Windows 8.1
Intel Atom processor with 4 cores. It is a 64bit system with a 32bit OS on top.
Intel processor allows for virtualization.


Upgrade to:
Windows 10 Home

Installed :
RDP Wrapper ( https://github.com/binarymaster/rdpwrap/releases )

- Command Prompt (Admin privileges)
- install.bat
- update.bat

Create Windows Account with a password and Administrator privileges

Installed: ThinRDP : http://www.cybelesoft.com/helps/thinrdp/server/
I've bought a license and it is absolutely worth the investment!

Thin RDP Workstation configuration : Digest account so that it is better secured or even better a NTLM or certificate but that isn't as flexible.

If you setup two accounts one for Windows and one for the thinrdp it is reasonably secure.

You need to port-forward on the router to the system on which you installed the software.


On this system I installed virtual box 5.0 so I could run a 64-bit Oracle Linux with my website on it.




zaterdag 19 december 2015

Joomla 1.5



$ mkdir /var/www/html/joomla

Copy the .zip file to /var/www/html/joomla

Unpack the .zip file:

$ cd /var/www/html/joomla
$ unzip Joomla*1.5*

Make an empty configuration file
$ touch configuration.php

$ cd ..
$ chown apache:apache joomla



$ service httpd restart
$ service mysqld restart


Browse to http://localhost/joomla

The installation page should be showing and the page checks if all the modules
and configuration can be saved.

Use the NEXT button to configure your environment.

Create your database (joomla15) accordingly and/or use a specific database
user for your environment.

admin account credentials should be given.

Finally rename your installation directory:

$ cd /var/www/html/joomla
$ mv installation inst_old


Joomla

Site -> User Manager

Create user (info) and grant it Administrator rights (Not Super Administrator!)

Login with info - user

The site is known as :
http://localhost/joomla

And you can do administration with:
http://localhost/joomla/administrator

CHANGING LOGO

Unfortunately such a basic thing as changing the logo is complicated!

copy mw_joomla_logo.png from the templates:

C:> pscp root@ip:/var/www/html/joomla/templates/rhuk_milkyway/images/mw_joomla_logo.png .

Modify using a program like GIMP, MS Paint

Copy back

C:> pscp mw_joomla_logo.png root@ip:/var/www/html/joomla/templates/rhuk_milkyway/images/.

Now you have to alter the CSS file to match the dimensions of your image.

$ cd /var/www/html/joomla/templates/rhuk_milyway/css
$ vi template.css

Search for div#logo section and change:
width: 298px;
height: 75px;

into your dimensions...


Other TEMPLATE

Download template as ZIP archive.
First you check if this can be installed as an extension:

Extensions=> Install/Uninstall
Try to install the zip archive as a package.

If that fails you can do this:

Upload the ZIP file to the /var/www/html/joomla/templates directory

$ unzip [template].zip

Change owner to apache:apache

$ cd /var/www/html/joomla/templates
$ chown -R apache:apache [template]

Sometimes you need to make a file writable (params.ini)

PAGES
Content -> Article Manager

Create pages using the Article Manager.
In the page you can create links and text.

Menu Editor
With Menu Manager you first create the menu options.
The menu's can be bound to the articles (pages) you created.
  +New
 (Article Layout) -> Select article 

Main Menu -> Menu Items button
Gives you the option to create a menu with the different submenu's 
 (Submenu is done via ALIAS)
  Main Menu  [ Edit Menus ] button
 + New
    Alias 
      Select menu item from the right panel




BANNER

Banner Manager
  Create a Catagory
  Create a Client
  And lastly you can create the Banner by selecting the category and client.

Activate Banner

 Module Manager
   New
    Click (o) Banner
    
Enter the sheet for the information and allow all modules to be bound to the banner.
Make sure that the menu's are ENABLED from the module manager.


woensdag 24 november 2010

OpenFiler iSCSI target

OpenFiler
 (downloaded Virtual Appliance from openfiler.com)

Configure your virtual machine with storage to be used
for clients that will be provided with storage.
I find it usefull not to make the storage on the root
disk of the Virtual Machine but to add a different disk
to the VM where we put the storage on.

Edit Settings
  Add ..
   HardDisk
Create new Virtual Disk

Start Virtual Machine

If the Virtual Machine has started it will have port 446 available
for you to connect to :

http://192.168.2.9:446

Login: openfiler
Password: password

Goto TAB : Volumes

On the right hand side you will find menu option: Block Device

Check to find if the added disk is present (propably /dev/sdb)

Under Edit Disk there are links to the disks. Click on /dev/sdb
to create a partition.

Next click on menu (right hand side) Volume Group

Create a Volume Name on the Volume Group: volumegroupy
Add Volume menu action
Create a volume in ‘volumegroupy
  Volume Name:      volumenamy
  Space:                 16384
  FileSystem:           iSCSI

We now have a volume to be used with iSCSI:



Enable iSCSI from the SERVICES tab

Next make sure we listen to a network:

System Tab
Network Access Configuration
'completenetwork' 192.168.2.0/255.255.255.0 share

Now we can create a volume for the iscsi target to use
iSCSI Targets menu
Now MAP the volume name you created to the iSCSI target in the LUN Mapping TAB.


Make sure the network is configured

iSCSI Targets
Network ACL TAB
Allow Access
update




RAID 5 array

For a RAID 5 containing multiple RAW Devices use these
steps:

Volumes
 Block Devices
  *Edit Disk*
   Mode: Primary
   Type: Raid Array Member
   [create]
Repeat for all disks
These Raid Member disks should be combined into a RAID 5 array
Software RAID
  Create Array whith at least 3 raid-members checked to creat a RAID5 array
  Select RAID array type: RAID 5 (parity)
  [Add Array]
Now make a Volume Group on this array.
Volume group name: volumegroupy
Selct /dev/md0 (raid5) [add volume group]


dinsdag 23 november 2010

Storage Foundation Installation

Download the free basic version from symantec.com :
search :
download storage foundation basic
which gives you the freeware version of the storage solution.

Version: 4.1.02.0
This version works with CentOS 4.8 (5.4 is too new !)
(Download from centos.org)

I used vmware player 3.0 to make a virtual machine with centos 4.8

Copy the tar.gz with storage foundation and unpack using
gzip -d sf*basic*
tar xvf sf*basic*

cd rhel*
cd sf*basic*
cd storage*


installsf
Answer the questions
Host : 127.0.0.1
or give the name of the system.

You can ignore the SSH connection when installing to the
same host.

Once installed you propably want to have some shared storage
available to the system.

For this I use OpenFiler virtual machine that has iSCSI target
in it. [See : OpenFiler iSCSI Target]

To access the iSCSI target using an iscsi initiator we download the utils:

yum install iscsi-initator-utils

vi /etc/initiatorname.iscsi
InitiatorName=iqn.myLinuxInitiator.here
# or change to your own prefered name
vi /etc/iscsi.conf
DiscoveryAddress=192.168.2.9
# 192.168.2.9 is my OpenFiler environment

/etc/init.d/iscsi restart



You now can use storage foundation commands.
If you want to use Veritas Enterprise Administrator you
should either have a X-Windows environment in the Virtual
Machine or you can use another computer to display the
gui.


Suppose your system 192.168.2.1 has X-Windows (mine has X-cygwin)
Login as root to 192.168.2.1 and use:
xhost +
(This allows use of the X-Windows environment to your vm)


On the centos machine use:


export DISPLAY=192.168.2.1:0
cd /opt/VRTS/bin
./vea


To restart VEA services on machine:
/opt/VRTS/bin/vxsvcctrl restart


zaterdag 30 oktober 2010

Calling Java from Javascript and calling Javascript from Java




This little sample shows that we can call javascript doAlert from Java.
Also we show that calling the function display will be received in Java with
data from Javascript.


applet.java


import java.applet.*;
import java.net.*;


public class applet extends Applet{
public void init(){
Display("start of java");
}
public void Display(String txt){
try{
getAppletContext().showDocument(new URL("javascript:doAlert(\""+txt+"\")"));
}catch(Exception e){}
}
}

index.html



<HTML>
<SCRIPT>
function doAlert(s) {
   alert(s);
}
</SCRIPT>
<APPLET CODE="applet.class" NAME="applet"  MAYSCRIPT >
</APPLET>
<INPUT type="button" value="Java.Display" onClick="document.applet.Display('hi')">
</HTML>

zondag 24 oktober 2010

Ultimate Deployment Appliance 2.0 install and setup

Ultimate Deployment Appliance or UDA is an installation environment
with which you can install (virtual) machines for a range of operating
systems.

Download UDA 2.0 from http://www.ultimatedeployment.org/

In my case I used VMware Player 3.0.1 to run it on my local computer.
The appliance has all the stuff in it, but I used an NFS server to hold
the storage for the ISOs

Install Steps:

Fixed IP address: 192.168.2.19
DHCP  + PXE checked for the client installations
root password: password

The Web Login (http://192.168.2.19) is admin with password : password

Storage - New Storage
  NFS     192.168.2.250
  /Volumes/SAMSUNG/    <- 1.5 Terra Byte USB disk
Mount

You need to put ISOs for the Operating Systems you want to install
on the NFS storage in order for UDA to
use them. These ISOs do not have to be bootable.
In one case I had a network directory which hold all the data
from the DVD.
I created an ISO from it using CDBurner XP (dragging the files to the
profile and used File - compile iso )

Once you have the ISOs in place go to the OS menu

OS
Give a name to the OS (max 8 character)
Select type of install (Linux, Windows ..)
Type in the path of the ISO on the NFS server

For the client to get a menu of operating systems to
choose for there must be templates.

In my case I used a virtual machine to install Windows XP on.
VMware Player started and selected 'Create new Virtual Machine'
Name the VM and Select No DVD or Image to install from
When the Virtual Machine starts Press F12
The machine will now do a PXE boot and if your UDA is the
only one who gives out DHCP addresses it will react on this
installation request.
In case you have a network environment where there is another
DHCP server you have to isolate your environment from it.
In case of using Virtual Machines just unplug your network cable.
With Physical Machines you propably have to use a switch or hub.
In some cases it could work just fine because the first DHCP
server who responses is the one that will be used. But keep
in mind that it is not wise to have this kind of setup active
long so that other clients who rely on the other (corporate) DHCP server
are not effected!

Write down the MAC address of your client. It is the address that
is shown when it is looking for a DHCP server

Template
 Name: MyComp
 MAC: 00-0C-29-xx-xx-xx  (VMware Player MAC address)
 OS: winxp
Finish

Press F12 again on the client and it should be presented with a menu
to choose the Operating System.

The standard setup program should start. Basically that is all you need
to do.

Changing TEMPLATEs

Default passwords and other setup configuration that the template makes
can be found in this location on the machine that runs UDA.

Login as root to UDA (password in my case is password)
cd /var/public/www/templates
Here you can find the default templates that your templates rely on.
vi [templatefile]
The password can be found in section:
[GuiUnattended]
AdminPassword
From WI2K3 into ...

Manually mount ISO on UDA

In case you want to have another ISO mounted on the server
to access it from the client you can do this:

(login as root to UDA)
Make mount point:
mkdir /var/public/tftproot/windows5/myown
Mount the ISO
mount -o loop /var/public/smbmount/[samsung]/myown.iso /var/public/tftproot/windows5/myown

Now this can be used inside the Operating System (Windows for instance:)
net use k: \\192.168.2.19\reminst\windows5\myown /user:guest ""

zaterdag 23 oktober 2010

JGame : Dynamically change contents of the background

For my project I wanted to put something on the background which should
not be a sprite and using getBufferGraphics() the image would appear on top
of other sprites. 
In fact I wanted to change a predefined Image from the engine.


The following steps were made to make this happen. Maybe there
is a better method, but this worked for me..



Modify

edit : src-jre\jgame\platform\JREImage.java

public class  JREImage

instead of class JREImage

and make both of the constructor public as well:

public JREImage(....
public JREImage()

===================================

edit src-base\jgame\JGImage.java
On the top :

package ..
import java.awt.*;
(add to the bottom .. before last } <= which is from the class)
public Image getImage();
public void setImage(Image img);


======================================

Edit src-jre\jgame\platform\JREImage.java
(add to the bottom .. before last } <= which is from the class)

public Image getImage(){
return this.img;
}


public void setImage(Image img){
this.img=img;
}


======================================

Edit src-jre\jgame\platform\JGEngine.java

Add this before another defined defineImage function ..


public void defineImage(String imgname,  
JGImage jig){
el.defineImage(imgname,jig);
}




Edit src-base\jgame\impl\EngineLogic.java

Add this before another defineImage function ..

// replace definedImage with new image
public void defineImage(String name, JGImage img){
String imgfile=name;


if (images_loaded.containsKey(name)) {
imgfile=(String)images_loaded.get(name);
undefineImage(name);
}
defineImage(name,"p", 0, img,"-",0,0,0,0);
if(imgfile.length() <1)imgfile=name;
images_loaded.put(name,imgfile);


}





===

Some sample code (modify for example the other JGame code and put the action after a keypress)

public Image readImage(String imagestring){
                String inputLine;
Image retval=null;
                try{


                   URL Url = new URL(getCodeBase().toString()+imagestring);
   retval = ImageIO.read(Url);
                }catch(Exception readfile){
//System.out.println("Read File exception: "+readfile.toString());
}
return retval;


}


// Image load
Image a=readImage(theimage);


// This retrieves JGImage from the background defined image
JGImage bgimg=getImage("background");


// Our own routine to create an Image object from it
java.awt.Image img=bgimg.getImage();


// Make an image to draw stuff on
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gs = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = gs.getDefaultConfiguration();
// always use bitmask transparency

BufferedImage buf = gc.createCompatibleImage(img.getWidth(this),img.getHeight(this),Transparency.BITMASK);
Graphics gg=buf.getGraphics();
gg.drawImage(img,0,0,this);






// on top of background draw our own thing
gg.drawImage(a, imagex, imagey, this);


setBGImage("background");


// Make our own JREImage
JREImage je=new JREImage((Image)buf);
// Call our own routine to replace the defined image with the composed image
defineImage("background",(JGImage)je);

// Set the new background
setBGImage("background");



==================================================================



To recompile the jar file:

make-base

Copy the JAR file to your project directory..