Re: [dev] [sandy] Additional key tests

2014-07-23 Thread Dimitris Zervas
>What do you think?
The main question (which I forgot to ask) is how can I minimize the amount of 
key definitions.




[dev] [sandy] Additional key tests

2014-07-23 Thread Dimitris Zervas
Hello,

Sandy's key bindings are based on tests.
The number of tests have started to grow and a there are times that a key is 
defined 6 or more times to do a simple job.
Also, I want to add an expand mode (to make diw command possible) and until 
mode (dta command), which would mean even more key definitions.

I was thinking to make multi-command keys defined with an array of  functions 
and arguments,
but that's not an efficient solution and I don't like it.

What do you think?



Re: [dev] [st] Erasing UTF-8 characters in ed

2014-07-23 Thread Hiltjo Posthuma
On Thu, Jul 24, 2014 at 12:44 AM, Alexandre Niveau
 wrote:
> ...
> It may be that one's not supposed to use backspaces in ed, but this
> behaviour is weird nonetheless…

I have the same issue in mg. This question also comes up occasionally
on IRC. Reverting the commit you specified seems to work for mg (but
may break other applications?) Can anyone shed a light on it, for
science?

Kind regards,
Hiltjo



[dev] [st] Erasing UTF-8 characters in ed

2014-07-23 Thread Alexandre Niveau
Hello,

I've been using st for a while now; it works great. Thanks to the devs
and maintainers!

I have a problem though, when using ed; I don't know whether it's a
bug in st or elsewhere. When typing a line in ed, using backspace to
erase a  multibyte UTF-8 character *seems* OK visually, but does not
work: only the last byte is really removed, leaving an invalid UTF-8
character. For example, 3-byte characters need 3 backspaces to be
erased, but the terminal shows 3 characters erased.

Steps to reproduce (^H is a backspace):
$ ed test
a
aé^Ha
.
p
wq

The resulting file contains bytes 61 c3 61 0a.

