In the middle of the desert you can say anything you want
xdg-settings
gets the award for least intuitive interface ever.
xdg-settings get default-web-browser
was firefox.xdg-settings set default-web-browser qutebrowser.desktop
is quietxdg-settings get default-web-browser
is still firefox.echo $?
returned 2
, which is file not found
basically.-h
(only --help
), and having --list
as a parameter, but get
/set
as commands.> xdg-settings set default-web-browser
xdg-settings: invalid application name
oh well.
screen -R screename
attaches a screen with this name or creates it.
<C-a> :sessionname newscreenname
renames an existing instance~/.screenrc
exists. Some useful settings:
defscrollback 200000
for “infinite” scrollbackdeflog on
to log everything automaticallyscreen
when no screen is installed1 : connect to it with ssh from any other server that does have screen installed.thought of this myself and really proud of it ↩︎
ssh -L 6006:127.0.0.1:6006 servername -p 1234
maps port 6006 of servername
to localhost:6006
, using ssh that’s running there on port 1234
-L
argumentsIf you do it often, you can add these settings to ~/.ssh/config
:
Host pf
Hostname servername
LocalForward 6007 localhost:6007
LocalForward 6006 localhost:6006
Port 1234
…and then you connect to it as ssh pf
.
sshfs
mounts a remote folder to one on the local filesystem.
sshfs server:/data/me ./local-folder -p 12345
sshfs -o Ciphers=aes128-ctr -o Compression=no server:/data/me ./local-folder -p 12345
may be fasterWhen I tried it at the beginning it was horribly slow, the problem was the zsh
prompt that had info about the current git repo. Disabling it or using bash solved the issue.
To Export settings, File -> Manage IDE Settings -> Export Settings 1
Interestingly the first google result was the similarly named Share your IDE settings | PyCharm, which is a feature in Pycharm Professional and is closer to syncing than to exporting.
If you copy a directory, there may be symlinks there, that will also show fine when you tree
or cat
or whatever. What saved me was their different color in the terminal.
.. How did people do this in b/w terminals?
TODO How can I avoid this in the future, given my heavy symlinks use?
Stumbled yet again1 on mentions of IPython and decided to look into it, prev. assumption being that it’s the same or almost the same thing as Jupyter Notebook. (Also the i
in ipdb
stands for IPython-enabled, apparently).
It’s not., it’s a separate interactive superset of the Python cli that’s runnable by itself through python3 -m IPython
.
Which in turn feels like a better / more interactive shell that can also do magic commands (%xxx
) that I’ve seen in Google Colab / Jupyter; additionally understands bash stuff as-is and does other cool stuff. Definitely worth looking into.
ALSO the same article1 mentions a way of using IPython inside ipdb
, quoting:
ipdb> from IPython import embed
ipdb> embed() # drop into an IPython session.
# Any variables you define or modify here
# will not affect program execution
To run a program with ipdb without editing the source and dropping in an ipdb prompt when if it breaks from shell:
python3 -m ipdb script.py
Took another look at the official docu 26.2. pdb — The Python Debugger — Python 2.7.18 documentation:
p
prints the expression following, pp
pretty-prints it.In Python 3.10+, Unions (Union[str, Path]
) can be also written as str | Path
1
… And the syntax str or Path
I’ve been using and getting no errors from, apparently, doesn’t exist at all. TODO - why did it work?
Pycharm froze, killed it with killall I think, didn’t see it in the process list even (ps aux | grep pycharm
) but couldn’t start it either because it detected an already running instance and refused to start.
The Internet1 suggested pkill -f pycharm
killed whatever was remaining, and I could start it after that. Still no idea what happened though.
Pressing u / d moves you through the individual frames of the stack.
Also TODO look into using it to run stuff and debug automatically on fail, without editing the source code.1