wrong # args: should be "namespace subcommand ?arg ...?" while running nam - ubuntu-14.04

I have installed NS2 allinone package in ubuntu and after the installation if i type ns in terminal it shows the desired "%" sign. However when i type nam then, it doesn't show the network animator window instead gives the erroe
nasif#nasif-HP-ProBook-440-G1:~$ ns
% nam
wrong # args: should be "namespace subcommand ?arg ...?"
what might be the problem?

You cannot call nam from the 'ns' prompt ( % ).
Please open a new terminal session for nam : $ nam
... Then you will find out if you have a functional 'nam'. ( The Ubuntu nam package(s) cannot be used. A bug , March 2014, has not yet been solved.)
But sometimes the 'nam' from ns-allinone-2.35 is usable. Works when using ns-allinone-2.35_gcc482.tar.gz ( "Nov 2014 update" ) :
https://drive.google.com/file/d/0B7S255p3kFXNSGJCZ2YzUGJDVk0/view?usp=sharing
Else : Use a tested package for your OS : Post #2 here ...

You don't need to go though so much trouble to find an answer...
The link blow is a nam i tested it and it worked, i've uploaded it so people could easily use it.
Filesize: 2.620 MB
http://s000.tinyupload.com/index.php?file_id=08988171564893843065
Just copy it to your ns2 directory and use it...
Example :
$cd ns-allinone-2.35/ns-2.35/
~/ns-allinone-2.35/ns-2.35/$ ./ns ./simulation.tcl
~/ns-allinone-2.35/ns-2.35/$ ./nam ./out.nam
And replace the ./nam with your nam file that you downloaded.

Related

generating kickstart ISO for post-fd OSes (eg CentOS 8) and using it in packer vsphere-iso invocation

