solaris

Reading a file in Java hdfs

只谈情不闲聊 提交于 2019-12-24 09:27:03
问题 I ran into a problem running the program on a cluster and decided to read from hdfs file in functions map and reduce. How to read line by line hdfs file and burn to read rows in ArrayList? 回答1: Just a code snippet for demonstration: Path path = new Path(filePath); FileSystem fs = path.getFileSystem(context.getConfiguration()); // context of mapper or reducer FSDataInputStream fdsis = fs.open(path); BufferedReader br = new BufferedReader(new InputStreamReader(fdsis)); String line = "";

Solaris timezone in C (missing %z on strftime)

蹲街弑〆低调 提交于 2019-12-24 08:24:19
问题 I have an application that writes to another application and needs to provide the date + timezone of the system. I have been using strftime with the %z argument to get the timezone, and it has been working very well on Linux. However, last week we decided to merge it to solaris just to find out that %z is not present. Someone suggested to use %Z , which will give the timezone name, but I need the %z which gives the timezone with the offset format, like +0100 or -0300 . Anyone has ideas? 回答1:

special meaning of ^ (caret) in solaris (bourne?) sh?

北城余情 提交于 2019-12-24 01:03:06
问题 On Solaris, it appears I need to single quote 'a match the beginning of line' expression: > sh $ echo offset 0.000000 2>&1 | grep ^offset | tail -1 offset: not found $ Usage: grep [-c|-l|-q] [-bhinsvwx] pattern_list [file ...] grep [-c|-l|-q] [-bhinsvwx] [-e pattern_list]... [-f pattern_file]... [file...] grep -E [-c|-l|-q] [-bhinsvx] pattern_list [file ...] grep -E [-c|-l|-q] [-bhinsvx] [-e pattern_list]... [-f pattern_file]... [file...] grep -F [-c|-l|-q] [-bhinsvx] pattern_list [file ...]

Installing/configuring gdbm Python module for cvs2svn?

我的梦境 提交于 2019-12-24 00:43:37
问题 I am trying to install cvs2svn on a Solaris 10 machine. It has Python 2.4.4 on it. I don't have root access. When I downloaded cvs2svn and tried to run it, it said ERROR: cvs2svn uses the anydbm package, which depends on lower level dbm libraries. Your system has dbm, with which cvs2svn is known to have problems. To use cvs2svn, you must install a Python dbm library other than dumbdbm or dbm. See http://python.org/doc/current/lib/module-anydbm.html for more information. I downloaded gdbm,

Listing the volumes on Solaris OS

Deadly 提交于 2019-12-24 00:03:13
问题 I am new to solaris OS, and trying to write a script which collects volume data from solaris box. We did a similar script for Linux, and we used "df -P" command to list the volumes, and select the entries that start with "/dev". By default, in linux, i could see a volume "/dev/sda1". when i run df command on solaris box(df -k),i could not see any entry similar to (/dev/*) in my output. When i mounted a CD, i could see an entry in df output as below. /dev/dsk/c1t1d0s2 57632 57632 0 100% /media

Detect -xarch option in the preprocessor?

十年热恋 提交于 2019-12-23 22:22:56
问题 I'm using Sun Studio 12.4 and 12.5 on Solaris 11. We have a source file that provides a straight C/C++ implementation of CRC32, or an optimized version of CRC32 using Intel intrinsics. At runtime, a function pointer is populated with the proper implementation. Testing on a x86 server with dual Xeon's is producing the following because we are making code paths available based on compiler versions. SunCC 12.1 added support for SSE4 (if I parsed the matrix properly), so we attempt to enable it

SIGALRM while sleeping on Solaris 9

a 夏天 提交于 2019-12-23 21:43:50
问题 I'm running into a bit of a weird error while running Perl in a chroot environment on Solaris 9 (Sparc). We are using a custom Perl, but it's almost exactly Perl 5.8.7, and this version has been running for years on various platforms including Solaris 8-10. The following code is pretty straightforward: #!/usr/bin/perl use strict; use warnings; print "About to sleep(1)\n"; sleep 1; print "Just woke up!\n"; However, if I run that, "Just woke up!" never gets printed - instead, the program ends

How to programatically determine which source IP address will be used to reach a given destination IP address

ⅰ亾dé卋堺 提交于 2019-12-23 19:18:52
问题 I have an embedded application which will be deployed on numerous third party systems and I need it to check that a deterministic and static source IP address is used for each destination address it communicates with (I know which destination IP addresses it will talk to). The third party must remain free to implement their IP routing how they feel fit (while complying to these constraints), I just need to check that it is deterministic and static and ideally know what it will be. Its a C

filter a file with other file in bash

谁说我不能喝 提交于 2019-12-23 16:09:51
问题 i Have a file with numbers, for example: $cat file 31038467 32048169 33058564 34088662 35093964 31018168 31138061 31208369 31538163 31798862 and other for example with $cat file2 31208369 33058564 34088662 31538163 31038467 Then i need other file with lines that are in the first file but not in the second cat $output 35093964 31018168 31138061 31798862 32048169 My real file has 12'000.0000 of lines. Then how can i do it? 回答1: Is grep -f file2 -v -F -x file1 sufficient? NOTE1: Please specify

thread performance on Linux vs. Solaris

怎甘沉沦 提交于 2019-12-23 15:23:19
问题 This Linux Magazine article http://www.linux-mag.com/id/792 explains the difference in the way threads are implemented in Linux as compared to commercial Unixs such as Solaris. In summary, Linux uses a 1-to-1 mapping of user threads to kernel threads, while Solaris uses a many to many mapping. The article implies that this might give Solaris a performance edge, especially when switching between threads. Before I spend the time to test this, has anyone already done it? 回答1: People used to