Is there any haproxy development guide? - load-balancing

Isn't that weird that Haproxy doesn't have any development guide to start for a beginner? For instance, for the university, I have to modify HA, but most of the content I do find on the internet is configurations of haproxy, but how to start developing it, I can't find any references.
Maybe someone knows where to get that information? Even though there are summaries on almost every method in their repo, but it still would be better if there was a more broad explanation.

From: https://github.com/haproxy/haproxy
The more detailed documentation is located into the doc/ directory :
doc/intro.txt for a quick introduction on HAProxy
doc/configuration.txt for the configuration's reference manual
doc/lua.txt for the Lua's reference manual
doc/SPOE.txt for how to use the SPOE engine
doc/network-namespaces.txt for how to use network namespaces under Linux
doc/management.txt for the management guide
doc/regression-testing.txt for how to use the regression testing suite
doc/peers.txt for the peers protocol reference
doc/coding-style.txt for how to adopt HAProxy's coding style
doc/internals for developer-specific documentation (not all up to date)
maybe you wanna start at doc/internals

Related

Perl6: rakudobrew cannot build moar

I'd like to upgrade to the newest version of Perl6,
rakudobrew build moar
Update git reference: rakudo
Cloning into 'rakudo'...
fatal: unable to connect to github.com:
github.com[0: 140.82.114.4]: errno=Connection timed out
Failed running git clone git://github.com/rakudo/rakudo.git rakudo at /home/con/.rakudobrew/bin/rakudobrew line 57.
main::run("git clone git://github.com/rakudo/rakudo.git rakudo") called at /home/con/.rakudobrew/bin/rakudobrew line 397
main::update_git_reference("rakudo") called at /home/con/.rakudobrew/bin/rakudobrew line 368
main::build_impl("moar", undef, "") called at /home/con/.rakudobrew/bin/rakudobrew line 115
this is just a simple connection failure, but how do I fix this?
Your connection problem is not really anything to do with any P6 related software, or in fact any software you're using. It is, as you say, "just a simple connection failure". And most such failures are transient and "fix themselves". As JJ notes, in such scenarios you just wait and then things start working again.
So by the time you read this it'll probably be working for you again without you having fixed anything. But I'm writing an answer anyway with these sections:
Consider not using rakudobrew
Connection problems that "fix themselves"
Connection problems you investigate or fix yourself
Getting around single points of failure
Consider not using rakudobrew
The main purpose of rakudobrew is to support installation of many versions of Rakudo simultaneously and the main audience for the tool is folk hacking on the Rakudo compiler, not those merely using it.
If you're just a regular user, not someone developing the Rakudo compiler and/or don't need to have multiple versions of Rakudo, with complete source code, installed simultaneously, then consider just downloading and installing Rakudo files directly, eg. via rakudo.org/files, rather than via rakudobrew.
Connection problems that "fix themselves"
rakudobrew failed because a git clone ... command failed because the connection with the github.com server timed out.
A server timing out when doing something that usually works using a connection that usually works is likely a transient problem, aka a "please try later" problem.
Transient problems typically "fix themselves" a few seconds, minutes or hours later.
If there's still a problem when you try again, and you want to spend time trying to find out what's going on officially, then look for a status page for that server.
Here are two status pages I know of for github.com:
https://www.githubstatus.com/
https://twitter.com/githubstatus?lang=en-gb.
And for unofficial scuttlebutt I suggest reading the twitter feed.
For me, right now, github.com is working fine and the status page says all systems are go.
So it should now be working for you too.
If it's not, then you can wait longer, or investigate. It you want to investigate, start by looking at the status pages above.
Connection problems you investigate or fix yourself
If github claims it's working fine then there's presumably a problem with your local internet "on-ramp" (your system or your internet service provider's) or somewhere further afield between your on-ramp and the server you're failing to connect to. (You can only know approximately where the server is based on which region of the world administers the IP address the server is associated with at any given moment.)
The next place to look will be places like the internet traffic report; this indicates traffic jams and the like across the planet. (Ignore the visual display, which is broken on some browsers, and click on the links in the table to drill down.)
If it's all green between you and the region that administers the IP address of the server you're failing to connect to, then the next place to turn would be your system's administrator and/or ISP.
Failing that, then perhaps you can ask a question at a sister stackexchange site like serverfault.com or superuser.com.
Getting around single points of failure
Perhaps you were thinking there might be some system redundancy and/or you're interested in that aspect.
P5's ecosystem and its tools are generally mature and limit spofs. This is unlike the ecosystems and tools of most of the other languages out there; so if you've gotten used to the remarkable reliability/availability of CPAN due to its avoidance of spofs, and by extension perlbrew, well, you've been spoiled by P5.
The P6 ecosystem/tool combinations are evolving in the P5 tradition.
For example, the zef package manager automatically connects to CPAN alongside github, and is built to be able to connect to other repos. The ecosystem is partway there to take advantage of this zef capability in that many modules are redundantly hosted on both CPAN and github.
rakudobrew ignores CPAN and assumes use of git repos. It is impressively configurable via its Variables.pm file which includes a %git_repos variable, which could be re-targeted to an alternative git repo site like gitlab. But no one has, to my knowledge, arranged to redundantly copy and update the relevant rakudo files to another git repo site, so this spof-avoidance ability apparently inherent in rakudobrew's code is, afaik, moot for now.

SSH source code example

I would like to write my own implementation of a SSH daemon that is not based on OpenSSL. It shall be used in a non Linux-oid environment.
Is there any public domain source code for a SSH domain (probably not full-featured) available?
A number of small SSH daemons exist that may be adaptable to your environment.
If your concern is about licensing, then pick example code that is not GPL, and you'll be free to do whatever you like with it. (Note that OpenSSH uses the BSD license, so you are free to do whatever you like with it.) Dropbear is a nice, small server that often gets used in embedded environments.
Also, check out Wikipedia's Comparison of SSH servers. It's not complete, but it provides some food for thought.
If your goal is to write your own daemon, can't you just read the source code of OpenSSH, if it is too complex, then you can maybe have a look on:
http://plan9.bell-labs.com/sources/contrib/blstuart/ssh/
I think this one is released under Lucent Public License Version and written i Plan 9 C, which is a little bit different to C89 or C99. But should be quite easy to understand.
http://www.gnu.org/licenses/license-list.html#lucent102
Or have a look on the Erlang implementation of SSH.
https://github.com/erlang/otp/tree/maint/lib/ssh/src
Good luck!
There are already pointers to source code samples by emil and ghoti.
But I think to start such a project you should read the documentation of the underlying protocols.

what does “GCMRegsistrar.register” do?

follow this link:https://developer.android.com/guide/google/gcm/demo.html
At home i can run the gcm demo successfully.
But in the company, it runs failed with ‘authentication failed’
I think there is something wrong with the networks in my workplace(blocked ip or Protocol).
Because i cant find the source code of gcm jars.
So,does anyone know what happened when the client invoke the ‘GCMRegsistrar.register’?
I want to ask our network admin to help me to solve this problem.
I've got the Answer:https://groups.google.com/forum/#!topic/android-gcm/7qPUp0Ym3Ak
Note:
If your organization has a firewall that restricts the traffic to or from the Internet, you'll need to configure it to allow connectivity with GCM. The ports to open are: 5228, 5229, and 5230. GCM typically only uses 5228, but it sometimes uses 5229 and 5230. GCM doesn't provide specific IPs. It changes IPs frequently. We recommend against using ACLs but if you must use them, take a broad approach such as the method suggested in this support link.
It is helpful to me.
You can find this kind of answers in the offical documentation, here.
Considering this, register() method is the one responsible for
Initiate messaging registration for the current application.
You should take a look at method description, here.

AD/LDAP authentication for FitNesse

We are going to put FitNesse on a server and wants to have a AD/LDAP authentication solution for this.
Does anyone have experience with good and easy to set up solutions for this?
Thanks in advance. Magnus
One straightforward method would be to download the standard edition of the UnboundID LDAP SDK and get a copy of the jsse.jar file and install both jar files in the fitness lib directory. Create a class in the fitness.authentication package that extends the fitness.authentication.Authenticator class and overrides the isAuthenticated() method. Specify the required properties such as hostname, port, simple or SASL bind, whether to use SSL or StartTLS, base object, search scope, and so forth.
The jsse.jar will provide the necessary SSL classes so that SSL and StartTLS can be implemented as required.
see also
LDAP: Programming practices
It is possible, but it would require either finding or creating a plugin to do it.
I found the following, but I have never tried it:
https://github.com/timander/fitnesse-ldap-authenticator.
Also out there, but older is: https://github.com/dleonard0/fitnesse
You can start there, but you might have to get your hands dirty. Unfortunately, I'm just not that familiar with that part of the code.
See here: http://fitnesse.org/FitNesse.UserGuide.AdministeringFitNesse.SecurityDescription.SpnegoAuthentication
I need to give many more characters to make stakeoverflow happy.

Using erldis on ejabberd Module?

I'm working on an ejabberd module that requires erldis.
I'm having problems starting the rldis application from in the ejabberd module initialization.
Any tips, tutorial on how to integrate? Which files are required to be copied to ejabberd/ebin? What is the recommended start sequence?
I have found this example of using Redis with ejabberd:
http://logicalfriday.com/2011/06/30/ejabberd-global-roster/
A quick read shows that it is not totally integrated in ejabberd (even in term of start / stop), but that can help.
I do not know what your module is supposed to do, so it is hard to suggest a better approach at this stage.
I did similar here: https://github.com/bob-p/mod_global_roster this might give you a few pointers.