In my omnetpp.ini file, I have these lines describing cmdenv:
[General]
cmdenv-express-mode = false
cmdenv-output-file = log.txt
cmdenv-autoflush = true
cmdenv-status-frequency = 10000000s
So my outputs are redirected to a log file. To run my simulation I access to run -> run configurations -> user interface command line
Now, I need to run the omnetpp.ini file using a server so I need to run the .ini file in command line and not using the previous steps mentioned. I followed these two solutions that I found in the mailing list but they do not work:
1) ./run -u Cmdenv -f omnetpp.ini
2) opp_run -u Cmdenv -f omnetpp.ini
This is what display:
HP-ProBook-650-G2:~/WorkspaceThese/Veins-4a2/examples/veins$ opp_run -u Cmdenv -f omnetpp.ini
OMNeT++ Discrete Event Simulation (C) 1992-2014 Andras Varga, OpenSim Ltd.
Version: 4.6, build: 141202-f785492, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer
Setting up Cmdenv...
Cmdenv: redirecting output to file `/home/yosra/WorkspaceThese/Veins- 4a2/examples/veins/log.txt'...
End.
Can someone help me to fix this issue please?
If you are able to run your simulation in Cmdenv mode from Eclipse, you may see what Eclipse uses to run the simulation. To do it add the Console ( Window | Show View | Other | Console) and start your simulation in Cmdenv mode. In the console you will see something like this:
Starting...
$ cd /opt/omnetpp/omnetpp-4.6/samples/tictoc/simulations
$ ../src/tictoc -r 0 -u Cmdenv -c General -n ../src;. omnetpp.ini
OMNeT++ Discrete Event Simulation (C) 1992-2014 Andras Varga, OpenSim Ltd.
...
Here are the commands you are looking for.
Related
I am using OMNeT++ 5.5.1 installed in Ubuntu 19.04 and it is working fine in IDE environment.
But, I need to run an INET project from Ubuntu terminal. Can anyone suggest me what command to write in terminal if:
I want to run, for example, INET showcase examples ( wireless/sensornetwork/omnetpp.ini)?
how to see the list of configurations in omnetpp.ini?
and how to choose one specific config and run it?
Thank you
To run a simulation from command line do the following:
Go to directory of the example you want to start, e.g.:
cd showcases/wireless/sensornetwork
To see available config names in omnetpp.ini type:
opp_run -a
To run selected config (e.g. LMac) with GUI type the following command:
opp_run -m -u Qtenv -n ../../../src:../..:../../../tutorials:../../../showcases -l ../../../src/INET omnetpp.ini -c LMac
To see all runs for selected config type:
opp_run -s -c LMac omnetpp.ini -q runs
To start one selected run (e.g. 5) from config (e.g. LMac) without GUI type the following command:
opp_run -m -u Cmdenv -n ../../../src:../..:../../../tutorials:../../../showcases -l ../../../src/INET omnetpp.ini -c LMac -r 5
To start all runs in selected config (e.g. LMac) type the following command:
opp_run -m -u Cmdenv -n ../../../src:../..:../../../tutorials:../../../showcases -l ../../../src/INET omnetpp.ini -c LMac
The main options for opp_run:
-u Qtenv selects graphical view of a simulation (for command environment use -u Cmdenv)
-n indicates directories of NED files
-l selects library (here: libINET.so)
For more information about running simulations look to OMNeT++ Manual.
I just started exploring python scripting. I am using anaconda/jupyter editor.
I have a python executable let's say "new-crawler", I have installed it using "pip install new-crawler". It is installed in the correct environment, python etc.
I am able to import the module in jupyter.
However, I am running into an issue "SyntaxError: invalid syntax".
Script:
%aimport news-crawler as nc
nc reports USA -o out.csv -s 20160101 -e 20161231 -keyword election.
Error points right after "reports".
I assume this is because of passing multiple arguments.
I really appreciate any help with proper python syntax here.
Thanks in advance.
Same line works fine from command line.
Finally found the answer.
Command:
news-crawler reports USA -o out.csv -s 20160101 -e 20161231 -keyword election
is a command to run the executable in shell, not IPython commands.
I just had to prefix the command with ! to run in IPython.
I am trying to load the content of a file to avoid showing sensitive data like passwords while invoking a command with -p during a makefile task execution.
The command works when run without variable replacement. I am trying to run a docker login to a docker registry, but in theory this should not be relevant, I mean: the approach below could be used with any command not just the docker command.
I think I am messing up with the combination of double-quotes " and back-quotes ` or something like that, but I can not find a way to get this working.
So far no luck with this makefile content as a combination of bash/gnu-make:
REGISTRY_PSW_FILE=./volume/conf/docker-registry.conf
REGISTRY_PSW=`cat $(REGISTRY_PSW_FILE)`
REGISTRY_LOGIN_COMMAND=docker login my-own-registry.something.com -u myRegistryUsr -p $(REGISTRY_PSW)
docker-push:
#echo -e "\n\n\nPushing the docker image to the registry"
#echo -e "stuff: $(REGISTRY_PSW)"
#echo -e "more stuff: $(REGISTRY_LOGIN_COMMAND)"
$(REGISTRY_LOGIN_COMMAND)
#echo "DONE"
I've tried different things also stuff like:
REGISTRY_LOGIN_COMMAND=`docker login my-own-registry.something.com -u myRegistryUsr -p $(REGISTRY_PSW)`
Or this one using directly the cat command:
REGISTRY_LOGIN_COMMAND=docker login my-own-registry.something.com -u myRegistryUsr -p `cat $(REGISTRY_PSW_FILE)`
But I keep getting different errors like:
flag needs an argument: 'p' in -p \n See 'docker login --help'.
Error response from daemon: login attempt to https://my-own-registry.something.com/v2 failed with status: 401 Unauthorized
In the makefile task I am using $(REGISTRY_LOGIN_COMMAND) straight away (and not a combination of eval + echo) because I am trying to avoid showing the password in the output of the command (like in the echo that shows more stuff: <THE THING I AM TRYING TO HIDE>), anyway even when using a combination of echo and eval like this #eval "echo -e $(REGISTRY_LOGIN_COMMAND)" it still does not work with similar output errors.
I am using cygwin with the following version of gnu-make:
$ make -v
GNU Make 4.2.1
Built for x86_64-unknown-cygwin
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
What am I doing wrong?
I see no way to prevent the user from seeing the docker command (and the password it contains), if Make runs the docker directly.
But if Make constructs a script that contains the docker command, and executes it, that's another story:
DOCKER_SCRIPT = run_docker
docker-push:
sed -e 's/^/docker login my-own-registry.something.com -u myRegistryUsr -p /' -e 's|$$| >/dev/null/|' $(REGISTRY_PSW_FILE) > $(DOCKER_SCRIPT)
chmod +x $(DOCKER_SCRIPT)
./$(DOCKER_SCRIPT)
Hey friends i had installed Omnet++ 4.2.2 and Castalia 3.2.I had tried to run the example simulations,but it saying an run time error.i had attached it as a image.Please help me.Please tell me the solutions.Help indeed please.
You probably didn't build the Castalia. In order to build it under Windows do the following:
Open in any text editor the file makemake from main Castalia-3.2 directory, and change the line: OPTS=" -f -r --deep -o CastaliaBin -u Cmdenv -P $ROOT -M release" into:
OPTS=" -f -r --deep -P $ROOT -M release"
Open console mingwenv.cmd.
Change directory to the Castalia directory. Example: assuming that Castalia-3.2 is in d:\Castalia-3.2 you should type: cd /d/Castalia-3.2
Then type in mingwcmd console:
./makemake
make
In order to check it try to start a simulation by typing in console:
cd Simulations/BANtest/
../../Castalia-3.2.exe
The simulation should start in graphical mode.
I have one problem when run the Last.fm clustering example in Mahout in action book.
The issue is when I run the command :
--bin/mahout kmeans -i /user/local/Mia/lastfm_vector/ -o /user/local/Mia/lastfm_topics -c /user/local/Mia/lastfm_centroids -k 2000 -ow -dm org.apache.mahout.common.distance.CosineDistanceMeasure -cd 0.01 -x 20 -cl
I checked out the source code from git:
https://github.com/tdunning/MiA.git
The issue is: Exception is thread "main" java.io.FileNotFoundException: File does not exit:/user/local/Mia/lastfm_vector
Everyone who help me to provide me file input Lastfm_vector to run this example. I need it for my education.
Thanks & Regard!