I'm using ssh to do some computations on a remote server, which is in linux whereas my computer is Windows 10. I would like to be able to see plots from gnuplot, but a priori it does not plot anything.
From what I've read, it seems I need to setup X11 forwarding. I installed VcXsrv X server with everything default, and set "export DISPLAY=localhost:0" in the ssh terminal, but then I get an error like pictured below.
From here it seems less clear to me what I should do. It seems many people have a variety of issues which lead to this error, but I don't think I'm doing anything particularly complicated. Some things have mentioned checking some kind of config file or trying something like localhost:10 or 137 or something else, but I'm not even sure if my profile has that kind of config file, and I have no clue how to choose what number to put after localhost.
I'm quite new to this kind of thing so any help is appreciated.
I cannot help with the question of how to get the Windows end of an X11 connection working, but depending on the resolution or type of graphics output needed you may be able to use one of the other gnuplot output modes.
"set term dumb" will send low resolution character-cell graphics back to the terminal window you are typing in. This should work anywhere. The output would look like this:
1 + ***
| ** **
| * * sinc(x) *******
0.8 | * *
| * *
| * *
0.6 | * *
| * *
| * *
0.4 | * *
| * *
0.2 | * *
| ** * * **
| **** *** * * *** ****
0 | *** ** * * ** ***
|** ** * * ** ***
| *** ** ** ***
-0.2 | ****** ******
|
|
-0.4 +-------------------------------------------------------------------------------+
-10 -5 0 5 10
If on the Windows end you run a terminal emulator capable of sixel graphics, then much higher resolution color graphics can be sent directly back to the terminal using "set terminal sixel". See screenshot below.
More complicated options are also possible that involve piping files (png jpeg svg pdf ...) back through the x11 connection for separate display on the Windows end.
Related
i am trying to get or put with TFTP protocol. I set the TFPT server and everything worked but stopped working lately. I am able to connect to the server but am getting an error "unknown option -?" when inspecting the Syslog. When running Tcpdump i see the message is "19 RRQ filename netascii"
i have looked for a couple of days in the net but with no success.
from RFC 1350
opcode operation
1 Read request (RRQ)
2 Write request (WRQ)
3 Data (DATA)
4 Acknowledgment (ACK)
5 Error (ERROR)
2 bytes string 1 byte string 1 byte
------------------------------------------------
| Opcode | Filename | 0 | Mode | 0 |
------------------------------------------------
This is what you have to see in your RRQ or WRQ packet
Quick note, I know this question has been asked here, but the 'answer' gives an alternative which doesn't involve recursion. I want to get recursion working. Here's some code I wrote to demonstrate the problem:
CREATE OR REPLACE PROCEDURE `test` (x INT)
BEGIN
SHOW GLOBAL VARIABLES LIKE 'max_sp_recursion_depth';
IF x = 0 THEN
SELECT 1;
ELSE
CALL `test`(x-1);
END IF;
END
Returns:
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| max_sp_recursion_depth | 64 |
+------------------------+-------+
1 row in set (0.001 sec)
ERROR 1456 (HY000) at line 43 in file: 'workspace.sql': Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine test
What I've tried
I will update this as I try more things:
setting the variable via the MariaDB CLI
setting the variable via PHPMyAdmin
restarting MariaDB
restarted the entire server
restarted my computer (currently running in a development environment on my mac) and the variable has reset to 0
SET GLOBAL ...
does not have any effect on the current connection; only future connections. (Exception: Some variables are "only global"; those probably do show up immediately.)
SET SESSION ...
Is what to do to make it work for the current connection.
I added
max_sp_recursion_depth=255
To the my.cnf file and that fixed the issue. Still unclear as to why the variable wasn't set via the command line, but 🤷 it works. Although I am still interested so if anyone sees this and wants to elaborate, you're an amazing human!
How do I send just a "return" to this telnet server:
got New York
spawn telnet rainmaker.wunderground.com
Trying 35.160.169.47...
Connected to rainmaker.wunderground.com.
Escape character is '^]'.
------------------------------------------------------------------------------
* Welcome to THE WEATHER UNDERGROUND telnet service! *
------------------------------------------------------------------------------
* *
* National Weather Service information provided by Alden Electronics, Inc. *
* and updated each minute as reports come in over our data feed. *
* *
* **Note: If you cannot get past this opening screen, you must use a *
* different version of the "telnet" program--some of the ones for IBM *
* compatible PC's have a bug that prevents proper connection. *
* *
* comments: jmasters#wunderground.com *
------------------------------------------------------------------------------
Press Return to continue:invalid command name ""
while executing
"[tutstack::connect "New York"]"
(file "main.tcl" line 6)
code:
package provide weather 1.0
package require Tcl 8.5
package require Expect
namespace eval ::tutstack {
}
proc ::tutstack::connect {arg1} {
puts "got $arg1"
spawn telnet rainmaker.wunderground.com
set telnet $spawn_id
expect -nocase "Press Return to continue:"
send "$arg1"
}
main:
lappend auto_path /home/thufir/NetBeansProjects/spawnTelnet/telnet/api
package require weather 1.0
[tutstack::connect "New York"]
I've tried variations on send "\r" without success.
Ultimately, would want the script to only partially automate responses and leave the connection open.
expected result:
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$ telnet rainmaker.wunderground.com
Trying 35.160.169.47...
Connected to rainmaker.wunderground.com.
Escape character is '^]'.
------------------------------------------------------------------------------
* Welcome to THE WEATHER UNDERGROUND telnet service! *
------------------------------------------------------------------------------
* *
* National Weather Service information provided by Alden Electronics, Inc. *
* and updated each minute as reports come in over our data feed. *
* *
* **Note: If you cannot get past this opening screen, you must use a *
* different version of the "telnet" program--some of the ones for IBM *
* compatible PC's have a bug that prevents proper connection. *
* *
* comments: jmasters#wunderground.com *
------------------------------------------------------------------------------
Press Return to continue:
Press Return for menu
or enter 3 letter forecast city code--
WEATHER UNDERGROUND MAIN MENU
******************************
1) U.S. forecasts and climate data
2) Canadian forecasts
3) Current weather observations
4) Ski conditions
5) Long-range forecasts
6) Latest earthquake reports
7) Severe weather
8) Hurricane advisories
9) Weather summary for the past month
10) International data
11) Marine forecasts and observations
12) Ultraviolet light forecast
X) Exit program
C) Change scrolling to screen
H) Help and information for new users
?) Answers to all your questions
Selection:
Ideally, I'd like some responses automated but would ultimately want to enter text which is sent to the telnet server as well -- depending on the logic. But for right now, just trying to script some responses.
see also:
expect - telnet connection
thanks meuh:
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$ tclsh main.tcl
got New York
spawn telnet rainmaker.wunderground.com
Trying 35.160.169.47...
Connected to rainmaker.wunderground.com.
Escape character is '^]'.
------------------------------------------------------------------------------
* Welcome to THE WEATHER UNDERGROUND telnet service! *
------------------------------------------------------------------------------
* *
* National Weather Service information provided by Alden Electronics, Inc. *
* and updated each minute as reports come in over our data feed. *
* *
* **Note: If you cannot get past this opening screen, you must use a *
* different version of the "telnet" program--some of the ones for IBM *
* compatible PC's have a bug that prevents proper connection. *
* *
* comments: jmasters#wunderground.com *
------------------------------------------------------------------------------
Press Return to continue:thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$ cat main.tcl
lappend auto_path /home/thufir/NetBeansProjects/spawnTelnet/telnet/api
package require weather 1.0
tutstack::connect "New York"
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$ cat api/weather.tcl
package provide weather 1.0
package require Tcl 8.5
package require Expect
namespace eval ::tutstack {
}
proc ::tutstack::connect {arg1} {
puts "got $arg1"
spawn telnet rainmaker.wunderground.com
set telnet $spawn_id
expect -nocase "Press Return to continue:"
send "$arg1"
}
thufir#dur:~/NetBeansProjects/spawnTelnet/telnet$
All connections are InActConn
I'm a newbie using LVS. I've tried LVS/TUN and LVS/DR, the result is the same, all connections are InActConn. But the realservers can be reach (through PING). Pls help!!!
OS: CentOS 6.2
RemoteAddress:Port Forward Weight ActiveConn InActConn
UDP 192.168.10.240:2345 rr
-> 192.168.10.251:2345 Tunnel 1 0 10
-> 192.168.10.252:2345 Tunnel 1 0 9
-> 192.168.10.253:2345 Tunnel 1 0 9
This is the expected behavior for services not maintaining connections, like UDP. You may want to read the LVS Howto, especially the part about Active/Inactive connections :
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.ipvsadm.html#ActiveConn
Old Question : But I got to this post from Google and want to paste my findings here.
In the above answer, the link pasted by #remi-ggacogne missed 1 step for Real server.
You have to turn rp_filter off (esp. in Centos / RHEL ) https://www.slashroot.in/linux-kernel-rpfilter-settings-reverse-path-filtering
Open /etc/sysctl.conf and paste below lines ( as per your network interface )
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.tunl0.rp_filter = 0
To make the above active -->
$systcl -p
For scripting languages, what is the most effective way to utilize a console when developing? Are there ways to be more productive with a console than a "compile and run" only language?
Added clarification: I am thinking more along the lines of Ruby, Python, Boo, etc. Languages that are used for full blown apps, but also have a way to run small snippets of code in a console.
I am thinking more along the lines of Ruby, ...
Well for Ruby the irb interactive prompt is a great tool for "practicing" something simple. Here are the things I'll mention about the irb to give you an idea of effective use:
Automation. You are allowed a .irbrc file that will be automatically executed when launching irb. That means you can load your favorite libraries or do whatever you want in full Ruby automatically. To see what I mean check out some of the ones at dotfiles.org.
Autocompletion. That even makes writing code easier. Can't remember that string method to remove newlines? "".ch<tab> produces chop and chomp. NOTE: you have to enable autocompletion for irb yourself
Divide and Conquer. irb makes the small things really easy. If you're writing a function to manipulate strings, the ability to test the code interactively right in the prompt saves a lot of time! For instance you can just open up irb and start running functions on an example string and have working and tested code already ready for your library/program.
Learning, Experimenting, and Hacking. Something like this would take a very long time to test in C/C++, even Java. If you tried testing them all at once you might seg-fault and have to start over.
Here I'm just learning how the String#[] function works.
joe[~]$ irb
>> "12341:asdf"[/\d+/]
# => "12341"
>> "12341:asdf"[/\d*/]
# => "12341"
>> "12341:asdf"[0..5]
# => "12341:"
>> "12341:asdf"[0...5]
# => "12341"
>> "12341:asdf"[0, ':']
TypeError: can't convert String into Integer
from (irb):5:in `[]'
from (irb):5
>> "12341:asdf"[0, 5]
# => "12341"
Testing and Benchmarking. Now they are nice and easy to perform. Here is someone's idea to emulate the Unix time function for quick benchmarking. Just add it to your .irbrc file and its always there!
Debugging - I haven't used this much myself but there is always the ability to debug code like this. Or pull out some code and run it in the irb to see what its actually doing.
I'm sure I'm missing some things but I hit on my favorite points. You really have zero limitation in shells so you're limited only by what you can think of doing. I almost always have a few shells running. Bash, Javascript, and Ruby's irb to name a few. I use them for a lot of things!
I think it depends on the console. The usefulness of a CMD console on windows pails in comparison to a Powershell console.
You didn't say what OS you're using but on Linux I been using a tabbed window manager (wmii) for a year or so and it has radically changed the way I use applications - consoles or otherwise.
I often have four or more consoles and other apps on a virtual desktop and with wmii I don't have to fiddle with resizing windows to line everything up just so. I can trivially rearrange them into vertical columns, stack them up vertically, have them share equal amounts of vertical or horizontal space, and move them between screens.
Say you open two consoles on your desktop. You'd get this (with apologies for the cronkey artwork):
----------------
| |
| 1 |
| |
----------------
----------------
| |
| 2 |
| |
----------------
Now I want them side-by-side. I enter SHIFT-ALT-L in window 2 to move it rightwards and create two columns:
------- -------
| || |
| || |
| 1 || 2 |
| || |
| || |
------- -------
Now I could open another console and get
------- -------
| || 2 |
| || |
| | -------
| 1 | -------
| || 3 |
| || |
------- -------
Then I want to temporarily view console 3 full-height, so I hit ALT-s in it and get:
------- -------
| | -------
| || |
| 1 || 3 |
| || |
| || |
------- -------
Consoles 2 and 3 are stacked up now.
I could also give windows tags. For example, in console 2 I could say ALT-SHIFT-twww+dev and that console would be visible in the 'www' and 'dev' virtual desktops. (The desktops are created if they don't already exist.) Even better, the console can be in a different visual configuration (e.g., stacked and full-screen) on each of those desktops.
Anyway, I can't do tabbed window managers justice here. I don't know if it's relevant to your environment but if you get the chance to try this way of working you probably won't look back.
I've added a shortcut to my Control-Shift-C key combination to bring up my Visual Studio 2008 Console. This alone has saved me countless seconds when needing to register a dll or do any other command. I imagine if you leverage this with another command tool and you may have some massive productivity increases.
Are you kidding?
In my Linux environment, the console is my lifeblood. I'm proficient in bash scripting, so to me a console is very much like sitting in a REPL for Python or Lisp. You can quite literally do anything.
I actually write tools used by my team in bash, and the console is the perfect place to do that development. I really only need an editor as a backing store for things as I figure them out.