an easy way to remotely execute x86 apps as they were local

For friendly off topic discussion not covered in a forum above.
Forum rules
No politics, please.
Y888099
Posts: 464
Joined: Mon Jul 11, 2016 11:00 am

an easy way to remotely execute x86 apps as they were local

Unread postby Y888099 » Wed Mar 15, 2017 3:35 pm

Image
MachineB, shitty but useful Pentium4 @ 3.4Ghz with 2GB of ram



I happen to have a PA-RISC machine, and gNAT doesn't exist for it.
Therefore I am using the following trick:

  • MachineA: ip 192.168.1.20, linux on PA-RISC workstation, my HPPA C3600
  • MachineB: ip 192.168.1.24, linux on i686 < -- gGNAT exists for i686!

(*) MachineA and MachineB are sharing a NFS link.

Code: Select all

host_remote="192.168.1.24" # MachineB's IP

echo "step1"
ssh-keygen -t rsa

echo "step2"
if [ ! -f ~/.ssh/id_rsa.pub ]
   then
       echo "failure"
       exit
   fi
ssh $host_remote mkdir -p .ssh

echo "step3"
cat ~/.ssh/id_rsa.pub | ssh $host_remote 'cat >> ~/.ssh/authorized_keys'

(to be executed from the MachineA's console)


Code: Select all

host_remote="192.168.1.24"

argc="$#"     # how many arg from bash command line ?
app_args=""   # where to store arguments from bash command line
args=("$@")   # args[]={arg0..argC}

here="`pwd`"

argv="cd $here; source /etc/profile; "
for ((i=0;i< =argc;i+=1))
    do
       argi="$i"
       argv="$argv ${args[$i]} "
    done

ssh $host_remote $argv

ans="$?"
if [ "$ans" == "0" ]
   then
       answ="success"
   else
       answ="failure"
fi

echo "$answ"

on MachineA, /usr/bin/myrexec (bash script)






Results, on MachineA

Code: Select all

remote_ctrl # myrexec gnat -v
v4.3.5

success


Code: Select all

remote_ctrl # myrexec cat /proc/cpuinfo | grep name
model name   : Intel(R) Pentium(R) 4 CPU 3.40GHz

success


Ugly, simple, but it works :D




Note:
this line

Code: Select all

for ((i=0;i< =argc;i+=1))

needs a fix up

I can't write the correct form because it wastes the whole post
it seems a bug in the forum, related to [ code ] "< =" [ /code ]
Head Full of Snow. Lemon Scented You

User avatar
ClassicHasClass
Donor
Donor
Posts: 1986
Joined: Wed Jul 25, 2012 7:12 pm
Location: Sunny So Cal
Contact:

Re: an easy way to remotely execute x86 apps as they were local

Unread postby ClassicHasClass » Wed Mar 15, 2017 11:08 pm

You could conceivably make it portable, too, with something like a Compute Stick stuck inside the case.
smit happens.

:Fuel: bigred, 900MHz R16K, 4GB RAM, V12 DCD, 6.5.30
:Indy: indy, 150MHz R4400SC, 256MB RAM, XL24, 6.5.10
:Indigo2IMP: purplehaze, 175MHz R10000, Solid IMPACT
probably posted from Image bruce, Quad 2.5GHz PowerPC 970MP, 16GB RAM, Mac OS X 10.4.11
plus IBM POWER6 p520 * Apple Network Server 500 * RDI PrecisionBook * BeBox * Solbourne S3000 * Commodore 128 * many more...

Y888099
Posts: 464
Joined: Mon Jul 11, 2016 11:00 am

Re: an easy way to remotely execute x86 apps as they were local

Unread postby Y888099 » Thu Mar 16, 2017 3:06 am

Yup, the above PeeeCeee costs 70 euro, including
  • GigaBYTE motherboard, 2xpATA, 2xsATA, 3xPCI32, 1xAGP, 2xDDR(max 2GB)
  • CPU P4 intel @ 3.4Ghz
  • 2GB RAM DDR2, 2 sticks, 1GB each @ 500Mhz
  • Matrox G450 2xVGA, AGP
  • pATA hd, 80Gbyte
  • Orange Case, thin sheet metal

ClassicHasClass wrote:Compute Stick stuck inside the case


Tell me more about it. Costs? How fast? Where Can I buy one?




btw, next step (on the software side): I'd like to adapt the trick for Irix, so it can have gNAT!
Head Full of Snow. Lemon Scented You

User avatar
ClassicHasClass
Donor
Donor
Posts: 1986
Joined: Wed Jul 25, 2012 7:12 pm
Location: Sunny So Cal
Contact:

Re: an easy way to remotely execute x86 apps as they were local

Unread postby ClassicHasClass » Thu Mar 16, 2017 8:12 pm

smit happens.

:Fuel: bigred, 900MHz R16K, 4GB RAM, V12 DCD, 6.5.30
:Indy: indy, 150MHz R4400SC, 256MB RAM, XL24, 6.5.10
:Indigo2IMP: purplehaze, 175MHz R10000, Solid IMPACT
probably posted from Image bruce, Quad 2.5GHz PowerPC 970MP, 16GB RAM, Mac OS X 10.4.11
plus IBM POWER6 p520 * Apple Network Server 500 * RDI PrecisionBook * BeBox * Solbourne S3000 * Commodore 128 * many more...

Shiunbird
Donor
Donor
Posts: 337
Joined: Fri May 06, 2016 1:43 pm
Location: Czech Republic

Re: an easy way to remotely execute x86 apps as they were local

Unread postby Shiunbird » Fri Mar 17, 2017 1:45 am

Y888099 wrote:Tell me more about it. Costs? How fast? Where Can I buy one?


Here in the Czech Republic any respectable computer hardware chain will have them in stock for prompt delivery.
The cheaper ones go for ~115 euro and the most expensive ~350-400. They differ in CPU, RAM and storage.

There are many reviews on the Internet. I'm considering buying one to carry around for a few specific things.

Y888099
Posts: 464
Joined: Mon Jul 11, 2016 11:00 am

Re: an easy way to remotely execute x86 apps as they were local

Unread postby Y888099 » Fri Mar 17, 2017 2:14 am

WUAAA Impressive small device!!! Never heard before.

But it's more expensive than my Orange Box. And I prefer to deal with a motherboard with PCI slots, lan, and pATA/sATA/SCSI hard drives. Also a Pentium4 @ 3.4GHz is much more faster (than Atom x5-Z @ 1.6Ghz) for things like gNAT and ghdl.

Briefly, with one hundred euro of budget, the best I can do is still the Orange Box :D
Head Full of Snow. Lemon Scented You

User avatar
ClassicHasClass
Donor
Donor
Posts: 1986
Joined: Wed Jul 25, 2012 7:12 pm
Location: Sunny So Cal
Contact:

Re: an easy way to remotely execute x86 apps as they were local

Unread postby ClassicHasClass » Fri Mar 17, 2017 10:23 am

My plan for the G5 is to case-mod it to accommodate one internally (with internal power and self-contained networking), likely connected over VNC or something and using the G5 to proxy its network connections, since the G5 is probably less likely to be attacked ;)
smit happens.

