ubuntu-12.04

Disabling disk cache in linux

本小妞迷上赌 提交于 2019-11-30 16:25:26
In a class project my teacher told us to make some code evaluations (C language) and to do so we need to disable the disk caching during the tests. Currently I'm using Ubuntu 12.04, how can I do this? Thanks. You need root access to do this. You can run hdparm -W 0 /dev/sda command to disable write caching, where you have to replace /dev/sda with device for your drive: #include <stdlib.h> ... system("hdparm -W 0 /dev/sda1"); You can also selectively disable write caching to individual partitions like this: hdparm -W 0 /dev/sda1 . To reenable caching again just use the -W 1 argument. man hdparm

OpenSSL trouble with Ruby 1.9.3

烂漫一生 提交于 2019-11-30 12:44:32
I am having a semi-serious problem with OpenSSL 1.0.1 + Ruby 1.9.3 on Ubuntu 12.04. All rubies are installed with rvm require 'uri' require 'net/http' require 'net/https' endpoint = "https://secure.mmoagateway.com/api/transact.php" RUBY_184_POST_HEADERS = { "Content-Type" => "application/x-www-form-urlencoded" } body = "orderid=ae5dd847d9f31209cbffeeea076ed966&orderdescription=Active+Merchant+Remote+Test+Purchase&ccnumber=4111111111111111&ccexp=0913&cvv=123&company=Widgets+Inc&address1=1234+My+Street&address2=Apt+1&city=Ottawa&state=ON&zip=K1C2N6&country=CA&phone=%28555%29555-5555&firstname=

Where is SCALA_HOME on Ubuntu?

两盒软妹~` 提交于 2019-11-30 12:14:17
问题 I installed Scala on Ubuntu using the following sudo apt-get install scala ~$ which scala /usr/bin/scala ~$ whereis scala scala: /usr/bin/scala /usr/bin/X11/scala /usr/share/man/man1/scala.1.gz ~$ scala -version Scala code runner version 2.9.1 -- Copyright 2002-2011, LAMP/EPFL My question is what should I put in the variable SCALA_HOME? /usr/bin ? 回答1: Today I installed scala using "apt-get install scala" and confirmed the scala jar files are located in /usr/share/java You should be able to

How to enable mod_rewrite in LAMP on ubuntu? [closed]

China☆狼群 提交于 2019-11-30 11:35:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm using Ubuntu 12.04 LTS linux on my machine. I've already installed LAMP on it. Now I want to enable the mod_rewrite module. I did google a lot and tried lots of tricks but couldn't be able to enable mod_rewrite. Can anyone help me to enable the mod_rewrite? Thanks in advance. 回答1: TL;DR version -- do the

Python OpenCV - waitKey(0) does not respond?

不打扰是莪最后的温柔 提交于 2019-11-30 11:02:14
I'm using opencv 2.4.7 on ubuntu 12.04. I'm programming with python and I have a problem when i run this script: import cv2 img = cv2.imread('347620923614738322_233985812.jpg') cv2.namedWindow("window") cv2.imshow("window", img) cv2.waitKey(0) The problem is that the script doesn't stop when I close the image. I searched information about waitKey and I found that using cv2.waitKey(0) is correct. I don't understand, where is the problem? This code works for me from IDLE: # -*- coding: utf-8 -*- # Objectif : découvrir le fonctionnement d'opencv-python # http://opencv-python-tutroals.readthedocs

Impossible to run web application in debug mode with intelliJ on ubuntu with glassfish server

心不动则不痛 提交于 2019-11-30 10:24:32
In intelliJ 12.0 on ubuntu 12.04 with glassfish 3.1.2.2, I'm trying to launch my web application in debug mode but I've got this error message: Error starting domain domain1. The server exited prematurely with exit code 134. Before it died, it produced the following output: FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) ERROR: transport error 202: bind failed: Address already in use ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../

gcc cannot find bits/predefs.h on i686

廉价感情. 提交于 2019-11-30 10:24:27
问题 Okay, so, I switched from ubuntu 12.04 64-bit to 32-bit and installed build-essential. I then compiled and installed GMP-5.0.5, MPFR-3.1.1, MPC-1.0, ISL-0.10 and CLOOG-0.17.0. I checked out a copy of the main gcc trunk and attempted to build it with the following configure line (from a separate directory): ../svnsrc/configure --prefix=/usr/GCC/svn --enable-__cxa_atexit --with-plugin-ld=/usr/bin/ld.gold --enable-threads=posix --enable-werror --enable-build-with-cxx --with-gmp=/usr/GCC/prereq

Eclipse 4.2 (Juno) 'Cannot create a server using the selected type' in Tomcat 7

北城余情 提交于 2019-11-30 10:05:34
问题 I have installed: eclipse juno java-6-openjdk-i386 (selected as default JRE in Eclipse) java-7-openjdk-i386 When I try to add a new server Tomcat7 in Eclipse I get this message 'Cannot create a server using the selected type' and I can not continue. No problem adding Tomcat6 server. I read this question but it didn't worked Similar Question 回答1: 1 . To fix the error 'Cannot create a server using the selected type' run the following: cd ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/

“texi2dvi” command not found

人走茶凉 提交于 2019-11-30 07:53:32
Whenever I'm installing a software on my machine it is showing /bin/bash: texi2dvi: command not found My Operating system is Ubuntu 12.04. Do I need install any packages on it.? You need to install texinfo . sudo apt-get install texinfo 来源: https://stackoverflow.com/questions/17652698/texi2dvi-command-not-found

Disabling disk cache in linux

淺唱寂寞╮ 提交于 2019-11-30 07:42:37
问题 In a class project my teacher told us to make some code evaluations (C language) and to do so we need to disable the disk caching during the tests. Currently I'm using Ubuntu 12.04, how can I do this? Thanks. 回答1: You need root access to do this. You can run hdparm -W 0 /dev/sda command to disable write caching, where you have to replace /dev/sda with device for your drive: #include <stdlib.h> ... system("hdparm -W 0 /dev/sda1"); You can also selectively disable write caching to individual