With requests-toolbelt you can
stream files to a multipart POST, but you can not stream from a pipe, as there
is no way to compute the Content-Length HTTP header.
However, if you are in the situation, that you do know the length and data is
coming from a pipe, you can wrap it with something like this:
class NotAPipe():
""" Implement enough of a file like object, that MultipartEncoder can
use a pipe to stream data """
def __init__ ( self, pipe, length ):
self._pipe = pipe
self._length = length
self._left = self._length
self._hash = hashlib.md5()
def read( self, *args, **kwargs ):
data = self._pipe.read( *args, **kwargs )
self._hash.update( data )
self._left -= len( data )
return data
def md5( self ):
return self._hash.hexdigest()
def __len__( self ):
return self._left
Did your XFCE crash during apt-get dist-upgrade and apt-get is now still running
and waiting for your input? reptyr to the rescue:
reptyr is a utility for taking an existing running program and attaching
it to a new terminal. Started a long-running process over ssh, but have
to leave and don’t want to interrupt it? Just start a screen, use reptyr
to grab it, and then kill the ssh session and head on home.
Luckily gcc and make was installed, so I could build it ;).
Gettin a java.lang.NullPointerException when opening the marketplace in
Eclipse Mars 4.5.2 under Linux?
org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
...
Caused by: java.lang.NullPointerException
at org.eclipse.swt.widgets.TabFolder.gtk_switch_page(TabFolder.java:570)
--- /tmp/command-plugins.conf 2019-05-10 13:15:27.358692552 +0200
+++ /usr/share/icinga2/include/command-plugins.conf 2019-05-10 13:13:03.106517997 +0200
@@ -961,11 +961,13 @@
"-W" = {
value = "$disk_inode_wfree$"
description = "Exit with WARNING status if less than PERCENT of inode space is free"
+ order = -2
}
"-K" = {
value = "$disk_inode_cfree$"
description = "Exit with CRITICAL status if less than PERCENT of inode space is free"
+ order = -2
}
"-p" = {