:Fuel: bigred, 900MHz R16K, 4GB RAM, V12 DCD, 6.5.30
:Indy: indy, 150MHz R4400SC, 256MB RAM, XL24, 6.5.10
:Indigo2IMP: purplehaze, 175MHz R10000, Solid IMPACT
probably posted from Image bruce, Quad 2.5GHz PowerPC 970MP, 16GB RAM, Mac OS X 10.4.11
plus IBM POWER6 p520 * Apple Network Server 500 * RDI PrecisionBook * BeBox * Solbourne S3000 * Commodore 128 * many more...

User avatar
Raion-Fox
Donor
Donor
Posts: 1255
Joined: Thu Jan 30, 2014 5:01 pm
Location: near King George, Virginia
Contact:

Re: an easy way to remotely execute x86 apps as they were local

Unread postby Raion-Fox » Fri Mar 17, 2017 12:31 pm

That sounds smart Classic. I bet Bruce probably will continue to be relatively viable for daily use into 2020 or later so you are investing relatively smart. I do wish Apple would have kept the G5 up to date at least in Snow Leopard since for me that was the Pinnacle of OS X. If I had to use OS X again that would be the version I would like to use the most.
:O3x02L: R16000 700MHz 8GB RAM kanna
:Octane: R12000 300MHz SI 896MB RAM yuuka
:Octane2: R12000A 400MHz V6 2.5GB RAM
:Indy: (Acclaim) R4600 133MHz XL Graphics 32MB RAM
:Indy: (Challenge S) R4600 133MHz (MIPS III Build Server)
:O2: R10000 225MHz 256MB RAM 15k 147GB HDD suzuha
Thinkpad W530 i7 3940XM 3GHz, 32GB, K1000M FreeBSD 11/Windows 7 rin
Acer Aspire 5157 (headless) 4GB, FreeBSD 11 kuran
Thinkpad R40 Pentium M 1.5GHz 2GB RAM kasha

