how to run snmpRequest.java in snmp4j? - snmp4j

I am actually using Snmp4j libraries..
But I am not getting how to run org/snmp4j/tools/console/SnmpRequest.java
I wanted to know how to run snmpRequest.java in snmp4j?

SnmpRequest.java has a main() method.
Run it as you would any Java application.
Unless you are looking for the usage, in which case I have not looked.

You need to add the log4j jar file as well... Download the Log4J from http://archive.apache.org/dist/logging/log4j/1.2.14/ (take the zip file if you're on windows), then extract the log4j-1.2.14.jar file into the same dir as the snmp4j-2.0.3.jar file.
To run it, CD to the directory with both of the jars in it and type this:
java -cp snmp4j-2.0.3.jar;log4j-1.2.14.jar org.snmp4j.tools.console.SnmpRequest
followed by whatever parameters you want...

Assuming that you have the two jars in libs directory that's present in current directory, try the following syntax:
java -classpath ./libs/snmp4j-2.5.0.jar:./libs/log4j-1.2.17.jar org.snmp4j.tools.console.SnmpRequest -h
java -classpath ./libs/snmp4j-2.5.0.jar:./libs/log4j-1.2.17.jar org.snmp4j.tools.console.SnmpRequest -c public -v 2c -d OFF 10.1.1.1 1.3.6.1.2.1.1.1.0 1.3.6.1.2.1.1.2.0
java -classpath ./libs/snmp4j-2.5.0.jar:./libs/log4j-1.2.17.jar org.snmp4j.tools.console.SnmpRequest -d OFF -p GETNEXT -c public -v 2c 10.1.1.1 1.3.6.1.2.1.1.1-5
java -classpath ./libs/snmp4j-2.5.0.jar:./libs/log4j-1.2.17.jar org.snmp4j.tools.console.SnmpRequest -d OFF -p GETBULK -c public -v 2c -Ow 10.1.1.1 1.0.8802.1.1.2.1.4
java -classpath ./libs/snmp4j-2.5.0.jar:./libs/log4j-1.2.17.jar org.snmp4j.tools.console.SnmpRequest -d OFF -p GETBULK -c public -v 2c -Ot 10.1.1.1 1.0.8802.1.1.2.1.4
It works for me.

Related

Haxe: openfl test works but not lime build

I'm in the process of moving all my projects to individual modules in IntelliJ rather than having one module in the entire git repo, and my IntelliJ builds stopped working. I notice it uses lime builds even though my module is set to openfl (and always has as far as I know)
openfl test flash -debug
this works
lime build GassyRickAstley.xml flash -debug -verbose
this does not. Full gist of both -v
Lime Command-Line Tools (2.9.1)
Initializing project...
Using project file: GassyRickAstley.xml
Warning: Could not read HXCPP config: /Users/booboo/.hxcpp_config.xml
Using target platform: FLASH
Running command: UPDATE
- Embedding asset: removed for brevity
- Copying template file: removed for brevity
Running command: BUILD
- Running command: haxe -main ApplicationMain -cp /usr/local/lib/haxe/lib/flixel/git -D flixel=4.3.0 -cp /usr/local/lib/haxe/lib/openfl/3,6,1 -D openfl=3.6.1 -cp /usr/local/lib/haxe/lib/lime/2,9,1 -D lime=2.9.1 -cp /usr/local/lib/haxe/lib/actuate/1,8,7 -D actuate=1.8.7 -cp /usr/local/lib/haxe/lib/ash/1,5,4/src -D ash=1.5.4 -cp source -cp lib -cp /usr/local/lib/haxe/lib/openfl/3,6,1/extern -cp ../Krakel/source -cp ../../lib/HxAssert/src -D native-trace -D HXCPP_QUIET -D openfl-next -D tools=2.9.1 -D flash-use-stage -D no-compilation -D openfl-flash -D verbose=1 -D web --macro flixel.system.macros.FlxDefines.run() -swf-lib export/flash/obj/assets.swf -swf-version 11.8 -swf export/flash/bin/GassyRickAstley.swf -cp export/flash/haxe -debug
georges-mbp:Gassy Rick Astley booboo$
It doesn't seem like anything went wrong, but I'm pretty shit with analyzing terminal output.
For now I can just build manually, but not having breakpoints is gonna get pretty lame, pretty fast. Any help is appreciated.
Bonus question. When I run/test the project in open fl and close the game's window the active terminal process never ends. I have to close the terminal, reopen and cd my directory again. is there a way around this?
It looks like it may have worked. openfl test flash is similar to running openfl build flash && openfl run flash, which in turn should behave practically the same as lime build flash && lime run flash.
I think your lime build flash command is working properly, but is exiting because the application has finished building. If you use lime test flash instead, it might build-and-run for you, as the other command does?

Gtest file not found by g++

I run a code which needs gtest, but terminal shows:
'gtest/gtest.h' file not found
Here is the command:
$ g++ -w -I ../gtest/include/gtest -I../snap-core -I../glib-core -c run-all-tests.cpp
I think I add the path of gtest, but system did not find it.
You need to change
-I ../gtest/include/gtest
to
-I ../gtest/include/
because you are looking for the tile gtest/gtest.h, not gtest/gtest/gtest.h

