Convert .iso to .qcow2 - openstack

I would like to convert windows .iso to .qcow2 format and use in openstack.
Tried using vbox:
https://www.virtualbox.org/
Not sure how to add cloud-init package to the OS, configure grub (steps 11&12)
Also tried using qemu-img commands in windows using ref https://cloudbase.it/qemu-img-windows/
able to convert image to .qcow2 format but when i upload image to openstack and launch instance. It got stuck at booting.

brew/apt install qemu
qemu-img convert xxx.iso xxx.qcow2

I think you have to install it first before converting it, try to install it on virtualbox and then convert virtualbox image to qcow2.
Hope it will help

qemu-img convert -O qcow2 virtio-win.iso virtio-win.qcow2

Related

karaf: JAVA_HOME is not valid: /usr/lib/jvm/java-11-openjdk-amd64/bin/java [duplicate]

I am working in Ubuntu 16.04. I need to install gradle and the gradle is installed when i checked with sudo apt list --installed command but when i use gradle -version command it shows the following error,
JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-8-oracle/jre/bin/java
In sudo vim /etc/environment file,
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"
http_proxy="http://username:password#IP:port no/"
https_proxy="https://IP:port no/"
ftp_proxy="ftp://IP:port no/"
I don't know where i made mistakes. Please help me.
Thanks.
On a 64bit openSuse 64 42.1 box;
readlink -f $(which java)
provided;
/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java
But;
export JAVA_HOME=/usr/lib64/jvm/jre-1.8.0-openjdk
is the path that worked and allowed java emulator to run.
So i think we have to manually browse our file system and see what path to choose.
Today I faced this problem. I am using the default java that comes with your linux distro (so in my case, linux mint).
$ whereis java
This command gave me
java: /usr/bin/java /usr/share/java
So, I opened /user/bin. There was a link to Java. I right clicked it and selected follow original link. This lead me to /usr/lib/jvm/java-11-openjdk-amd64/bin/java.
So now that I know where this java is, I opened my .bashrc file, and edited the JAVA_HOME.
So for my case,
## My Custom variables
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
This solved the problem.
Now if you are using some other java (say you downloaded from oracle and extracted the zip file ...), then you have to add that location. So for example, if your java is in /home/user/.sdkman/candidates/java/current, then
export JAVA_HOME=/home/user/.sdkman/candidates/java/current
export PATH=$JAVA_HOME/bin:$PATH
I see a mismatch. In your enviornment file the JAVA_HOME is set to "/usr/lib/jvm/java-8-openjdk-amd64/" and your mentioned that the error that you got relates to the JAVA_HOME as "/usr/lib/jvm/java-8-oracle/jre/bin/java"
If you JAVA is really installed in /usr/lib/jvm/java-8-oracle directory, then you need to ensure that the JAVA_HOME is set to that directory. And also your PATH reflects $JAVA_HOME/bin in it.
I typically install Oracle JDK/JRE separately in a separate directory such as /usr/local/jdk1.8.0 etc.
check the jvm installtion folder from Files
eg : /usr/lib/jvm/java-12-oracle
then in terminal run sudo nano /etc/environment and add the line
JAVA_HOME="/usr/lib/jvm/java-12-oracle"
Then open terminal and run
export JAVA_HOME="/usr/lib/jvm/java-12-oracle"

Is there a way to delete Snowflake ODBC driver log file automatically or limit them?

I am currently using Snowflake ODBC driver and it creates a log file that gets bigger and bigger as time goes by.
Is there a way to limit the size of the log file? Or to make it overwrite itself? Instead of deleting it manually every time it is oversized?
If the OS is Linux you could make use of logrotation.
On Debian/Ubuntu
apt update &&
apt install logrotate
On CentOS/RHEL/Fedora
yum update
yum install logrotate
You can also try turning down the "tracing" level ... it defaults to 4 (Info) to 3 or lower ... that might help contain the issue.

Converting MP3 file to WAV