Shiunbird
Donor
Donor
Posts: 337
Joined: Fri May 06, 2016 1:43 pm
Location: Czech Republic

Re: an easy way to remotely execute x86 apps as they were local

Unread postby Shiunbird » Sat Mar 18, 2017 1:53 pm

ClassicHasClass wrote:My plan for the G5 is to case-mod it to accommodate one internally (with internal power and self-contained networking), likely connected over VNC or something and using the G5 to proxy its network connections, since the G5 is probably less likely to be attacked ;)


Can't you get one of the PCIe USB cards that have one internal USB port?
That would eliminate the need of modding the case. Or, I assume, you have all your slots occupied?

User avatar
ClassicHasClass
Donor
Donor
Posts: 1986
Joined: Wed Jul 25, 2012 7:12 pm
Location: Sunny So Cal
Contact:

Re: an easy way to remotely execute x86 apps as they were local

Unread postby ClassicHasClass » Sat Mar 18, 2017 9:13 pm

No, that's what I was thinking of, but I'd still need something to handle the networking and accommodate it inside (probably inside the indentation on the air deflector).
smit happens.

:Fuel: bigred, 900MHz R16K, 4GB RAM, V12 DCD, 6.5.30
:Indy: indy, 150MHz R4400SC, 256MB RAM, XL24, 6.5.10
:Indigo2IMP: purplehaze, 175MHz R10000, Solid IMPACT
probably posted from Image bruce, Quad 2.5GHz PowerPC 970MP, 16GB RAM, Mac OS X 10.4.11
plus IBM POWER6 p520 * Apple Network Server 500 * RDI PrecisionBook * BeBox * Solbourne S3000 * Commodore 128 * many more...

Y888099
Posts: 464
Joined: Mon Jul 11, 2016 11:00 am

Re: an easy way to remotely execute x86 apps as they were local

Unread postby Y888099 » Sun Mar 19, 2017 5:57 am

ClassicHasClass wrote:since the G5 is probably less likely to be attacked ;)



I don't get your rationale. Why should be probably less likely to be attacked?

I assume because Power/64bit is less used than x86, therefore less vulnerabilities around.

Well, ok, but for me It doesn't matter the architecture, it matters which profile has been used under the hood! The hardened profile (aka Secure Linux) is safer against maliciously for attacks because it comes with a strong set of patches for the kernel, directives for the C compiler, for libc and glibc, and for the whole userland.
Head Full of Snow. Lemon Scented You


Return to “Everything Else”

Who is online

Users browsing this forum: Trippynet and 1 guest