I tried GNU ed, ed from 9base, and sam -d, launched from bash and
9base's rc. They all have this behaviour in st, both in version 0.5
and tip (using stty erase ^H for tip, as explained in this commit
summary 
http://git.suckless.org/st/commit/config.def.h?id=c46d929fe18e4a3c9c41101eafa7a9668c8c8830
— as a side note, wouldn't this be worth mentioning in the FAQ?).

However in xterm, gnome-terminal, and lxterminal, both ed and sam -d
work as expected.

It may be that one's not supposed to use backspaces in ed, but this
behaviour is weird nonetheless…

-- A.N.



Re: [dev] LDAP

2014-07-23 Thread Andrew Hills
On 7/23/14, 3:52 PM, Calvin Morrison wrote:
> That's just silly. Why would you be so sucky of any admin to require
> users to change passwords on 10 systems when they are all identical?
> This is somewhat of a small cluster, worker nodes, a services node, a
> storage node, a head node etc.

Users are not permitted password authentication on my systems, so I
didn't bother synchronizing shadow.




signature.asc
Description: OpenPGP digital signature


Re: [dev] LDAP

2014-07-23 Thread FRIGN
On Wed, 23 Jul 2014 22:28:45 +0200
Alexander Tanyukevich  wrote:

> Use ldap.
> It has replication mechanisms.
> It has tonns of documentation and examples.
> It is fast and reliable (you can setup master-master replication and
> slave on every server.. so even without network it will work) ... I
> don't know better solution.

I've had a lot of good results with rsync over ssh for both the
user-folders and the shadow-file.
It also scales really well even for many clients.

Cheers

FRIGN

-- 
FRIGN 



Re: [dev] LDAP

2014-07-23 Thread Alexander Tanyukevich
On Wed, Jul 23, 2014 at 10:11 PM, Calvin Morrison
 wrote:
> On 23 July 2014 16:06, Alexander Tanyukevich  wrote:
>> On Wed, Jul 23, 2014 at 9:21 PM, Calvin Morrison  
>> wrote:
>>>
>>> LDAP sucks, is there any good alternative for managing user logins
>>> over 5-10 servers?
>>
>> What is wrong with LDAP from your point of view ?
>> Pam has gazilion of modles, and it looks like it's not so hard to
>> write your own. And use maria/postgres/another server's shadow
>> file/facebook/pop3/xmpp server as a backend to store
>> users/passwords/uids/homedirs  etc
>
> NFS for users data, but all the login data i want to be synced across
> the servers. I want users to be able to it themselves
>
> LDAP is overly complicated, overly suckly, and less reliable than
> using the native login tools of our linux systems.
>
> recently i have been experimenting with using json over ruby compiled
> on Node.JS as our login manajer though  /s
>

Use ldap.
It has replication mechanisms.
It has tonns of documentation and examples.
It is fast and reliable (you can setup master-master replication and
slave on every server.. so even without network it will work) ... I
don't know better solution.

-- 
Alexander Tanyukevich
atanyukev...@gmail.com



Re: [dev] LDAP

2014-07-23 Thread Calvin Morrison
On 23 July 2014 16:06, Alexander Tanyukevich  wrote:
> On Wed, Jul 23, 2014 at 9:21 PM, Calvin Morrison  
> wrote:
>>
>> LDAP sucks, is there any good alternative for managing user logins
>> over 5-10 servers?
>
> What is wrong with LDAP from your point of view ?
> Pam has gazilion of modles, and it looks like it's not so hard to
> write your own. And use maria/postgres/another server's shadow
> file/facebook/pop3/xmpp server as a backend to store
> users/passwords/uids/homedirs  etc

NFS for users data, but all the login data i want to be synced across
the servers. I want users to be able to it themselves

LDAP is overly complicated, overly suckly, and less reliable than
using the native login tools of our linux systems.

recently i have been experimenting with using json over ruby compiled
on Node.JS as our login manajer though  /s



Re: [dev] LDAP

2014-07-23 Thread Alexander Tanyukevich
On Wed, Jul 23, 2014 at 9:21 PM, Calvin Morrison  wrote:
>
> LDAP sucks, is there any good alternative for managing user logins
> over 5-10 servers?

What is wrong with LDAP from your point of view ?
Pam has gazilion of modles, and it looks like it's not so hard to
write your own. And use maria/postgres/another server's shadow
file/facebook/pop3/xmpp server as a backend to store
users/passwords/uids/homedirs  etc

-- 
Alexander Tanyukevich
atanyukev...@gmail.com



Re: [dev] LDAP

2014-07-23 Thread Markus Teich
Calvin Morrison wrote:
> > I think passwd entries should suffice. The admin should not be responsible
> > for synchronizing the users files. Maybe he is so kind and offers a network
> > mount available on every server.
> 
> That's just silly. Why would you be so sucky of any admin to require users to
> change passwords on 10 systems when they are all identical?  This is somewhat
> of a small cluster, worker nodes, a services node, a storage node, a head node
> etc.

Heyho,

sorry if it was not clear enough. Of course I meant to include /etc/shadow or
wherever your systems store the actual passwords and every other file owned by
root. However the management of the users ${HOME}/.{gitconfig,ssh/config,bashrc}
etc. should be left to the user.

Of course you can add a sane .ssh skeleton including a freshly generated key and
host entries for every server when adding the user, but after that point I don't
think you should mess with the files actually belonging to the user.

--Markus



Re: [dev] LDAP

2014-07-23 Thread Calvin Morrison
On 23 July 2014 15:37, Markus Teich  wrote:
> Calvin Morrison wrote:
>> I like that, but then I guess I need to propogate all changes for my
>> users, like passwords and such?
>
> Heyho,
>
> I think passwd entries should suffice. The admin should not be responsible 
> for synchronizing the users files. Maybe he is so kind and offers a network 
> mount available on every server.

That's just silly. Why would you be so sucky of any admin to require
users to change passwords on 10 systems when they are all identical?
This is somewhat of a small cluster, worker nodes, a services node, a
storage node, a head node etc.



Re: [dev] LDAP

2014-07-23 Thread Andrew Hills
On 7/23/14, 3:29 PM, Dimitris Papastamos wrote:
> Are these scripts somewhere publicly available?  I'd like to have a
> look if possible.

No, but I'll clean them up a little later this week. They're really
nothing special; all my machines run Linux, so it's just
useradd/usermod/userdel and some fluff. Also, an hourly script that
checks getent passwd against the master for non-system accounts, and
emails me when there's a problem. I was going to try to use cfengine,
but after ten minutes of trying to find even the most basic information,
I just hacked some shell scripts together instead. You could do the same
as or better than me in half an hour. I copy SSH public keys when a new
account is created/machine is added; beyond that, users are responsible
for handling themselves. I thought about creating per-machine access
lists, but then I stopped thinking about it because I didn't need it. Sorry.



signature.asc
Description: OpenPGP digital signature


Re: [dev] LDAP

2014-07-23 Thread Markus Teich
Calvin Morrison wrote:
> I like that, but then I guess I need to propogate all changes for my
> users, like passwords and such?

Heyho,

I think passwd entries should suffice. The admin should not be responsible for
synchronizing the users files. Maybe he is so kind and offers a network mount
available on every server.

--Markus



Re: [dev] LDAP

2014-07-23 Thread Dimitris Papastamos
On Wed, Jul 23, 2014 at 03:25:58PM -0400, Andrew Hills wrote:
> On 7/23/14, 3:21 PM, Calvin Morrison wrote:
> > LDAP sucks, is there any good alternative for managing user logins
> > over 5-10 servers?
> 
> I declare one server the master and manage accounts through there with
> some simple scripts and ssh.

Hey,

Are these scripts somewhere publicly available?  I'd like to have a
look if possible.



Re: [dev] LDAP

2014-07-23 Thread Calvin Morrison
I like that, but then I guess I need to propogate all changes for my
users, like passwords and such?

On 23 July 2014 15:25, Andrew Hills  wrote:
> On 7/23/14, 3:21 PM, Calvin Morrison wrote:
>> LDAP sucks, is there any good alternative for managing user logins
>> over 5-10 servers?
>
> I declare one server the master and manage accounts through there with
> some simple scripts and ssh.
>



Re: [dev] LDAP

2014-07-23 Thread Andrew Hills
On 7/23/14, 3:21 PM, Calvin Morrison wrote:
> LDAP sucks, is there any good alternative for managing user logins
> over 5-10 servers?

I declare one server the master and manage accounts through there with
some simple scripts and ssh.



signature.asc
Description: OpenPGP digital signature


[dev] LDAP

2014-07-23 Thread Calvin Morrison
LDAP sucks, is there any good alternative for managing user logins
over 5-10 servers?

Calvin



Re: [dev] Simple question

2014-07-23 Thread Dimitris Papastamos
You mostly ask about data structures, but I thought I'd share one of my
favorite algorithms.  The core rsync algorithm as described here[0] is quite
simple and brilliant.

Another interesting data structure is a Bloom filter[1].

I forgot to mention previously, that rb/AVL trees are also used for implementing
a virtual memory subsystem.

[0] http://www.andrew.cmu.edu/course/15-749/READINGS/required/cas/tridgell96.pdf
[1] http://en.wikipedia.org/wiki/Bloom_filter



Re: [dev] Simple question

2014-07-23 Thread Robert Ransom
On 7/23/14, Guillaume Quintin  wrote:

> I was wondering if there was some program out there that uses
> algorithms such as red-black trees, B-trees, binomial heaps, fibonacci
> heaps, etc. Do you know any ? This is just for my curiosity.

PuTTY () uses a
small-degree B-tree (see tree234.[hc]).

Tweak (by the same author;
) uses a
larger-degree B-tree, with the added feature that it counts the number
of bytes under each node.


Robert Ransom



Re: [dev] Simple question

2014-07-23 Thread Dimitris Papastamos
On Wed, Jul 23, 2014 at 07:49:09PM +0200, Guillaume Quintin wrote:
> Hi,
> 
> I was wondering if there was some program out there that uses
> algorithms such as red-black trees, B-trees, binomial heaps, fibonacci

rb-trees/avl trees can be found in many programs.  Do a code search on
the macros defined in tree.h (originally a BSD header).  A few years ago
I worked on a caching layer[0] using rb-trees (splay trees would have been
another choice but the kernel lacked an implementation).

In my experience B-trees are used much less frequently than rb-trees.
They are usually found in filesystem implementations.

binomial heaps are useful for implementing priority queues.  Again look
up some standard interfaces to find examples of how to use them.

I've never seen a fibonacci heap in any of the projects I've worked on.

[0] http://lxr.free-electrons.com/source/drivers/base/regmap/regcache-rbtree.c



Re: [dev] Simple question

2014-07-23 Thread Troels Henriksen
Guillaume Quintin  writes:

> Hi,
>
> I was wondering if there was some program out there that uses
> algorithms such as red-black trees, B-trees, binomial heaps, fibonacci
> heaps, etc. Do you know any ? This is just for my curiosity.

The implementation of std::map in the GNU C++ library is a red-black
tree.

-- 
\  Troels
/\ Henriksen



Re: [dev] Simple question

2014-07-23 Thread Markus Teich
Guillaume Quintin wrote:
> I was wondering if there was some program out there that uses
> algorithms such as red-black trees, B-trees, binomial heaps, fibonacci
> heaps, etc. Do you know any ? This is just for my curiosity.

Heyho Guillaume,

have a look at the kernel sources.

--Markus



[dev] Simple question

2014-07-23 Thread Guillaume Quintin
Hi,

I was wondering if there was some program out there that uses
algorithms such as red-black trees, B-trees, binomial heaps, fibonacci
heaps, etc. Do you know any ? This is just for my curiosity.

coincoin169.



Re: [dev] sufr + tabbed

2014-07-23 Thread Bigby James
On 07/23, Adam Pribyl wrote:
> Now the only thing I miss using surf is any kind of login/password manager.
> Is there something? I thought http://suckless.org/other_projects passman
> project maybe, but link is 404...
> 

Check out pass.[1]

[1]: http://www.passwordstore.org/

-- 
"A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams




Re: [dev] sufr + tabbed

2014-07-23 Thread Gregor Best
On Wed, Jul 23, 2014 at 11:04:48AM +0200, Adam Pribyl wrote:
> [...]
> Now the only thing I miss using surf is any kind of login/password manager.
> Is there something? I thought http://suckless.org/other_projects passman
> project maybe, but link is 404...
> [...]

Some time ago, i cobbled together [0]. It's a simple shell script that
autogenerates passwords, and, if you want, also usernames. The
generation uses a constant random seed and pwgen, plus a salt for each
password, so it should be quite hard to predict the passwords that come
out of it.

It uses DMenu to display a list of password entries, and xclip to put
the username and password into the X selection, with a three second
delay between each. After the password has been in the selection for
three seconds, it is replaced with a random number to prevent leaks.

This can be used for anything that requires you to enter a
username/password combination, for example SSH logins (though for SSH
public key authentication is probably a smarter approach), serial
console logins to network switches or, well, websites.

[0]: https://github.com/farhaven/pwman

-- 
Gregor Best
--

Did you know ...

That no-one ever reads these things?



Re: [dev] sufr + tabbed

2014-07-23 Thread Adam Pribyl

On Wed, 23 Jul 2014, Markus Teich wrote:


Adam Pribyl wrote:
> I am using surf + tabbed, when I press Ctrl+t to open a new tab, I may
> enter a "string" - I thought it should be URL for a new tab, but it
> does nothing. If I do not enter anything it does not open a new tab. What
> is the purpose of the "string"?

Heyho Adam,

you have to start tabbed/surf with at least the following arguments:

tabbed -r 2 surf -e ''


Used "surf-open.sh" script provided with sruf to start it, this was a bad 
idea. Thanks.



> Now the only thing I miss using surf is any kind of login/password
> manager. Is there something? I thought 
> http://suckless.org/other_projects

> passman project maybe, but link is 404...

See: http://surf.suckless.org/files/autologin


OK, I saw this. Not sure I can write scripts for all sites I use..



--Markus


Adam Pribyl




Re: [dev] sufr + tabbed

2014-07-23 Thread Markus Teich
Adam Pribyl wrote:
> I am using surf + tabbed, when I press Ctrl+t to open a new tab, I may 
> enter a "string" - I thought it should be URL for a new tab, but it 
> does nothing. If I do not enter anything it does not open a new tab. What 
> is the purpose of the "string"?

Heyho Adam,

you have to start tabbed/surf with at least the following arguments:

tabbed -r 2 surf -e ''

> Now the only thing I miss using surf is any kind of login/password 
> manager. Is there something? I thought http://suckless.org/other_projects 
> passman project maybe, but link is 404...

See: http://surf.suckless.org/files/autologin

--Markus



[dev] sufr + tabbed

2014-07-23 Thread Adam Pribyl
I am using surf + tabbed, when I press Ctrl+t to open a new tab, I may 
enter a "string" - I thought it should be URL for a new tab, but it 
does nothing. If I do not enter anything it does not open a new tab. What 
is the purpose of the "string"?


Now the only thing I miss using surf is any kind of login/password 
manager. Is there something? I thought http://suckless.org/other_projects 
passman project maybe, but link is 404...



Adam Pribyl