Giving healthy mice gut bacteria from schizophrenic patients caused them to display symptoms of the disease.
Well, if you don't know ahead of time which servers are present in the DB it seems like your problem is the data-structure you're using. Keeping server_name -> member_names in a dict like that and trying to insert it all in one go is not how relational databases work.
Try this:
server_to_id = {}
for server_name in data:
if server_name not in server_to_id:
server = Server.create(name=server_name)
server_to_id[server_name] = server.id
for server_name, member_names in data.items():
server_id = server_to_id[server_name]
member_data = [{'name': name, 'server': server_id} for name in member_names]
Member.insert_many(member_data).execute()
Note: don't forget to call .execute() when using insert() or insert_many().
La veille technologique c'est une question de vie ou de mort. Tu le sais que si tu restes pas à jour t'es foutu ? En tous cas y'a plein de gens pénibles comme moi qui te le répètent en permanence.
Très intéressant... Je m'en servirais en archi microservice. On a tjrs besoin de cache...
2 random lru > lru simple.
Obtenez votre certification AWS ! Prenez des cours de formation Amazon, profitez des ressources de certification Amazon pratiquez afin de vous préparer aux examens de certification.
Did your last Yubikey just break? Perhaps you forgot an offline backup password.
Maybe you're just tired of living like a spy
[https://gist.github.com/grugq/03167bed45e774551155] and never using
smartphones. Whatever it is, you're here, and you're finally ready to give up
on
PGP [https://blog.filippo.io/giving-up-on-long-term-pgp]. That's great!
We're here to help!No one was sending you encrypted emails anyway, so that's
easy enough. But the most widespread uses of PGP are machine-oriented, fo
Welcome to Flask
Flask: web development, one drop at a time
Welcome to Flask’s documentation.
Get started with Installation and then get an overview with the Quickstart.
There is also a more detailed Tutorial that shows how to create a small but complete application with Flask.
Common patterns are described in the Patterns for Flask section.
The rest of the docs describe each component of Flask in detail, with a full reference in the API section.
Flask depends on the Jinja template engine and the Werkzeug WSGI toolkit.
How one CSS collection can define the styles for multiple sites that look different.
Via shaarli
Comparaison du cout de la vie entre Paris et Tokyo
ATTENTION:
- je ne sais pas d’où viennent les données (je n'ai pas encore regarde)
- comparaison de certains prix en comparants les données de chaque pays
- pas d'explication sur les tarifs d'abonnements ni sur les "frais caches"
Chanson du jour (avec les images...)
A cat(1) clone with syntax highlighting and Git integration.
Aller un bon REX ca fait pas de mal ! ( meme en famille ou entre amis parfois... )
A plain docker environment for building static binaries compiled with rust and linked against musl instead of glibc. Built nightly on travis.
This is only useful if you require external C dependencies, because otherwise you could do rustup target add x86_64-unknown-linux-musl.
This container comes with a bunch of statically compiled C libraries using musl-gcc so that we can statically link against these as well.
If you already have rustup installed on the machine that should compile, you might consider cross as a more general solution for cross compiling rust binaries.
Usage
Pull and run from a rust project root:
docker pull clux/muslrust
docker run -v $PWD:/volume --rm -t clux/muslrust cargo build
You should have a static executable in the target folder:
ldd target/x86_64-unknown-linux-musl/debug/EXECUTABLE
not a dynamic executable
From there on, you can include it in a blank docker image (because everything you need is included in the binary) and perhaps end up with a 5MB docker blog image.
This post is intended as a tour of various techniques (not necessarily all practical) of reducing program size, but if you demand some conclusion, the pragmatic takeaway is that:
Compile with --release.
Before distribution, enable LTO and strip the binary.
If your program is not memory-intensive, use the system allocator (assuming nightly).
You may be able to use the optimization level s/z in the future as well.
I didn’t mention this because it doesn’t improve such a small program, but you can also try UPX and other executable compressors if you are working with a much larger application.
Meet Rocket.
Rocket is a web framework for Rust that makes it simple to write fast, secure web applications without sacrificing flexibility, usability, or type safety.
Native desktop client for Slack, Skype, Gmail, Facebook, and more
Via shaarlo et sam&max.
Merci pour le poisson
Check 2G, 3G, and 4G LTE Network Frequency Compatibility for a Smartphone, Tablet, and Mobile Device in any Country and Mobile Network Carrier
David Patterson and Ion Stoica The publication of “Above the Clouds: A Berkeley View of Cloud Computing” on February 10, 2009 cleared up the considerable confusion about the new notion of “Cloud Computing.” The paper defined what Cloud Computing was, where it came from, why some were excited by it, what were its technical advantages, and what were the obstacles and research opportunities for it to become even more popular. More than 17,000 citations to this paper and an abridged version in CACM—with more than 1000 in the past year—document that it continues to shape the discussions and the evolution of Cloud Computing. “Cloud Programming Simplified: A Berkeley View on Serverless Computing” with some of the same authors commemorates the ... Read More
Modification a faire pour gerer gpg-agent
dans C:\Program Files\Git\cmd> start-ssh-pageant
:ssh-pageant-done
gpgconf --launch gpg-agent
:failure
OpenSSH Integration with Pageant
For some users, it may be desirable to tie OpenSSH in to the PuTTY authentication agent (Pageant) using ssh-pageant. This is a drop-in replacement for ssh-agent, which simply builds a connection between OpenSSH and Pageant for key-based authentication. The tool makes it easy to leverage OpenSSH for remote repository access, which tends to be the most reliable choice within the specific context of Git for Windows (Git), without the need to run multiple agents which don't interoperate.
This functionality became available with the release of Git 2.8.2.
Starting ssh-pageant Manually from Git Bash
If you always use Git from within Git Bash, then the most straightforward approach is to have it launch ssh-pageant on your behalf. Simply create/edit your _$HOME/.bashprofile (or $HOME/.profile, if you prefer), and add the following.
# ssh-pageant allows use of the PuTTY authentication agent (Pageant)
SSH_PAGEANT="$(command -v ssh-pageant)"
if [ -x "$SSH_PAGEANT" ]; then
eval $("$SSH_PAGEANT" -qra "${SSH_AUTH_SOCK:-${TEMP:-/tmp}/.ssh-pageant-$USERNAME}")
fi
unset SSH_PAGEANT
The -qra "${TEMP:-/tmp}/.ssh-pageant"
construct is equivalent to the -q -r -a filename
options. In this context it means:
- -a filename -- Bind to a specific socket file (creating it if necessary)
- -r -- Allow reuse of an existing socket file (exit without error if an existing ssh-pageant/ssh-agent process is using it)
- -q -- Quiet mode (don't echo the PID, if starting a new ssh-pageant process)
By specifying the socket name (defaulting to $SSH_AUTH_SOCK
, if set) along with the reuse option, we ensure that only a single running copy of ssh-pageant (per user) is required. Otherwise a separate incarnation would be launched every time Git Bash is invoked.
Verify ssh-pageant Functionality
Now start a new Git Bash session, or source the profile edited just above, and run the ssh-add -l
command. If all is well, and Pageant is running (with one or more keys loaded), you should see something similar to the following.
$ ssh-add -l
4096 SHA256:XjN/glikgdBoBclg4EaN8sJ/ibrxTq7zVydpkUwANzk Heinz Doofenshmirtz (RSA)
Starting ssh-pageant Automatically at Logon
If you use Git from Git CMD, or directly from the Windows command prompt, then you'll probably want to ensure that ssh-pageant is launched automatically at logon time. The start-ssh-pageant.cmd script is provided for this purpose, which resides in the cmd subdirectory of your Git installation.
Setting the Environment
Unlike the Git Bash case above, this scenario requires the SSH_AUTH_SOCK environment variable to be set before running the script... otherwise it will simply exit without performing any action. This is normally configured as a persistent USER variable, with the value specifying the desired socket file path in Unix/MSYS2 format.
NOTE: Since there can only be a single global variable of a given name, this approach may or may not cause conflicts if you have multiple environments which utilize the SSH_AUTH_SOCK setting. Running Git alongside of Cygwin, or MSYS2, for example. One way to address this is to use a fully-qualified Windows path for the socket instead of an environment-specific Unix/MSYS2 path.
Windows 7
Launch the Control Panel, and then select System followed by Advanced system settings. Click on the Environment Variables button, and finally New... in the User variables (not System variables) section. Enter SSH_AUTH_SOCK for Variable name and /tmp/.ssh-pageant-%USERNAME% for Variable value, then click OK.
Now launch a new Git CMD or Windows command prompt (pre-existing sessions won't see the new variable), and enter the command set SSH_AUTH_SOCK
. If all went according to plan, you should see something similar to the following.
C:\Users\heinz.doofenshmirtz> set SSH_AUTH_SOCK
SSH_AUTH_SOCK=/tmp/.ssh-pageant-heinz.doofenshmirtz
NOTE: the cross-environment-compatible (git for windows, msys2, and cygwin) equivalent would require a fully qualified windows path like C:\Users\MYUSERNAME\AppData\Local\Temp\.ssh-pageant-MYUSERNAME
. The correct value can be determined by running a command like cygpath --windows /tmp/.ssh-pageant-%USERNAME%
in a Git Bash window.
Launch ssh-pageant
At this point you should run start-ssh-pageant.cmd manually, in order to verify that the agent starts successfully. Assuming that Git is installed into C:\Program Files\Git, this should look something like:
C:\Program Files\Git\cmd> start-ssh-pageant
Starting ssh-pageant...
SSH_AUTH_SOCK='/tmp/.ssh-pageant-heinz.doofenshmirtz'
SSH_PAGEANT_PID=11444
Assuming that the relevant keys have been loaded into Pageant, you should now be able to perform Git operations which rely upon them using OpenSSH without being prompted for the passphrase.
Configure Automatic Startup
The most common approach is to create a shortcut pointing to start-ssh-pageant.cmd, and place it in your startup folder (Start Menu / Programs / Startup). Once in place, it should be launched automatically when you logon to Windows and be available to all Git processes.
Windows 7
- Click the Start button, right click on All Programs, and select Open
- Navigate into the Programs folder, followed by Startup
- Right-click on an empty spot within Startup, and select New / Shortcut
- Click Browse, navigate to the cmd folder underneath your Git installation, and select start-ssh-pageant.cmd. Click OK.
- Click Next
- Enter an alternate name for the shortcut, if desired, and click Finish
Security Considerations
Since ssh-pageant (like ssh-agent) is intended to bypass the requirement to repeatedly enter your private key password, it's imperative that its socket file be private in order to use it safely. In other words, you want to be extremely careful on multi-user systems to ensure that the SSH_AUTH_SOCK file -- and preferably the directory which includes it -- isn't accessible to anyone else. For a normal Git for Windows configuration this shouldn't be an issue, as /tmp is normally mapped to a private location under your Windows user profile.
MiniSearch is a tiny but powerful in-memory fulltext search engine for JavaScript. It is respectful of resources, and it can comfortably run both in Node and in the browser.
#Use case
MiniSearch addresses use cases where full-text search features are needed (e.g. prefix search, fuzzy search, boosting of fields), but the data to be indexed can fit locally in the process memory. While you may not index the whole Wikipedia with it, there are surprisingly many use cases that are served well by MiniSearch. By storing the index in local memory, MiniSearch can work offline, and can process queries quickly, without network latency.
A prominent use-case is search-as-you-type features in web and mobile applications, where keeping the index on the client-side enables fast and reactive UI, removing the need to make requests to a search server.