The ideal Linux terminal server has finally come true.
It is called X2Go, and it's open source and free. It's based on the NX protocol and works great, with Windows/Mac/Linux clients.
sudo apt-get install -y supervisor
Let's create a configuration for it called webhooks.conf. This file will be created at /etc/supervisor/conf.d/webhooks.conf:
[program:nodehook]
command=/usr/bin/node /srv/http.js
directory=/srv
autostart=true
autorestart=true
startretries=3
stderr_logfile=/var/log/webhook/nodehook.err.log
stdout_logfile=/var/log/webhook/nodehook.out.log
user=www-data
environment=SECRET_PASSPHRASE='this is secret',SECRET_TWO='another secret'
Then:
supervisorctl reread
supervisorctl update
echo -n "hello" | socat - udp-datagram:192.168.1.255:8080,broadcast
|
It's usually due to bugs in the Wi-Fi home gateway routers (APs), or sometimes in the wireless client chipsets/drivers/software.
On Wi-Fi, sending multicasts from the AP to the wireless clients (this is known in the standard as "From the Distribution System" or "FromDS") is tricky, so there are lots of ways it can fail, and it's easy to introduce bugs.
A couple other things to note, regarding wired to wireless multicast transmissions:
|
update-rc.d command (or in RedHat based distros, chkconfig)
to enable/disable it. This command, btw, uses some mildly complicated
logic to create symlinks in /etc/rc#.d, that control the order of
starting services. If you run ls /etc/rc2.d you can see the order that services will be killed (K##xxxx) and started (S##xxxx).ls /etc/init/*.confstatus servicename
If its an upstart job, it will show this:$ status statd
statd start/running, process 942
But if its not, you'll see something more like this:$ status apache2
status: Unknown job: apache2
In this case, apache2 has not been converted to upstart. So, to disable apache2 you just runsudo update-rc.d apache2 disable
sudo service apache2 stop
Upstart job definitions do not have an update-rc.d command. To
disable the job, you need to edit the job file directly to disable it.
There are two ways to do this.start on' condition. Say you want to install samba, but not have it start automatically.. here is its job file (in natty):description "SMB/CIFS File Server"
author "Steve Langasek <steve.langasek@ubuntu.com>"
start on local-filesystems
stop on runlevel [!2345]
respawn
pre-start script
RUN_MODE="daemons"
[ -r /etc/default/samba ] && . /etc/default/samba
[ "$RUN_MODE" = inetd ] && { stop; exit 0; }
install -o root -g root -m 755 -d /var/run/samba
end script
exec smbd -F
To disable it, you can just put a # in front of the 'start on local-filesystems'. Note that while it won't start back up on boot, you still need to stop it this time withsudo service smbd stop
If, however, you never want it to start, I'd suggest actually
removing the package. If, however, you want it installed, but not
startable, you can also do:mv /etc/init/smbd.conf /etc/init/smbd.conf.disabled
Starting with the version of upstart that will be in 11.04, there is a new keyword that disables the 'start on' and 'stop on' stanzas, it is 'manual'. So another way to disable the service as of 11.04 is to do:command using sudo
echo 'manual' | sudo tee /etc/init/mysql.override
command from root shell
echo manual >> /etc/init/mysql.override
And, hopefully real soon, you will be able to create an "override"
file to disable a service without editing the job definition at all, by
just putting the 'manual' keyword in it.netsh wlan show interfaces
To show the wireless drivers installed run this command. This is
particularly interesting as exploits in drivers do exist and most admins
do not pay as close attention to driver versions as other types of
software:netsh wlan show drivers
To list available wireless networks (similar to Linux’s iwlist scan option)netsh wlan show networks
or
netsh wlan show networks mode=bssid (this shows more BSSID and signal strength)
To view profiles of networks saved on this machine:netsh wlan show profiles
To make Windows connect to the specified profile (usually named after the SSID of the network):netsh wlan connect name="ProfileName"
To export the profile details to an XML file (which includes an encrypted version of the PSK if applicable):netsh wlan export profile name="ProfileName"
netsh wlan delete profile name="ProfileName"
netsh wlan add profile filename=c:\temp\myprofile.xml
XML for a WPA2-PSK Wifi networks looks like this
netsh wlan set hostednetwork mode=allow ssid=SomeSSID key=passphrase
The hosted network is now created but it is not yet started. To start it, issue the command:netsh wlan start hostednetwork
Your Windows box is now advertising a network “SomeSSID” (in this
case) which other machines can connect to. No notification is given on
the Windows box that this has happened and no further notification
happens when someone connects.
etc/sysctl.conf
file:# General gigabit tuning:
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_syncookies = 1
# this gives the kernel more memory for tcp
# which you need with many (100k+) open socket connections
net.ipv4.tcp_mem = 50576 64768 98152
net.core.netdev_max_backlog = 2500
sudo bash
ulimit -n 999999
./your-program
$ cat /proc/net/wireless
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 22
wlan0: 0000 56. -54. -256 0 0 0 0 0 0
OR
$ iw dev wlan0 link
Connected to 00:10:7A:93:AE:BF (on wlan0)
SSID: SECRETSSID
freq: 2462
RX: 89045514 bytes (194863 packets)
TX: 34783321 bytes (164504 packets)
signal: -54 dBm
tx bitrate: 48.0 MBit/s