Moving one line in PuTTY console with Ctrl + Shift + arrow keys - console

Recently I started using vim to development and since that time I'm only using PuTTY instead of NXNoMachine (with GNOME).
When looking up huge console logs I use Shift+PageUp/PageDown a lot to move up/down one screen and I'm used to using one line movement (Ctrl+Shift+Up/Down) as well.
Unfortunately one line movement doesn't work in PuTTY.
Any idea how to make PuTTY allow this?

It's Ctrl+PageUp and Ctrl+PageDown.
See Scrolling the screen back section in PuTTY documentation.

Related

Can I autosave a running jupyter python notebook without having it open in a browser tab?

So I have a long-running python notebook.
As long as it's open in my browser's tab, it's autosaving every 2 minutes, and life is good.
Is it possible to keep it auto-saving even if I close the browser tab?
The kernel already keeps running when I close the tab, which is great.
This is kind of like "screen", but in jupyter
EDIT: Even if I leave the tab open in my browser, I noticed that after 24 hours, the "kernel status" in the top right becomes "disconnected", even though the running cell still has output being piped to it from the server websocket connection
No, you can't (for now), and their will be no point in doing it.
The reason is, as soon as you close your tab, some critical information is lost because it is in the memory of the Javascript VM that run the page.
Any update sent by the kernel after you've closed your page are lost.For example try the following.
create a cell with sleep(10);print('Hello')
Execute the cell
Quickly close and reopen the tab.
the "Hello" will never be printed.
The mapping between the "Execution request" and the "Execution reply" have been lost, and can't be recovered.
The Jupyter team is aware of that. The fixes are not that hard, but require a lot of careful refactor and API design. There was a long in person discussion in NYC at the end of August 2017. Right now the focus is to polish JupyterLab, and once this is done it will be one of the area of focus. It will go hand in hand with real-time collaboration.
In more detail, the fix requires to "move" the notebook model from the client (your browser) to a server side (what is serverside is handwaved for now, but here is not the place to expand it), there are technical questions about that, like what to do with widgets, and when collaborating what state is shared by everyone and what state is per-client. Like if you fold some code, should this be stored ? or not ?
If you are interested in that, I would suggest getting involved with JupyterLab, there will be soon a number of low hanging fruits to contribute that should quickly fix 80% of the usecases.

Game Maker Studio writing in exactly in the middle of a GUI

I'd like to make a pause screen.
In the game the view follows the character and when paused I want the text to be exactly in the middle of the screen. I am using a draw GUI event to display text where the user can see it.
I was thinking of halving the length and width of the port but could not find a function which gave those numbers.
If there is one, what it is, and if not how can I achieve this?
I think I have solved this.
In the GUI event, I use view_hport[0] and view_wport[0] in order to obtain the total length of the port then halve this number.

SIM5216A phone functionality (CFUN) is not maintained

I'm quite new to working with Arduino/GSM and have had problems getting basic HTTP functionality working. I am currently facing multiple problems - one being that the 3G shield I am working with (SIMCOM SIM5216A) does not seem to want to connect to a carrier! :(
However, the problem I would like to focus on for this question is that Phone Functionality - designated through the AT+CFUN command - does not seem to be maintained through power cycles. Additionally, sometimes after modifying the CFUN, the modem will run a soft reset.
Here is the command I have been using to modify the phone functionality of the modem:
AT+CFUN=1,0
I am under the impression that the second parameter should stop it from running a soft reset.
I have attempted to save the AT configuration by following advice in this question's accepted answer - here is the output from power on:
START
+STIN: 25
+STIN: 25
+CPIN: READY
SMS DONE
PB DONE
AT+CFUN=1,0
OK
AT&W
OK
However, whenever I next reset, I will get the following:
AT+CFUN?
+CFUN: 4
OK
So, my question is how can I save the CFUN configuration to be consistent between power cycles? (If you happen to be able to offer advice on why I can see medium-strength signal but cannot connect to an operator network, any advice would be welcome there too, however that is not the focus of this question)
With thanks,
BadDevH.
Exactly what that is saved with AT&W is a rather muddled, see this answer for details. However, regardless of that, the AT+CFUN command is controlling such a dynamic behaviour that I cannot imagine any manufacturer ever that has saved this with &W. Think more of CFUN more like setting a fixed cruise control speed while driving a car. There is no way the car will continue with the speed from last time when started.
For normal phones the default behaviour is value 1 - full functionality - because that is the very core functionality of what they do1, but for a GSM module shield, I am guessing that the default behaviour is set to no radio in order to save power, so it stays off until you need it at which point you need to explicitly turn it on.
1
And even in the case of no sim card present, it shall still be able to make emergency calls.

Pause on one of branches in DirectShow graph

I wrote an app for video capture. That app uses the following graph:
As you see after Smart Tee it has two banches. The first, "Capture", I use for stream handling, the second, "Preview", for show of video on the app's window.
Sometimes an user minimizes that window and using Preview branch is not need. For that case I would like to stop a stream only on this branch.
I can do it by stop and rebuild of all graph without Preview. But I would like don't to stop/rebuild the graph. Perhaps, does somebody knows the other method to do it? Any ideas.
It's not possible to just stop a part of a graph. For such a scenario you need multiple graphs (source, grabber, preview) and the GMFBridge.
By the way, why do you need the tee? Can't you connect the video-renderer to the grabber?

Copying text into minicom doesn't get pasted completely

I am trying to paste a line; which is:
setenv -p STARTUP "ifconfig eth0 -auto;boot -z -elf 136.170.195.87:vmlinuz-nfs-7231b0-D183-NFS-DEBUG 'root=/dev/nfs nfsroot=136.170.195.87:/export/home/joshis1/vmlinuz-nfs-7231b0-D183/rootfs/nfs rw bmem=226M#30M ip=dhcp'"
When I try to copy the line in minicom, the line is not copied completely.
What should I do?
I have solved this by setting Character tx delay to 1ms.
Ctrl+A followed by z
select 't'
select 'f'
type '1'
and there you go!
Maybe you are running without line wrap on? I had a problem until I started invoking with "minicom -w". In the problem condition, output line content beyond screen width was lost, input line content wrapped to beginning of line.
If I'm not wrong you should exit minicom, start it again with "minicom -w".
Or even better, try using 'screen' instead of 'minicom'. I gave up minicom a long time ago in favor of screen. Once you get used to it, you'll never go back!. Chris Stratton was probably right: you're overrunning the target. There is no flow control in virtually all embedded targets. That said, I do these copy operations from screen all the time using screen to set u-boot environment variables, and never have any issues. Depends on your target, too!
Invoke screen something like this:
screen /dev/ttyUSB0 115200
Of course, the device node corresponding to your serial port will be different depending on your serial device. The example above is typical for Linux with a USB serial dongle. On my macbook, it usually comes up as something like this for the same serial dongle:
/dev/tty.usbserial
If you like vi, you'll love screen.
I do like the suggestion of this answer to use screen.
However, if you want to keep using minicom an option is to enable both Software flow control and Line wrap.
To enable Software flow control:
press Ctrl+A followed by o
go down to Serial port setup and enter it
press g to switch Software Flow Control to Yes (if not previously enabled)
press Esc and select Save setup as dfl if you want to permanently save the configuration
To enable Line wrap:
press Ctrl+A followed by o
go down to Screen and keyboard and enter it
press r to switch Line Wrap to Yes (if not previously enabled)
press Esc and select Save setup as dfl if you want to permanently save the configuration
Line wrapping can also be enabled by starting minicom with the -w option or by pressing Ctrl+A followed by w.

Resources