From time to time I have to connect to the Internet in public workspaces and wifi zones, that is why I am trying to keep an eye on what ports are reachable on my laptop from outside.
Here is my finding regarding LiClipse:
$ nmap -T4 -p1-65535 192.168.1.4
Starting Nmap 7.01 ( https://nmap.org ) at 2016-07-22 12:34 EEST
Nmap scan report for 192.168.1.4
Host is up (0.00010s latency).
Not shown: 65533 closed ports
PORT STATE SERVICE
22/tcp open ssh
45594/tcp open unknown
$ sudo netstat -tulnp | grep -w -e 45594
tcp6 0 0 :::45594 :::* LISTEN 1637/java
$ ps -f 1637 | cat
UID PID PPID C STIME TTY STAT TIME CMD
oleksiy 1637 4764 23 12:31 ? Sl 2:26 /opt/liclipse/jre/bin/java -Xms40m -Xmx512m -Declipse.p2.unsignedPolicy=allow -Declipse.log.size.max=10000 -Declipse.log.backup.max=5 -Dpydev.funding.hide=1 -Dliclipsetext.funding.hide=1 -Dfile.encoding=UTF-8 -Djava.awt.headless=true -jar /opt/liclipse//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar -data file:/home/oleksiy/Private/workspace/ -os linux -ws gtk -arch x86_64 -showsplash -launcher /opt/liclipse/LiClipse -name LiClipse --launcher.library /opt/liclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444/eclipse_1617.so -startup /opt/liclipse//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar --launcher.overrideVmargs -exitdata 11a800a -vm /opt/liclipse/jre/bin/java -vmargs -Xms40m -Xmx512m -Declipse.p2.unsignedPolicy=allow -Declipse.log.size.max=10000 -Declipse.log.backup.max=5 -Dpydev.funding.hide=1 -Dliclipsetext.funding.hide=1 -Dfile.encoding=UTF-8 -Djava.awt.headless=true -jar /opt/liclipse//plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
To doublecheck that the reason is pure LiClipse I removed extra plugins (Vrapper, Colorer), but the port is still open, not 45594 all times, but a random one each time LiClipse restarts. I tried to connect to and send random data and got no response.
Can someone come up with a guess regarding which part of LiClipse functionality this open TCP port relates to, and why it shouldn't be closed by default as a potential security attack endpoint?
PyDev (which LiClipse includes) creates a port which is used to communicate with a spawned Python shell used to get code-completion information. You can see its code at: https://github.com/fabioz/Pydev/blob/bbe7874a527a583c5214ade594f45d4cc35d3ab7/plugins/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/shell/AbstractShell.java
Related
When doing the following
launch a tmux session named "x11"
tmux -S x11
Detach
CTRL-B d
List available sessions:
tmux list-sessions
I get the following error
kalou#shinwey:~$ tmux list-session
no server running on /tmp/tmux-1000/default
May someone explain what is happening here ?
tmux server is running
kalou#shinwey:~$ ps -efa | grep tmux
kalou 2172 1 0 17:40 ? 00:00:00 tmux -S x11
tmux is using a "pipe", not a socket
tmux:\x20 2172 kalou 3r FIFO 0,12 0t0 32527 pipe
tmux:\x20 2172 kalou 4w FIFO 0,12 0t0 32527 pipe
tmux:\x20 2172 kalou 6u unix 0x00000000c2777ccb 0t0 32528 x11 type=STREAM
How may I force tmux server to use a "socket" ?
How may I force tmux server to use a "pipe" ?
The doc talks about a /tmp/tmux-/default socket ...
Would be very happy about any feedback on this question
Best Regards
Every use of tmux looks at the default socket unless told otherwise.
% tmux -S x11 # attaches to a new session, then I detach
[detached (from session 0)]
% tmux list-sessions
no server running on /private/tmp/tmux-501/default
% tmux -S X11 list-sessions
0: 1 windows (created Thu May 14 12:52:48 2020)
Ok the good syntax to launch a tmux session is
tmux new-session -s <session-name>
I know that Zabbix can monitor any service on Linux machine via two options:
scan particular tcp or udp port, on which the service is bound
or count the service processes with proc.num[<processname>]
It is totally counter-intuitive, because I can spawn processes with the same executable name and they will deceive Zabbix. I'd prefer to use standard service <servicename> status or systemctl status name.service tool. But there are no standard way to use it from Zabbix except system.run[cmd]
Could you help me to write templates for monitoring a particular service state. We want to use different OSes like Centos 7 and Ubuntu 14.04 and 16.04 distributions. It is pity but service <servicename> status is completely different in listed operating systems.
You can also add the following UserParameters in zabbix_agentd.conf to monitor service status in systemd systems. For non-systemd the OS doesn't really monitor service status, the various bash script "status" arguments are often unreliable.
UserParameter=systemd.unit.is-active[*],systemctl is-active --quiet '$1' && echo 1 || echo 0
UserParameter=systemd.unit.is-failed[*],systemctl is-failed --quiet '$1' && echo 1 || echo 0
UserParameter=systemd.unit.is-enabled[*],systemctl is-enabled --quiet '$1' && echo 1 || echo 0
And then e.g. for sshd status create an item with a key like:
systemd.unit.is-active[sshd]
If Linux services are managed by systemd (Centos 7+, Ubuntu 16+, ...), then you can use https://github.com/cavaliercoder/zabbix-module-systemd. It uses standard systemd D-Bus communication - that's what systemctl does under the hood.
For centos 6 it can be done:
UserParameter=check_service_status_asterisk,sudo service asterisk status 2> /dev/null | grep -q "is running";echo $?
For centos 7 or similar it can be created with:
UserParameter=check_service_status_grafana,systemctl status grafana-server 2> /dev/null |sed -n 3p |grep -q "running";echo $?
or
UserParameter=check_service_status[*],systemctl status $1 2> /dev/null |sed -n 3p |grep -q "running";echo $?
When I ran the Mosquitto (MQTT) broker for the first time there was no issue. But however from he second time when i ran it using default config I could not run the code successfully because of the following error:
1379497253: mosquitto version 1.2 (build date 2013-09-17 17:59:39+0530) starting
1379497253: Using default config.
1379497253: Opening ipv6 listen socket on port 1883.
1379497253: Error: Address already in use
I would like to know how to stop the broker from command line. It'll be nice if someone can help.
mosquitto starts to be a service.
sudo vi /etc/mosquitto/mosquitto.conf #more detail in `man mosquitto.conf`
sudo vi /etc/mosquitto/conf.d/custom.conf #add or change listening port as your need
sudo service mosquitto restart
If you don't know the PID, than you can use "pkill" instead of "kill" in linux.
Command: "pkill mosquitto"
You don't say which OS you are using, but assuming it's Linux and you have mosquitto running in the background, you just use the kill command.
Use ps to find the pid of the currently running mosquitto instance then kill the pid.
You can use your own batch script file like mosquit.sh in bash.
This is my script to stop it on CentOS.
#!/bin/sh
sudo kill $(ps aux |awk '/mosquitto/ {print $2}')
Assuming it's the linux service, a kill command will only stop using that particular socket, and will open up on another socket upon killing the PID. On redhat, to kill the service would be systemctl stop mosquitto
For Windows, open a Console as Administrator and use
taskkill /im <programname.exe> /f
Where /im = select by program (image) name, and /f = force -
C:\Users\bburns
> taskkill /im mosquitto.exe
ERROR: The process "mosquitto.exe" with PID 5344 could not be terminated.
Reason: This process can only be terminated forcefully (with /F option).
C:\Users\bburns
> taskkill /im mosquitto.exe /f
SUCCESS: The process "mosquitto.exe" with PID 5344 has been terminated.
i used virt-install to create a DomU image, but i cannot make sure the DomU created is a HVM or a PV.....anyone has any ideas?
On Citrix XenServer 6.2, looking at all the parameters of the VM you'll see refferences to PV or HVM:
# xe vm-list name-label=myVM params=all|grep PV-[kd]
PV-kernel ( RW):
PV-drivers-version (MRO): major: 6; minor: 2; micro: 0; build: 70442
PV-drivers-up-to-date ( RO): true
It turns out, in case of a linux VM, you can see if its PV:
[myVM]$ dmesg | egrep "Booting|Xen ver"
Booting paravirtualized kernel on Xen
Xen version: 4.1.5 (preserve-AD)
I'm not quite sure why PV-kernel does not reflect this. For more details see
determine-which-guest-is-running-on-xen-hvm-or-pv-guest and
is-there-an-os-command-i-can-run-to-determine-if-running-inside-a-xen-based-virt.
Run
virsh edit VM_NAME
Then look for the element inside the element. If the value is linux is PVM.
If your Dom0 is a linux machine , can you please check the output of command "ps -eaf | grep qemu" ? It should state the type of guest running on it (in case it is xen hypervisor that is being used).
The output corresponding to pv guest machine will end with "-M xenpv" and output corresponding to hvm/pvhvm guest machines should end with "-M xenfv". This is what i find in my case.
# ps -eaf | grep qemu
/usr/lib/xen/bin/qemu-dm -d 419 -serial pty -domain-name pvm_guest -videoram 4 -vnc 0.0.0.0:0 -vncunused -M xenpv
/usr/lib/xen/bin/qemu-dm -d 429 -domain-name hvm_guest -videoram 4 -k en-us -vnc 0.0.0.0:0 -vncunused -vcpus 1 -vcpu_avail 0x1 -boot c -serial pty -acpi -net nic,vlan=1,macaddr=00:16:3e:40:94:4f,model=rtl8139 -net tap,vlan=1,ifname=tap429.0,bridge=br0 -M xenfv
In the document(jbossperformancetuning.pdf), it suggest us to enable large page memory for the JVM.
But actually after I added the following to our command-line / script start-up:
"-XX:+UseLargePages"
It didn't work, so I investigated more, enabled the large page memory on OS first, then added "-XX:+UseLargePages -XX:LargePageSizeInBytes=2m" to start-up script.
But unfortunately, it didn't work neither, so could someone give us some suggestions of how to enable the large page memory for the JVM successfully?
Here are some details of our server:
[root#localhost ~]# cat /proc/meminfo
MemTotal: 37033340 kB
MemFree: 318108 kB
Buffers: 179452 kB
Cached: 5934940 kB
SwapCached: 0 kB
...
HugePages_Total: 10251
HugePages_Free: 10251
HugePages_Rsvd: 0
Hugepagesize: 2048 kB
[root#localhost ~]# ps aux | grep java
root 22525 0.2 20.3 28801756 7552420 ? Sl Nov03 31:54 java -Dprogram.name=run.sh -server -Xms1303m -Xmx24g -XX:MaxPermSize=512m -XX:+UseLargePages -XX:LargePageSizeInBytes=2m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true -verbose:gc -Xloggc:/tmp/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/opt/jboss-as/lib/endorsed -classpath /opt/jboss-as/bin/run.jar org.jboss.Main -c default -b 0.0.0.0
root 31962 0.0 0.0 61200 768 pts/2 S+ 22:46 0:00 grep java
[root#localhost ~]# cat /etc/sysctl.conf
...
# JBoss is running as root, so the group id is 0
vm.hugetlb_shm_group = 0
# The pages number
vm.nr_hugepages = 12288
Finally I fixed this issue, at first set the large pages memory bigger than JVM heap size, then just reboot the server, because there is no way to make it work unless you upgrade the kernel to the newer one - in RHEL 6.0.