Invoking Jython without Weblogic's WLST

I'm using an AIX machine which has Weblogic 9.21 installed and it also has jython as part of its installation (WLST).
Is there a way to run jython code without having to initialize the WLST first?
I have the following jars too if they bring in any ideas:
['.', '/opt/weblogic921/weblogic92/common/lib/jython.jar', '/opt/weblogic921/weblogic92/common/lib/config.jar', '/opt/weblogic921/weblogic92/common/lib/config.jar', '/opt/weblogic921/weblogic92/server/lib/weblogic.jar', '/opt/weblogic921/weblogic92/common/wlst/modules/jython-modules.jar/Lib', '/opt/weblogic921/weblogic92/common/wlst', '/opt/weblogic921/weblogic92/common/wlst/lib', '/opt/weblogic921/weblogic92/common/wlst/modules']
Right now I'm invoking the jython code using:
java -cp /opt/weblogic921/weblogic92/server/lib/weblogic.jar weblogic.WLST file.py
Paste below code in a shell script say jythonExec.sh and use it
Example Usage : /bin/bash jythonExec.sh file.py
#!/bin/bash
jythonJarLoc=/opt/weblogic921/weblogic92/common/lib/jython.jar
javaLoc=/usr/bin/java
pythonCacheDir=/tmp/pythonCacheDir
if [ ! -f ${jythonJarLoc} ]; then
jythonJarLoc=/opt/weblogic921/weblogic92/server/lib/weblogic.jar
fi
${javaLoc} -cp ${jythonJarLoc} -Dpython.cachedir=${pythonCacheDir} org.python.util.jython $#

Selenium2 Servlets

i'd like to add the own servlets by starting of selenium-server-standalone-2.19.0.jar -servlets, but cannot figure out how to do it.
is it possible to find the developer's guide about selenium2 servlets?
one example would be also very nice.
tnx a lot!
a working solution of mine:
1) checkout of http://selenium.googlecode.com/svn/tags/selenium-2.19.0
2) created HubServlet which extends from RegistryBasedServlet
package org.openqa.grid.web.servlet.alpha;
...
public class HubServlet extends RegistryBasedServlet {
...
}
3) building
./go clean release (only once)
./go //java/server/src/org/openqa/grid/selenium:selenium:uber (everytime i change something on org.openqa.grid.web.servlet.alpha.HubServlet)
The solution which worked for me:
svn checkout of the selenium2 sources from googlecode
$ svn co http://selenium.googlecode.com/svn/tags/selenium-2.19.0 selenium
changed to the selenium dir
$ cd selenium
adding servlets folder "alpha"
$ mkdir -p java/server/src/org/openqa/grid/web/servlet/alpha
adding servlets classe(s)
package org.openqa.grid.web.servlet.alpha;
public class HubServlet extends RegistryBasedServlet {
...
}
making HubServlet.jar
$ ./go clean //java/server/src/org/openqa/grid/web/servlet/alpha:HubServlet
getting from googlecode selenium-server-standalone-2.19.0.jar
$ wget http://selenium.googlecode.com/files/selenium-server-standalone-2.19.0.jar -O selenium-server-standalone-2.19.0.jar
merging jar(s)
$ mkdir tmp
$ (cd tmp; jar -xf "build/java/server/src/org/openqa/grid/web/servlet/alpha/HubServlet.jar")
$ (cd tmp; jar -xf selenium-server-standalone-2.19.0.jar)
$ jar -cfM selenium-server-standalone.jar -C $dir_sel_build/tmp .
starting selenium-server-standalone.jar with the "-servlets" parameter
$ java -jar selenium-server-standalone.jar -role hub -servlets org.openqa.grid.web.servlet.alpha.HubServlet
you will see something like:
15.03.2012 16:25:07 org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid server
15.03.2012 16:25:08 org.openqa.grid.web.Hub <init>
INFO: binding org.openqa.grid.web.servlet.alpha.HubServlet to /grid/admin/HubServlet/*
361 [main] INFO org.seleniumhq.jetty7.server.Server - jetty-7.x.y-SNAPSHOT
392 [main] INFO org.seleniumhq.jetty7.server.handler.ContextHandler - started
o.s.j.s.ServletContextHandler{/,null}
400 [main] INFO org.seleniumhq.jetty7.server.AbstractConnector - Started
SocketConnector#0.0.0.0:4444

RVM on debian and rails 3

I'm following https://github.com/diaspora/diaspora/wiki/Installing-on-Debian and trying to get RVM installed on debian. Executing
bash < <(curl -s https://rvm.io/install/rvm)
gives me nothing, it does not result in anything. I have curl installed but the command doesn't generate any output.
You can just download https://rvm.io/install/rvm via browser and then execute bash ./rvm . The command you entered actually executes the same.
EDIT: the new way:
curl -L https://get.rvm.io -o rvm-installer
chmod +x rvm-installer
./rvm-installer
rm -f rvm-installer
Which is equivalent to:
curl -L https://get.rvm.io | bash
The former command was using -s without -S which was hiding errors from curl.