<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>python &#8211; Virtually Fun</title>
	<atom:link href="https://virtuallyfun.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>https://virtuallyfun.com</link>
	<description>Fun with Virtualization</description>
	<lastBuildDate>Fri, 17 May 2019 01:54:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Not having fun with Python/Debian 9.1</title>
		<link>https://virtuallyfun.com/2019/05/17/not-having-fun-with-python-debian-9-1/</link>
					<comments>https://virtuallyfun.com/2019/05/17/not-having-fun-with-python-debian-9-1/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 17 May 2019 01:53:43 +0000</pubDate>
				<category><![CDATA[crypto]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/wordpress/?p=9489</guid>

					<description><![CDATA[Well after my last Star Wars Galaxies adventure, where I tried to run MySQL on Linux Subsystem for Windows v1, I got some weird shared memory error, and it wouldn&#8217;t run. Even the old BSDDB engine was bombing out trying &#8230; <a href="https://virtuallyfun.com/2019/05/17/not-having-fun-with-python-debian-9-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Well after my last <a href="https://virtuallyfun.com/wordpress/2019/05/15/running-swgemu-core3/">Star Wars Galaxies adventure</a>, where I tried to run MySQL on Linux Subsystem for Windows v1, I got some weird shared memory error, and it wouldn&#8217;t run.  Even the old BSDDB engine was bombing out trying to create files.  So fine, whatever I thought I could move on, and that is when I found out that somehow OpenSSL &amp; Python had utterly collided.</p>



<code>Python 1.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/ssl.py", line 98, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_0' not found (required by /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so)
>>></code>



<p class="wp-block-paragraph">Well isn&#8217;t that great.  I tried un-installing &amp; re-installing Python over and over, along with trying to force re-install OpenSSL.  No dice.</p>



<p class="wp-block-paragraph">So what finally got it working for me was to purge OpenSSL.</p>



<code>apt-get purge libssl1.1</code>



<p class="wp-block-paragraph">And after that it pulled out everything that was using it, well over 500MB of stuff I&#8217;d installed.  And for good measure I followed up with the autoremove for an additional 384MB of stuff to remove.  And then for the final step, of just installing Python:</p>



<code>root@HUANANZHIX79:~# apt-get install python2.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libpython2.7-stdlib libssl1.1
Suggested packages:
  python2.7-doc
The following NEW packages will be installed:
  libpython2.7-stdlib libssl1.1 python2.7
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,537 kB of archives.
After this operation, 12.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian stretch/main amd64 libssl1.1 amd64 1.1.0j-1~deb9u1 [1,354 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libpython2.7-stdlib amd64 2.7.13-2+deb9u3 [1,897 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 python2.7 amd64 2.7.13-2+deb9u3 [285 kB]
Fetched 3,537 kB in 0s (13.2 MB/s)
Preconfiguring packages ...
Selecting previously unselected package libssl1.1:amd64.
(Reading database ... 27441 files and directories currently installed.)
Preparing to unpack .../libssl1.1_1.1.0j-1~deb9u1_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.0j-1~deb9u1) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../libpython2.7-stdlib_2.7.13-2+deb9u3_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.13-2+deb9u3) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.13-2+deb9u3_amd64.deb ...
Unpacking python2.7 (2.7.13-2+deb9u3) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up libssl1.1:amd64 (1.1.0j-1~deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libpython2.7-stdlib:amd64 (2.7.13-2+deb9u3) ...
Setting up python2.7 (2.7.13-2+deb9u3) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...</code>



<p class="wp-block-paragraph">So now you think its going to be broken right?  It&#8217;s the same libssl package!  I didn&#8217;t even run an &#8216;apt-get update&#8217;.  And guess what?!  You would be <em>wrong</em>.</p>



<code>root@HUANANZHIX79:~# python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>></code>



<p class="wp-block-paragraph">That&#8217;s right, it&#8217;s now working.</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="580" height="289" src="https://virtuallyfun.com/wp-content/uploads/2019/05/picard-facepalm.jpg" alt="" class="wp-image-9490" srcset="https://virtuallyfun.com/wp-content/uploads/2019/05/picard-facepalm.jpg 580w, https://virtuallyfun.com/wp-content/uploads/2019/05/picard-facepalm-300x149.jpg 300w" sizes="(max-width: 580px) 100vw, 580px" /></figure>



<p class="wp-block-paragraph">Speaking of Picard, I hear there will be a new series, inspiringly named &#8216;Picard&#8217;.  Apparently it&#8217;s going down the same path as STD, complete with a lack of backers, and merch.  I&#8217;m hoping it&#8217;ll be something watchable, although they certainly cannot afford any of the TNG cast as they apparently have zero budget.  Maybe it&#8217;ll end up as another &#8216;Jake Skywalker&#8217; or &#8216;Not my Picard&#8217;.  But the bad reboot 25% contractual difference could be the difference between something new, or something so divergent that there was no point in even attempting to be a Trek.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2019/05/17/not-having-fun-with-python-debian-9-1/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Firefly-Host-6.0-CloudSDK fun in &#8220;modern&#8221; times</title>
		<link>https://virtuallyfun.com/2017/01/14/firefly-host-6-0-cloudsdk-fun-modern-times/</link>
					<comments>https://virtuallyfun.com/2017/01/14/firefly-host-6-0-cloudsdk-fun-modern-times/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sat, 14 Jan 2017 12:00:38 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=6733</guid>

					<description><![CDATA[Getting started Ugh. nothing like ancient crypto, major security vulnerabilities, and ancient crap. Â So first I&#8217;m going to use Juniper&#8217;s SDK (get it while you can, if you care). Â Note that the product is long since EOL&#8217;d, and all support &#8230; <a href="https://virtuallyfun.com/2017/01/14/firefly-host-6-0-cloudsdk-fun-modern-times/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<h1>Getting started</h1>
<p>Ugh. nothing like ancient crypto, major security vulnerabilities, and ancient crap. Â So first I&#8217;m going to use <a href="https://webdownload.juniper.net/swdl/dl/secure/site/1/record/54285.html">Juniper&#8217;s SDK</a> (get it while you can, if you care). Â Note that the product is long since EOL&#8217;d, and all support is GONE. Â I&#8217;m using Debian 7 to perform this query, although I probably should be using something like 4 or 5. Â Anyways first off is that the python examples require &#8220;Ft.Xml.Domlette&#8221; which doesn&#8217;t seem to have a 4Suite-XML package. Â SO let&#8217;s build it <a href="http://serverfault.com/questions/645433/pyajam-in-debian-7">the old fashioned way</a>:</p>
<p style="padding-left: 30px;">Â apt-get install build-essential python-dev<br />
wget http://pypi.python.org/packages/source/4/4Suite-XML/4Suite-XML-1.0.2.tar.bz2<br />
tar -xvvf 4Suite-XML-1.0.2.tar.bz2<br />
cd 4Suite-XML-1.0.2<br />
./setup.py install</p>
<p>Well (for now) and in my case I could reconfigure tomcat to be slightly more secure. Otherwise running the examples gives this fun filled error:</p>
<p style="padding-left: 30px;">ssl.SSLError: [Errno 1] _ssl.c:504: error:14082174:SSL routines:SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small</p>
<p>Naturally as time goes on this will not work anymore, and I&#8217;ll need a stale machine to query this stale service. Using <a href="https://www.sslshopper.com/article-how-to-disable-weak-ciphers-and-ssl-2-in-tomcat.html">ssl shopper&#8217;s Tomcat guide</a>, I made changes to the server.xml file on the vGW SD VM. (Don&#8217;t forget to enable SSH in the settings WebUI, and then login as admin/&lt;whatever password you gave&gt; then do a &#8216;sudo bash&#8217; to run as root, screw being nice!</p>
<p style="padding-left: 30px;"><code><br />
# diff -ruN server.xml-old server.xml<br />
--- server.xml-old 2017-01-14 18:20:07.000000000 +0800<br />
+++ server.xml 2017-01-14 19:31:36.000000000 +0800<br />
@@ -98,7 +98,7 @@<br />
enableLookups="false" disableUploadTimeout="true"<br />
acceptCount="100" scheme="https" secure="true"<br />
clientAuth="false" sslProtocol="TLS" URIEncoding="UTF-8"<br />
- ciphers="TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA"<br />
+ ciphers="TLS_RSA_WITH_AES_128_CBC_SHA, ECDH-RSA-AES128-SHA"<br />
keystoreFile="/var/lib/altor/cert/public_keystore" keystorePass="altoraltor"/&gt;</code></p>
<p>Naturally don&#8217;t forget to restart Tomcat, which does take forever:</p>
<p style="padding-left: 30px;">bash-3.2# /etc/init.d/tomcat restart<br />
Stopping tomcat: [ OK ]<br />
Starting tomcat: [ OK ]</p>
<p>And now I&#8217;m FINALLY able to run Â one of the sample scripts</p>
<p style="padding-left: 30px;"># ./policyToXML.py &#8211;grp 1<br />
&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;policy xmlns=&#8221;urn:altor:center:policy&#8221;&gt;<br />
&lt;revision&gt;340&lt;/revision&gt;<br />
&lt;name&gt;Global Policy&lt;/name&gt;<br />
&lt;id&gt;1&lt;/id&gt;<br />
&lt;rev&gt;1&lt;/rev&gt;<br />
&lt;type&gt;G&lt;/type&gt;<br />
&lt;groupId&gt;-1&lt;/groupId&gt;<br />
&lt;machineId&gt;-1&lt;/machineId&gt;<br />
&lt;Inbound&gt;</p>
<p>And you get the idea. Â Certainly on the one hand it&#8217;s nice to get some data out of the vGW without using screen captures or anything else equally useless, and it sure beats trying to read stuff like this:</p>
<p><div id="attachment_6734" style="width: 1398px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/01/VM-Policy-for-NT4-DB.png"><img decoding="async" aria-describedby="caption-attachment-6734" class="size-full wp-image-6734" src="https://virtuallyfun.com/wp-content/uploads/2017/01/VM-Policy-for-NT4-DB.png" alt="" width="1388" height="774" /></a><p id="caption-attachment-6734" class="wp-caption-text">vGW VM effective policy for a VM</p></div></p>
<p>What on earth was Altor/Juniper thinking? Â Who thought making the screen damned near impossible to read was a &#8220;good thing&#8221;â„¢</p>
<p>I just wish I&#8217;d known about the <a href="https://www.juniper.net/support/downloads/?p=vgw#sw">SDK download on the now defunct firefly page</a>Â a few years ago as it&#8217;d have saved me a <strong>LOT</strong> of pain, but as they say, not time like the present.</p>
<p>Naturally someone here is going to say, upgrade to the last version it&#8217;ll fix these errors, and sure it may, but are you going to bet a production environment that is already running obsolete software on changing versions? Â Or migrate to a new platform? Sure, the first step I&#8217;d want of course is a machine formatted rule export of the existing rules. Â And here we are.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/01/14/firefly-host-6-0-cloudsdk-fun-modern-times/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