I'm having a problem specifying the kickstart source on my Packer vsphere-iso template build. I suspect I'm close, but I'm still seeing that the ks is not found during boot and the install goes Interactive at that point.
In my vsphere-iso packer, I'm saying:
{
"variables":
{
:
"ks" : "CentOS-8-x86_64.ks",
:
"cd_label" : "OEMDRV",
"vmipaddress" : "10.1.8.47",
"vmnetmask" : "255.255.254.0",
"vmgateway" : "10.1.9.254",
"vmnameserver" : "10.1.9.210",
:
},
"builders":
[
{
"type" : "vsphere-iso",
:
"boot_wait" : "5s",
"boot_command":
[
"<esc>",
" linux ks=hd:LABEL={{user `cd_label`}}:/{{user `ks`}}",
" ip={{user `vmipaddress`}}::{{user `vmgateway`}}:{{user `vmnetmask`}}:template:eth0:none",
" nameserver={{user `vmnameserver`}}",
" biosdevname=0 net.ifnames=0",
"<enter>",
"<wait>"
],
:
"cd_files" : ["ks/{{user `ks`}}"],
"cd_label" : "{{user `cd_label`}}",
:
:
}
No, I can't refer it back to an HTTP URL. Trust me, I can't !
I can confirm that ks/CentOS-8-x86_64.ks exists, so I half assume anaconda should find it. Mounting a generated ISO image out of the packer cache dir on the DS shows that yes, it is being built with a non-empty ks file on-board.
I don't think the devname tunings (for actually consistent device naming) is causing a problem here, but I don't discount it.
The boot command ends up rendered as (manual copy, watch for typos):
boot: linux ks=hd:LABEL=OEMDRV:/CentOS-8-x86_64.ks ip=10.1.8.47::10.1.9.254:255.255
.254.0:template:eth0:none nameserver=10.1.9.210 biosdevname=0 net.ifnames=0
Loading ... failed: No such file or directory
boot: _
Something's not right. It's gotta be a dumb typo, as I've got the typical "at wits' end" feeling that always precedes a typo fix.
Can you help me spot it?
I too had the same problem. I didn't want to use HTTP because, reasons.
I wasn't able to get the ks=hd:LABEL=OEMDRV working.
I switched to using cdrom but for some odd reason, I had to explicitly specify /dev/sr1 when using cdrom. sr0 would be the CentOS ISO i'm booting from, so sr1 is the second ISO (that Packer builds and uploads on the fly)
Following your naming convention, I used the equivalent of inst.ks=cdrom:/dev/sr1:/CentOS-8-x86_64.ks and was able to get it working.
Tested using CentOS-8.2.2004-x86_64-minimal.iso

cookie cutter: what's the easiest way to specify variables for the prompts

Is there anything that offers replay-type functionality, by pointing at a predefined prompt-answer file?
What works and what I'd like to achieve.
Let's take an example, using a cookiecutter to prep a Python package for pypi
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git
You've downloaded /Users/jluc/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-download it? [yes]:
full_name [Audrey Roy Greenfeld]: Spartacus πŸ‘ˆ constant for me/my organization
email [audreyr#example.com]: spartacus#example.com πŸ‘ˆ constant for me/my organization
...
project_name [Python Boilerplate]: GladiatorRevolt πŸ‘ˆ this will vary.
project_slug [q]: gladiator-revolt πŸ‘ˆ this too
...
OK, done.
Now, I can easily redo this, for this project, via:
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --replay
This is great!
What I want:
Say I create another project, UnleashHell.
I want to prep a file somehow that has my developer-info and project level info for Unleash. And I want to be able to run it multiple times against this template, without having to deal with prompts. This particular pypi template gets regular updates, for example python 2.7 support has been dropped.
The problem:
A --replay will just inject the last run for this cookiecutter template. If it was run against a different pypi project, too bad.
I'm good with my developer-level info, but I need to vary all the project level info.
I tried copying the replay file via:
cp ~/.cookiecutter_replay/cookiecutter-pypackage.json unleash.json
Edit unleash.json to reflect necessary changes.
Then specify it via --config-file flag
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --config-file unleash.json
I get an ugly error, it wants YAML, apparently.
cookiecutter.exceptions.InvalidConfiguration: Unable to parse YAML file .../000.packaging/unleash.json. Error: None of the known patterns match for {
"cookiecutter": {
"full_name": "Spartacus",
No problem, json2yaml to the rescue.
That doesn't work either.
cookiecutter.exceptions.InvalidConfiguration: Unable to parse YAML file ./cookie.yaml. Error: Unable to determine type for "
full_name: "Spartacus"
I also tried a < stdin redirect:
cookiecutter.prompts.txt:
yes
Spartacus
...
It doesn't seem to use it and just aborts.
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git < ./cookiecutter.prompts.txt
You've downloaded ~/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-download it? [yes]
: full_name [Audrey Roy Greenfeld]
: email [audreyr#example.com]
: Aborted
I suspect I am missing something obvious, not sure what. To start with, what is the intent and format expected for the --config file?
Debrief - how I got it working from accepted answer.
Took accepted answer, but adjusted it for ~/.cookiecutterrc usage. It works but the format is not super clear. Especially not on the rc which has to be yaml, though that's not always/often the case with rc files.
This ended up working:
file ~/.cookiecutterrc:
without nesting under default_context... tons of unhelpful yaml parse errors (on a valid yaml doc).
default_context:
#... cut out for privacy
add_pyup_badge: y
command_line_interface: "Click"
create_author_file: "y"
open_source_license: "MIT license"
# the names to use here are:
# full_name:
# email:
# github_username:
# project_name:
# project_slug:
# project_short_description:
# pypi_username:
# version:
# use_pytest:
# use_pypi_deployment_with_travis:
# add_pyup_badge:
# command_line_interface:
# create_author_file:
# open_source_license:
I still could not get a combination of ~/.cookiecutterrc and a project-specific config.yaml to work. Too bad that expected configuration format is so lightly documented.
So I will use the .rc but enter the project name, slug and description each time. Oh well, good enough for now.
You are near.
Try this cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git --no-input --config-file config.yaml
The --no-input parameter will suppress the terminal user input, it is optional of course.
The config.yaml file could look like this:
default_context:
full_name: "Audrey Roy"
email: "audreyr#example.com"
github_username: "audreyr"
cookiecutters_dir: "/home/audreyr/my-custom-cookiecutters-dir/"
replay_dir: "/home/audreyr/my-custom-replay-dir/"
abbreviations:
pp: https://github.com/audreyr/cookiecutter-pypackage.git
gh: https://github.com/{0}.git
bb: https://bitbucket.org/{0}
Reference to this example file: https://cookiecutter.readthedocs.io/en/1.7.0/advanced/user_config.html
You probably just need the default_context block since that is where the user input goes.

Getting error " not enough arguments in call to s.statsd.SendLoop" when running "go build" command

I'm trying to run go build command for my project but it exits with below error.
alpha#GHOST-RIDER:~/GoWorkspace/src/github.com/hyperledger/firstproject$ go build
# github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations
../fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations/system.go:227:23: not enough arguments in call to s.statsd.SendLoop
have (<-chan time.Time, string, string)
want (context.Context, <-chan time.Time, string, string)
Any help would be appreciated.
As per code fabric is using the different version of this library: github.com/go-kit/kit/metrics/statsd. If you follow the System struct's statsd attribute, you can reach the reference on imports.
In master branch of this lib, SendLoop function requires 4 attributes, so that's the root cause. So this causes error when you compile on your local environment.
I had the same issue and worked around it by checking out a tag of library as below:
cd $GOPATH/src/github.com/go-kit/kit
git fetch --tags
git checkout v0.8.0
found a solution on the hyperledger-fabric-go-sdk group chat.
Add context.Background() in s.statsd.SendLoop like below
s.statsd.SendLoop(context.Background(), s.sendTicker.C, network, address)
in fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations/system.go file at line 227.
I had a same issue, my solution worked and don't need edit fabric source code.
specify github.com/go-kit/kit to v0.8.0, modify go.mod:
replace github.com/go-kit/kit => github.com/go-kit/kit v0.8.0 // you specific version
require (
... ...
// Maybe other version, go mod tidy update automatically, don't care it.
github.com/go-kit/kit v0.9.0 // indirect
... ...
)
then it worked.

Win10: ASDF can't load system (ASDF_OUTPUT_TRANSLATION error)

Update 2
I think #farΓ© is right, it's an output translation problem.
So I declared the evironment variable ASDF_OUTPUT_TRANSLATIONS and set it to E:/. Now (asdf:require-system "my-system") yields a different error: Uneven number of components in source to destination mapping: "E:/" which led me to this SO-topic.
Unfortunately, his solution doesn't work for me. So I tried the other answer and set ASDF_OUTPUT_TRANSLATIONS to (:output-translations (t "E:/")). Now I get yet another error:
Invalid source registry (:OUTPUT-TRANSLATIONS (T "E:/")).
One and only one of
:INHERIT-CONFIGURATION or
:IGNORE-INHERITED-CONFIGURATION
is required.
(will be skipped)
Original Posting
I have a simple system definition but can't get ASDF to load it.
(asdf-version 3.1.5, sbcl 1.3.12 (upgraded to 1.3.18 AMD64), slime 2.19, Windows 10)
What I have tried so far
Following the ASDF manual: "4.1 Configuring ASDF to find your systems"
There it says:
For Windows users, and starting with ASDF 3.1.5, start from your
%LOCALAPPDATA%, which is usually ~/AppData/Local/ (but you can ask in
a CMD.EXE terminal echo %LOCALAPPDATA% to make sure) and underneath
create a subpath config/common-lisp/source-registry.conf.d/
That's exactly what I did:
Echoing %LOCALAPPDATA% which evaluates to C:\Users\my-username\AppData\Local
Underneath I created the subfolders config\common-lisp\source-registry.conf.d\ (In total: C:\Users\my-username\AppData\Local\config\common-lisp\source-registry.conf.d\
The manual continues:
there create a file with any name of your choice but with the type conf, for instance 50-luser-lisp.conf; in this file, add the following line to tell ASDF to recursively scan all the subdirectories under /home/luser/lisp/ for .asd files: (:tree "/home/luser/lisp/")
That’s enough. You may replace /home/luser/lisp/ by wherever you want to install your source code.
In the source-registry.conf.d folder I created the file my.conf and put in it (:tree "C:/Users/my-username/my-systems/"). This folder contains a my-system.asd.
And here comes the weird part:
If I now type (asdf:require-system "my-system") in the REPL I get the following error:
Can't create directory C:\Users\my-username\AppData\Local\common-lisp\sbcl-1.3.12-win-x86\C\Users\my-username\my-systems\C:\
So the problem is not that ASDF doesn't find the file, it does -- but (whatever the reason) it tries to create a really weird subfolder hierarchy which ultimately fails because at the end it tries to create the folder C: but Windows doesn't allow foldernames containing a colon.
Another approach: (push path asdf:*central-registry*)
If I try
> (push #P"C:/Users/my-username/my-systems/" asdf:*central-registry*)
(#P"C:/Users/my-username/my-systems/"
#P"C:/Users/my-username/AppData/Roaming/quicklisp/quicklisp/")
> (asdf:require-system "my-system")
I get the exact same error.
I don't know what to do.
Update
Because of the nature of the weird path ASDF was trying to create I thought maybe I could bypass the problem by specifying a relative path instead of an absolute one.
So I tried
  (:tree "\\Users\\my-username\\my-systems")
in my conf file. Still the same error.
Ahem. It looks like an output-translations problem.
I don't have a Windows machine right now, but this all used to work last time I tried.
Can you setup some ad hoc output-translations for now that will make it work?

Packer: Creating a vmware box with with non-US keyboard layout

I went throught the packer / atlas tutorial and got everything working, that is, I managed to build a vmware box via packer build template.json.
I am fine with having everything in English (e.g. menus, help files, ...) but
I need to use a keyboard with a non-US layout (German).
I tried to set the keyboard layout in the preseed.cfg, the file wich is part of the tutorial's git repo and tried the d-i commands I found in the ubuntu preseed documentation. The settings were ignored though. The keyboard layout was still US. The relevant lines of the original preseed.cfg from the tutorial's git repo are:
d-i debian-installer/locale string en_US.utf8
d-i console-setup/ask_detect boolean false
d-i console-setup/layout string USA
Fiddling with the boot commands in the template.json wasn't successful either (either still US-layout or installation did not went through any more). The relevant extract from the original template.json file is
"type": "vmware-iso",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{ .Name }} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
]
Could someone tell me how to configure packer, e.g. starting from the simple example from the packer / atlas tutorial, so that the built vagrant box has a keyboard layout set to German?
I eventually got it working with this boot_command:
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/my_preseed.cfg ",
"debian-installer/locale=en_US keyboard-configuration/layoutcode=de ",
"hostname={{ .Name }} ",
"fb=false debconf/frontend=noninteractive ",
"console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- keyboard-configuration/layout=de <enter>"
],
and these lines in the pressed.cfg
# File starts here
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string de
#d-i netcfg/get_hostname string dummy
...
Yet, I don't know why this works and the other config did not. Does anybody know?
I also asked a question at "Unix & Linux" regarding (the difference between) configuration/layoutcode and keyboard-configuration/layout.

Resources