How do you read the git section in the powerlevel10k prompt? - zsh

I am having a hard time understanding the yellow part of the prompt (git).
What do the !5 ?7 indicate?

Answer here
!5 = 5 unstaged changes
?7 = 7 untracked files

Related

Getting Started with SyntaxNet (start parsing text right away with Parsey McParseface)

I am new to SyntaxNet and I recently tried to install it step by step from https://github.com/tensorflow/models/blob/master/syntaxnet/README.md#instalation.
Although after running bazel test it was said that "Executed 12 out of 12 tests: 12 tests pass"
when I used this code
ubuntu#ubuntu-VirtualBox:~/Downloads/git-2.7.4/models/syntaxnet$
echo 'Bob brought the pizza to Alice.' |syntaxnet/demo.sh
it gives me this error:
syntaxnet/demo.sh: line 31: bazel-bin/syntaxnet/parser_eval:
No such file or directory
syntaxnet/demo.sh: line 43: bazel-bin/syntaxnet/parser_eval:
No such file or directory
syntaxnet/demo.sh: line 55: bazel-bin/syntaxnet/conll2tree:
No such file or directory
I would really appreciate if anyone could help me.
Thank you so much
I had the same issue.
To fix it, modify the demo.sh file, lines 31 and 55.
The locations it points to find parser_eval and conll2tree are wrong, at least they were in my system.
Do a search for "sudo find / -iname 'parser_eval'".
For me the location of this file was "/home/jesus/.cache/bazel/_bazel_jesus/afbbfe6033ddfb6168467a72894e5682/syntaxnet/bazel-out/local-opt/bin/syntaxnet/parser_eval"
I then proceeded to point line 31 to this location instead of "bazel-bin/syntaxnet/parser_eval".
Then did the same for line 55 and conll2tree.
Saved the file, and got it running.
Hope it helps
I had a similar problem, in case it might be useful to anyone. If you rename or move the path where syntaxnet is installed, you'll break half a dozen symbolic links it creates during installation (it uses absolute paths). In that case, you have to recreate the links with the new path.

unix vi file edit not working the text just gets capitalized

Whenever I try to inset and edit text using vi the text is just getting capitalized.
I couldn't enter new text
I do have permissions to edit the file though
When you first start vi, vim and similar clones, it will start up in "command mode." To begin "inserting" more text you, not surprisingly, hit the lower case 'i'.
If you are looking to append to the end of the line, try the capital 'A'.
You really should have a look at a tutorial if you're going to use it more than once: UC Davis 5 minute tutorial on VI
As others will say it is not the most intuitive editor to use.
Always make a backup of the file you are going to edit prior to modifying it.
To use vi: vi filename
To exit vi and save changes: ZZ or :wq
To exit vi without saving changes: :q!
To enter vi command mode: [esc]
Helpful link: http://www.cs.rit.edu/~cslab/vi.html
Found out the server operating system is SunOS 5.10 so it was a little tricky and had to follow this guide from Oracle
http://docs.oracle.com/cd/E19683-01/806-7612/editorvi-14762/index.html

what option controls numeric brace expansion in zsh?

I'm getting a really weird bug on one of my zsh installations. I can do this:
for k in {1..6}; do echo $k; done
# 1
# 2
# 3
# 4
# 5
# 6
but I can't step through it:
for k in {1..6..2}; do echo $k; done
# {1..6..2}
I'm sure my current shell is zsh, and in a different computer it works, so I'm just wondering what option I might have set that changed the default behavior. Any ideas?
While the {x..y} syntax originated in zsh decades ago, ksh93 was the one adding the {x..y..step} one and zsh only added it in version 4.3.10-test-3 in 2010.
You probably have an older version of zsh there.

display problems of zsh in archlinux

Currently I have installed zsh in archlinux (in gnome 3), and every time when I open the terminal, there are 3 "???" before, then I have to change it manually on the options
Actually I have already set the default locale to UTF-8, and it works in the console before I enter the gnome.But after I enter the gnome interface, it did not work.
After I have changed that, it works, but there is another problem, everytime I type a command and press tab, all the command will be shifted right by 2 words, for example if I type ls, it will display like this:
ls becomes lsls
vim becomes vivim
The first 2 letters cannot be cleared, which is very annoying, can anyone help me about this? Thanks
I finally got how to solve this question
After we enabled the locale in the /etc/locale.gen and use locale-gen to generate it. I have to also set the locale system-wide,
create the /etc/locale.conf file
and set the default locale
localectl set-locale LANG="de_DE.UTF-8"
Then if I exit and log again, the oh-my-zsh will work fine.

Log rotation with Plone

The log rotation for Plone product installation would be a nice feature. What are the current best practices regarding the log rotation integration into Plone?
I found this article: http://encolpe.wordpress.com/2010/06/17/how-to-get-log-files-rotate-in-zope-with-buildout/ but as there are no documentation on plone.org I'd like to ping the community for the good known best practices not to fill up their hard disks.
ZConfig has support for the standard library RotatingFileHandler and TimedRotatingFileHandler. Taking an example from the ZConfig tests:
<eventlog>
<logfile>
path /path/to/file.log
level debug
when D
interval 3
old-files 11
</logfile>
</eventlog>
This will roll over the logs every three days, keeping 11 old files.
You place these config snippets your buildout using the event-log-custom/access-log-custom parameters in your instance recipe. plone.recipe.zope2instance
Similar to what Laurence said above but keeps size under 10mb and saves only 1 old file.
<eventlog>
level INFO
<logfile>
path /path/to/plone4/var/log/client1.log
max-size 10mb
old-files 1
</logfile>
</eventlog>
plone.recipe.zope2instance can generate this now. For example, you can specify the following options:
event-log-max-size = 10mb
event-log-old-files = 3
Here's what we do, it's simple but works:
In your buildout you add this part:
[logrotate]
recipe = collective.recipe.template
input = ${buildout:directory}/templates/logrotate.conf
output = ${buildout:directory}/etc/logrotate.conf
And in templates/logrotate.conf
rotate 4
weekly
create
compress
delaycompress
missingok
${buildout:directory}/var/log/instance1.log ${buildout:directory}/var/log/instance1-Z2.log {
sharedscripts
postrotate
/bin/kill -USR2 $(cat ${buildout:directory}/var/instance1.pid)
endscript
}
${buildout:directory}/var/log/instance2.log ${buildout:directory}/var/log/instance2-Z2.log {
sharedscripts
postrotate
/bin/kill -USR2 $(cat ${buildout:directory}/var/instance2.pid)
endscript
}
Add whatever other log rotations you need. Then it's about linking /etc/logrotate.conf to the generated file.
Mikko, you should ask me directly ;)
My blog article is still good and this feature is still undocumented in Zope2. It can be used with Plone 4 and Plone 5. The extension iw.rotatelogs was designed for Plone 3 only.
Using logrotate is not fine because it doesn't handle the case of logwriting during the rotation. It can make your instance crash silently and writing logs in RAM until your restart the instance.
I've been using iw.rotatezlogs since at least early Plone 3 very successfully. I see from your link that I should no longer need iw.rotatezlogs.
I don't like to rely on logrotate, since it's not usable on the one Windows server I have to deploy to.
As near as I can tell, the pure-zope solution (which I stil haven't tested) doesn't do logfile compression (at least I can't see it in ZConfig/components/logger/handlers.xml which is where I think it should be defined), so I suspect I'll be staying with iw.rotatezlogs.

Resources