view counter

Servers & Storage Feed

Sun Servers and Storage, Solaris, Oracle Linux, Red Hat Linux, Oracle VM for x86, Oracle VDI and Virtualization resources, news, and support articles.

Python file operations – read/write/append

 
To read and existing file use following code. In this code I am trying to read inputFile, it will throw IOError if given input file is not available.

SP (nanomsg) in Pure Go

I'm pleased to announce that this past weekend I released the first version of my implementation of the SP (scalability protocols, sometimes known by their reference implementation, nanomsg) implemented in pure Go. This allows them to be used even on platforms where cgo is not present.  It may be possible to use them in playground (I've not tried yet!)

Python convert string to list/tuple/dictionary

By using ast modules literal_eval function we can convert any python string to valid literal.
ast modules literal_eval function will only evaluates string that are valid python literals.
Lets try with an example:
I have file with some valid python literals and I want to evaluate each of them.
Content of my input file is following:
[1, 2, 3]
(1, 2, 3)
{‘a’:1, ‘b’:2, ‘c’:3}
‘abc’
123
Here I want to detect type of literal in each line.
First I will try with a simple example:

Python convert string to list/tuple/dictionary

By using ast modules literal_eval function we can convert any python string to valid literal.
ast modules literal_eval function will only evaluates string that are valid python literals.
Lets try with an example:
I have file with some valid python literals and I want to evaluate each of them.
Content of my input file is following:
[1, 2, 3]
(1, 2, 3)
{‘a’:1, ‘b’:2, ‘c’:3}
‘abc’
123
Here I want to detect type of literal in each line.
First I will try with a simple example:

Xen Project Team Hits the Road

You’ll find many of our members and contributors taking on more than coding this spring. We’re excited to attend several upcoming industry events and share Xen Project milestones, news, use cases and roadmap updates in-person with many in our community.

We encourage you to attend any of these upcoming Xen Project talks. And, if you do, make sure to introduce yourself to the speaker.  It’s always good to meet new people from the Xen Project community!

Xeon Phi Updates (22 Mar 2014)

The test was done with 2 socket of Xeon E5-2670 with Xeon Phi Coprocessor. For more information, see Intel® Xeon Phi™ Coprocessor

Perl – Can’t locate XML/Simple.pm in @INC

Recently while I am trying to reuse a perl scrip I got an error saying “Can’t locate XML/Simple.pm in @INC”.
Following is complete error message:
Can’t locate XML/Simple.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .)

Perl – Can’t locate XML/Simple.pm in @INC

Recently while I am trying to reuse a perl scrip I got an error saying “Can’t locate XML/Simple.pm in @INC”.
Following is complete error message:
Can’t locate XML/Simple.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .)

Oracle VM Server for SPARC 3.1.1 Now Available

Oracle VM Server for SPARC
release 3.1.1 is now available. It can be installed on systems with Solaris 11.1 control domains by upgrading to SRU 17.5. That automatically
updates the version of Oracle VM Server for SPARC.

Identify Linux distribution, code name and version info

How do you identify the Linux distribution, the specific code name and version number that is running on a machine? Below are several ways.

  1. lsb_release $ lsb_release -aNo LSB modules are available.Distributor ID: DebianDescription: Debian GNU/Linux 7.4 (wheezy)Release: 7.4Codename: wheezy If lsb_release is not installed by default on your machine, install it as follows.
    • For Fedora, Centos, and Red Hat Enterprise Linux $ sudo yum install redhat-lsb-core

view counter