Is it possible to convert a file from .mp3 to .wav in R in order to be able to play the song with R?
Yes (probably). Here's an example:
Converting MP3 to WAV is pretty straightforward:
library(tuneR)
r <- readMP3("04 Trip to Paris.mp3") ## MP3 file in working directory
writeWave(r,"tmp.wav",extensible=FALSE)
(to install tuneR on Linux, see here).
Playback is harder and platform-dependent. tuneR::play() tries to use an external player.
On Windows it tries to guess:
If under Windows and no
player is given, “mplay32.exe” or “wmplayer.exe” (if the
former does not exists as under Windows 7) will be chosen as
the default.
On MacOS, specifying "open" probably works.
On Linux, specifying "play" probably works if you have the sox package installed (sudo apt-get install sox).
So on my MacOS system
tuneR::play("tmp.wav","open")
works.
An alternative that does not use external resources is audio::play().
library(audio)
w <- load.wave("tmp.wav")
play(load.wave("tmp.wav"))
It works on MacOS. I don't know if it works on Windows. It does not work on my Linux system; audio doesn't even install unless you sudo apt-get install portaudio19-dev first, and works poorly even once installed.
(When I say "Linux" here I mean the only system I've tested, Ubuntu 14.04. The sudo apt-get install ... incantations I've listed are likely to work on other reasonably recent Debian-based systems, but ... ???)

RStudio not reading system variables when started via launcher

I'm having a few problems with system environment variables with RStudio. In ~/.bashrc some custom environment variables are set which I want to access in my program using Sys.getenv().
When I'm calling Rstudio from the command line, this works fine. However, when I'm using the Ubuntu launch function (Alt+F2) to start RStudio, my environment variables are not found. For portability, I would kind of prefer for this to work, too...
Can someone help?
You need to find Rstudio's desktop launcher. In Ubuntu, launchers are simple text files with the extension .desktop. You can read more about the file format here. The most common locations for these are /home/user/.local/share/applications (user-specific) and /usr/local/share/applications (system-wide). The easiest way to edit these files is to use an app called menulibre.
You can install menulibre by running the following command in the terminal:
sudo apt-get update && sudo apt-get install menulibre
You can then use menulibre to find and edit the Rstudio launcher.
I have just tried using Sys.getenv() on my Rstudio installation, and it works fine. My Rstudio launcher command is /usr/lib/rstudio/bin/rstudio %F
Edit: I am running Rstudio Version 0.99.491

phpDocumentor - Unable to find the dot command of the GraphViz package

I would like ask some help about my next problem:
I am working on a Symfony2 project. We installed Symfony2 via composer.
Now I would like to generate phpDocument used by phpDocumentor.
A did the following steps:
update composer: sudo php composer.phar self-update
add the following property to Symfony2/compose.json file:
"require-dev": {
"phpdocumentor/phpdocumentor": "2.*#dev"
},
Run composer command
sudo php composer.phar update
Result was success! The installed GraphViz version is: 1.0.2
When I try to generate phpDoc from source code finally I got a message:
Unable to find the dot command of the GraphViz package. Is GraphViz correctly installed and present in your path?
(Document generated as right...)
I tried to found a soulution about this problem but I couldn't.
Is anybody can help me to resolve this problem?
Environment is: Ubuntu release 12.04
Graphviz is a nice software that creates graphs, but PHP software can only provide wrappers that create Graphviz source files that then get parsed and morphed into pictures.
Phpdocumentor comes with it's own wrapper, but you still have to install the Graphviz software package.
On Ubuntu just run
sudo apt-get install graphviz
rerun phpdoc, at the end you will see the line
Execute transformation using writer "Graph"
that's all!
The error says that : GraphViz tool (needed for making charts and graphs in the documentation) is not installed, in that scenario you will have to download the suitable version and configure it ! And if you are sure that it is installed on your system, then you should check whether the command dot is available or not. On windows path environment variable needs to be set which makes the dot command execution to be available from any path. Fixing this may get your things working !
For Windows
Follow the steps below to resolve this error are:
download Windows Packages from https://graphviz.gitlab.io/_pages/Download/Download_windows.html
Just install it
add c:\Program Files\Graphviz*\dot.exe or c:\Program Files (x86)\Graphviz*\dot.exe to your environment variable PATH
run phpdoc
Re-start your machine & run phpdoc (if still shows the same error message)
For windows 7/10 just install https://graphviz.gitlab.io/download/ select the Stable install packages. Then add
C:\Program Files (x86)\Graphviz2.38\bin
to your system environment variables. Make sure to change the version to the one you downloaded.
To check if it works open a new instance of cmd or git bash and run dot. If it says dot is not a valid command then make sure the path to Graphviz bin folder is correct.

Resources