Bash script to iterate files in directory and pattern match filenames


Question I need to process a large number of files in a directory. The files can be partitioned into several groups, based upon the file names. That is to say, the file names can be pattern matchedne which 'group' they belong to. For instance, the names are like this: YYYYMMDD_*_bulk_import.csv YYYYMMDD_*_genstats_import.csv YYYYMMDD_*allstats.csv etc ... Each 'group' has a different processing methodology (i.e. a different command is called for processing). I want to write a bash script to:…
Read more ⟶

Can't install rJava on ubuntu system


Question I've seen a few posts related to this...but all the suggested solutions ive seen dont seem to work....I am running R in an EC2 instance and ran the following commands to try and install rJava but to no avail...any help would be greatly appreciated. > install.packages("rJava") Installing package(s) into ‘/home/ubuntu/R/library’ (as ‘lib’ is unspecified) trying URL 'http://cran.stat.nus.edu.sg/src/contrib/rJava_0.9-3.tar.gz' Content type 'application/x-gzip' length 537153 bytes (524 Kb) opened URL ================================================== downloaded 524 Kb installing source package ‘rJava’ … ** package ‘rJava’ successfully unpacked and MD5 sums checked checking for gcc… gcc -std=gnu99 checking for C compiler default output file name… a.…
Read more ⟶

How to iterate over rows in a DataFrame in Pandas


Question I have a pandas dataframe, df: c1 c2 0 10 100 1 11 110 2 12 120 How do I iterate over the rows of this dataframe? For every row, I want to access its elements (values in cells) by the name of the columns. For example: for row in df.rows: print(row['c1'], row['c2']) I found a similar question, which suggests using either of these: for date, row in df.T.iteritems(): for row in df.…
Read more ⟶

What is the difference between openjdk-7-jre-headless and openjdk-7-jre(jdk)? [duplicate]


Question This question already has answers here: </div> Difference between openjdk-6-jre, openjdk-6-jre-headless, openjdk-6-jre-lib (2 answers) Closed 3 years ago. When I type for java -version in command prompt in ubuntu I get following output The program 'java' can be found in the following packages: * default-jre * gcj-4.8-jre-headless * openjdk-7-jre-headless * gcj-4.6-jre-headless * openjdk-6-jre-headless Try: apt-get install <selected package> I get above output as I do not have java install. I want to know difference between openjdk-7-jre-headless and openjdk-7-jre…
Read more ⟶

Benefits of repeated apt cache cleans


Question In the quest for ever smaller Docker images, it's common to remove the apt (for Debian/Ubuntu based images) cache after installing packages. Something like RUN rm -rf /var/lib/apt/lists/* I've seen a few Dockerfiles where this is done after each package installation (example), i.e. with the pattern # Install some package RUN apt-get update \ && apt-get install -y <some-package> \ && rm -rf /var/lib/apt/lists/* Do something … Install another package RUN apt-get update && apt-get install -y <another-package> && rm -rf /var/lib/apt/lists/*…
Read more ⟶

How to stop ubuntu pop-up "Daemons using outdated libraries" when using apt to install or update packages? [closed]


Question Closed. This question is not about programming or software development. It is not currently accepting answers. </div> This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered. Closed 12 months ago.…
Read more ⟶

Mongo "prealloc" files taking up room


Question I'm trying to free up some space on an Ubuntu server running Mongo. I've attached a new, empty 8GB volume, and have the room to move stuff around. I have several large (1GB) files in /var/lib/mongodb/journal/prealloc, is it safe to delete these or move them? If I can move them--can anyone give me a pointer on how to do this for Mongo? Answer So in theory, the prealloc files are preallocated journal files.…
Read more ⟶