Categories
Mastering Development System & Network

Connect to VMs via ssh from outside, with host under VPN

I have some QEMU/KVM machines (1,2,3) running ssh on port 22. I forward the ports to 22221, 22222, 22223 and I can connect to them using 11.22.33.44:2222X. I followed this tutorial to achieve this. 11.22.33.44 is the host’s public ip. Now, I am trying to connect to a vpn using OpenVPN in the host, and […]

Categories
Mastering Development System & Network

Connect to VMs via ssh from outside, with host under VPN

I have some QEMU/KVM machines (1,2,3) running ssh on port 22. I forward the ports to 22221, 22222, 22223 and I can connect to them using host _ip:2222X. I followed this tutorial to achieve this. Now, I am trying to connect to a vpn using OpenVPN in the host, and allow incoming traffic using public […]

Categories
Mastering Development

Notice: Array to string conversion in PHP Json problems

I’m very new to php I have been watching some youtube videos I have a json file [{"name":"hally","ip":{"ip":[1,2,3,4]}},{"name":"Olojak","ip":{"ip":[11,22,33,44]}},{"name":"Andy","ip":{"ip":[111,222,333,444]}},{"name":"NoMad","ip":{"ip":[1111,2222,3333,4444]}},{"name":"ni","ip":{"ip":[11111,22222,33333,44444]}},{"name":"Nish","ip":{"ip":[111111,222222,333333,444444]}},{"name":"hs","ip":{"ip":[1111111,2222222,333333,4444444]}},{"name":"Kif","ip":{"ip":[11111111,22222222,33333333,44444444]}},{"name":"Kip","ip":{"ip":[111111111,111111111,111111111,11111111]}}] and i want to display each name and ip address this is my php file <?php $jsondata = file_get_contents("info.json"); $names = json_decode($jsondata, true); foreach ($names as $user){ echo $user[‘name’]."<br/>"; echo "IP:".$user[‘ip’]; echo "<br/>"; }; //echo "<br/>"; echo […]

Categories
Mastering Development

IN in WHERE-clause is not being parsed correctly using SQL::Statement

I’m using a slightly modified version of the example provided here: https://metacpan.org/pod/distribution/SQL-Statement/lib/SQL/Statement/Structure.pod use SQL::Statement; use Data::Dumper; my $sql = q{ SELECT c1 , col2 as c2 , c3 FROM table1 t1, table2 t2 WHERE t1.c1 = t2.c2 and t1.c1 in (11111, 22222, 33333) GROUP by t1.c1 }; my $parser = SQL::Parser->new(‘ANSI’); $parser->{RaiseError}=1; $parser->{PrintError}=0; my $stmt […]