Diego Escalante Urrelo: Habits and engagement
Nir Eyal Automatic customers: How to design user habits at WordCamp San Francisco 2012:
Nir Eyal Automatic customers: How to design user habits at WordCamp San Francisco 2012:
TL;DR: Do not enable net.ipv4.tcp_tw_recycle.
The Linux kernel documentation is not very helpful about what
net.ipv4.tcp_tw_recycle does:
Enable fast recycling TIME-WAIT sockets. Default value is 0. It
should not be changed without advice/request of technical experts.
Its sibling, net.ipv4.tcp_tw_reuse is a little bit more documented
but the language is about the same:
Allow to reuse TIME-WAIT sockets for new connections when it is
safe from protocol viewpoint. Default value is 0. It should not be
changed without advice/request of technical experts.
The mere result of this lack of documentation is that we find numerous
tuning guides advising to set both these settings to 1 to reduce the
number of entries in the TIME-WAIT state. However, as stated by
tcp(7) manual page, the net.ipv4.tcp_tw_recycle option is quite
problematic for public-facing servers as it won t handle connections
from two different computers behind the same NAT device, which is a
problem hard to detect and waiting to bite you:
Enable fast recycling of TIME-WAIT sockets. Enabling this option
is not recommended since this causes problems when working with NAT
(Network Address Translation).
I will provide here a more detailed explanation in the hope to teach
people who are wrong on the Internet.
As a sidenote, despite the use of ipv4 in its name, the
net.ipv4.tcp_tw_recycle control also applies to IPv6. Also, keep in
mind we are looking at the TCP stack of Linux. This is completely
unrelated to Netfilter connection tracking which may be tweaked in
other ways1.
TIME-WAIT state
Let s rewind a bit and have a close look at this TIME-WAIT state.
What is it? See the TCP state diagram below2:
Only the end closing the connection first will reach the
TIME-WAIT state. The other end will follow a path which usually
permits to quickly get rid of the connection.
You can have a look at the current state of connections with ss
-tan:
$ ss -tan head -5 LISTEN 0 511 *:80 *:* SYN-RECV 0 0 192.0.2.145:80 203.0.113.5:35449 SYN-RECV 0 0 192.0.2.145:80 203.0.113.27:53599 ESTAB 0 0 192.0.2.145:80 203.0.113.27:33605 TIME-WAIT 0 0 192.0.2.145:80 203.0.113.47:50685
TIME-WAIT state:
TIME-WAIT state is deficient3. Here is an example of
what could be avoided if the TIME-WAIT state wasn t shortened:
LAST-ACK state4. Without the TIME-WAIT state, a
connection could be reopened while the remote end still thinks the
previous connection is valid. When it receives a SYN segment (and
the sequence number matches), it will answer with a RST as it is
not expecting such a segment. The new connection will be aborted
with an error:
RFC 793 requires the TIME-WAIT state to last twice the time of the
MSL. On Linux, this duration is not tunable and is defined in
include/net/tcp.h as one minute:
#define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT * state, about 60 seconds */
TIME-WAIT state is a good thing.
ss -tan state time-wait wc -l is not a problem per se!
TIME-WAIT state is kept for one minute in the
connection table. This means, another connection with the same
quadruplet (source address, source port, destination address,
destination port) cannot exist.
For a web server, the destination address and the destination port are
likely to be constant. If your web server is behind a L7
load-balancer, the source address will also be constant. On Linux, the
client port is by default allocated in a port range of about 30,000
ports (this can be changed by tuning
net.ipv4.ip_local_port_range). This means that only 30,000
connections can be established between the web server and the
load-balancer every minute, so about 500 connections per second.
If the TIME-WAIT sockets are on the client side, such a situation is
easy to detect. The call to connect() will return EADDRNOTAVAIL
and the application will log some error message about that. On the
server side, this is more complex as there is no log and no counter to
rely on. In doubt, you should just try to come with something sensible
to list the number of used quadruplets:
$ ss -tan 'sport = :80' awk ' print $(NF)" "$(NF-1) ' \ > sed 's/:[^ ]*//g' sort uniq -c 696 10.24.2.30 10.33.1.64 1881 10.24.2.30 10.33.1.65 5314 10.24.2.30 10.33.1.66 5293 10.24.2.30 10.33.1.67 3387 10.24.2.30 10.33.1.68 2663 10.24.2.30 10.33.1.69 1129 10.24.2.30 10.33.1.70 10536 10.24.2.30 10.33.1.73
net.ipv4.ip_local_port_range to
a wider range,net.ipv4.tcp_tw_reuse and
net.ipv4.tcp_tw_recycle. Don t do that yet, we will cover those
settings later.
TIME-WAIT state. How much memory
does it represent? Not that much!
First, from the application point of view, a TIME-WAIT socket does
not consume any memory: the socket has been closed. In the kernel, a
TIME-WAIT socket is present in three structures (for three different purposes):
TIME-WAIT state and a list of regular active
connections. The size of the hash table depends on the system
memory and is printed at boot:
$ dmesg grep "TCP established hash table" [ 0.169348] TCP established hash table entries: 65536 (order: 8, 1048576 bytes)
thash_entries parameter.
Each element of the list of connections in the TIME-WAIT state
is a struct tcp_timewait_sock, while the type for other
states is struct tcp_sock7:
struct tcp_timewait_sock struct inet_timewait_sock tw_sk; u32 tw_rcv_nxt; u32 tw_snd_nxt; u32 tw_rcv_wnd; u32 tw_ts_offset; u32 tw_ts_recent; long tw_ts_recent_stamp; ; struct inet_timewait_sock struct sock_common __tw_common; int tw_timeout; volatile unsigned char tw_substate; unsigned char tw_rcv_wscale; __be16 tw_sport; unsigned int tw_ipv6only : 1, tw_transparent : 1, tw_pad : 6, tw_tos : 8, tw_ipv6_offset : 16; unsigned long tw_ttd; struct inet_bind_bucket *tw_tb; struct hlist_node tw_death_node; ;
TIME-WAIT state. They are
ordered by how much time left before expiration.
It uses the same memory space as for the entries in the hash table
of connections. This is the struct hlist_node tw_death_node
member of struct inet_timewait_sock.
$ dmesg grep "TCP bind hash table" [ 0.169962] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
struct inet_bind_socket. There is
one element for each locally bound port. A TIME-WAIT connection
to a web server is locally bound to the port 80 and shares the
same entry as its sibling TIME-WAIT connections. On the other
hand, a connection to a remote service is locally bound to some
random port and does not share its entry.
struct
tcp_timewait_sock and struct inet_bind_socket. There is one struct
tcp_timewait_sock for each connection in the TIME-WAIT state,
inbound or outbound. There is one dedicated struct inet_bind_socket
for each outbound connection and none for an inbound connection.
A struct tcp_timewait_sock is only 168 bytes while a struct
inet_bind_socket is 48 bytes:
$ sudo apt-get install linux-image-$(uname -r)-dbg [...] $ gdb /usr/lib/debug/boot/vmlinux-$(uname -r) (gdb) print sizeof(struct tcp_timewait_sock) $1 = 168 (gdb) print sizeof(struct tcp_sock) $2 = 1776 (gdb) print sizeof(struct inet_bind_bucket) $3 = 48
TIME-WAIT
state, it should eat less than 10MB of memory. If you have about
40,000 outbound connections in the TIME-WAIT state, you need to
account for 2.5MB of additional memory. Let s check that by looking
at the output of slabtop. Here is the result on a server with about
50,000 connections in the TIME-WAIT state, 45,000 of which are
outbound connections:
$ sudo slabtop -o grep -E '(^ OBJS tw_sock_TCP tcp_bind_bucket)' OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME 50955 49725 97% 0.25K 3397 15 13588K tw_sock_TCP 44840 36556 81% 0.06K 760 59 3040K tcp_bind_bucket
TIME-WAIT
connections is really small. If your server need to handle
thousands of new connections per second, you need far more memory to
be able to efficiently push data to clients. The overhead of
TIME-WAIT connections is negligible.
inet_csk_get_port() function which uses a lock
and iterate on locally bound ports until a free port is found. A large
number of entries in this hash table is usually not a problem if you
have a lot of outbound connections in the TIME-WAIT state (like
ephemeral connections to a memcached server): the connections
usually share the same profile, the function will quickly find a free
port as it iterates on them sequentially.
TIME-WAIT
connections after reading the previous section, there are three
additional solutions to solve them:
net.ipv4.tcp_tw_reuse, andnet.ipv4.tcp_tw_recycle.close() is called, any remaining data in the kernel buffers
will be sent in the background and the socket will eventually
transition to the TIME-WAIT state. The application can continue to
work immediatly and assume that all data will eventually be safely delivered.
However, an application can choose to disable this behaviour, known as
socket lingering. There are two flavors:
TIME-WAIT state in this case.
close() until either all the data is sent and acknowledged by
the peer or the configured linger timer expires. It is possible
for a process to not sleep by setting the socket as
non-blocking. In this case, the same process happens in the
background. It permits the remaining data to be sent during a
configured timeout but if the data is succesfully sent, the normal
close sequence is run and you get a TIME-WAIT state. And on the
other case, you ll get the connection close with a RST and the
remaining data is discarded.
net.ipv4.tcp_tw_reuse
The TIME-WAIT state prevents delayed segments to be accepted in an
unrelated connection. However, on certain conditions, it is possible
to assume a new connection s segment cannot be misinterpreted with an
old connection s segment.
RFC 1323 presents a set of TCP extensions to improve performance
over high-bandwidth paths. Among other things, it defines a new TCP
option carrying two four-byte timestamp fields. The first one is
the current value of the timestamp clock of the TCP sending the option
while the second one is the most recent timestamp received from the
remote host.
By enabling net.ipv4.tcp_tw_reuse, Linux will reuse an existing
connection in the TIME-WAIT state for a new outgoing connection
if the new timestamp is strictly bigger than the most recent timestamp
recorded for the previous connection: an outgoing connection in the
TIME-WAIT state can be reused after just one second.
How is it safe? The first purpose of the TIME-WAIT state was to
avoid duplicate segments to be accepted in an unrelated
connection. Thanks to the use of timestamps, such a duplicate segments
will come with an outdated timestamp and therefore be discarded.
The second purpose was to ensure the remote end is not in the
LAST-ACK state because of the lost of the last ACK. The remote end
will retransmit the FIN segment until:
TIME-WAIT state and the expected ACK
segments will be sent.
Once a new connection replaces the TIME-WAIT entry, the SYN
segment of the new connection is ignored (thanks to the timestamps)
and won t be answered by a RST but only by a retransmission of the
FIN segment. The FIN segment will then be answered with a RST
(because the local connection is in the SYN-SENT state) which will
allow the transition out of the LAST-ACK state. The initial SYN
segment will eventually be resent (after one second) because there was
no answer and the connection will be established without apparent
error, except a slight delay:
It should be noted that when a connection is reused, the TWRecycled
counter is increased (despite its name).
net.ipv4.tcp_tw_recycle
This mechanism also relies on the timestamp option but affects both
incoming and outgoing connections which is handy when the server
usually closes the connection first8.
The TIME-WAIT state is scheduled to expire sooner: it will be
removed after the retransmission timeout (RTO) interval which is
computed from the RTT and its variance. You can spot the appropriate
values for a living connection with the ss command:
$ ss --info sport = :2112 dport = :4057 State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 1831936 10.47.0.113:2112 10.65.1.42:4057 cubic wscale:7,7 rto:564 rtt:352.5/4 ato:40 cwnd:386 ssthresh:200 send 4.5Mbps rcv_space:5792
TIME-WAIT state was providing, while
reducing the expiration timer, when a connection enters the
TIME-WAIT state, the latest timestamp is remembered in a dedicated
structure containing various metrics for previous known
destinations. Then, Linux will drop any segment from the remote host
whose timestamp is not strictly bigger than the latest recorded
timestamp, unless the TIME-WAIT state would have expired:
if (tmp_opt.saw_tstamp && tcp_death_row.sysctl_tw_recycle && (dst = inet_csk_route_req(sk, &fl4, req, want_cookie)) != NULL && fl4.daddr == saddr && (peer = rt_get_peer((struct rtable *)dst, fl4.daddr)) != NULL) inet_peer_refcheck(peer); if ((u32)get_seconds() - peer->tcp_ts_stamp < TCP_PAWS_MSL && (s32)(peer->tcp_ts - req->ts_recent) > TCP_PAWS_WINDOW) NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSPASSIVEREJECTED); goto drop_and_release;
LAST-ACK state is handled in the exact same way as for
net.ipv4.tcp_tw_recycle.
TIME-WAIT
entries.
On the server side, do not enable net.ipv4.tcp_tw_recycle unless
you are pretty sure you will never have NAT devices in the
mix. Enabling net.ipv4.tcp_tw_reuse is useless for incoming connections.
On the client side, enabling net.ipv4.tcp_tw_reuse is another
almost-safe solution. Enabling net.ipv4.tcp_tw_recycle in addition
to net.ipv4.tcp_tw_reuse is mostly useless.
And a final quote by W. Richard Stevens, in Unix Network Programming:
The TIME_WAIT state is our friend and is there to help us (i.e.,
to let old duplicate segments expire in the network). Instead of
trying to avoid the state, we should understand it.
net.netfilter.nf_conntrack_tcp_timeout_time_wait
won t change anything on how the TCP stack will handle the TIME-WAIT state.
TIME-WAIT state. This
behaviour is controlled by net.ipv4.rfc1337 which is not
enabled by default on Linux because this is not a complete
solution to the problem described in the RFC.
LAST-ACK state, a connection will
retransmit the last FIN segment until it gets the
expected ACK segment. Therfore, it is unlikely we stay
long in this state.
TIME-WAIT is here since Linux 2.6.14.
The struct sock_common structure is a
bit more verbose and I won t copy it here.
TIME-WAIT state while the client will consider
the corresponding quadruplet free and hence may reuse
it for a new connection.
Piston, an Openstack-in-a-box vendor[1] are a sponsor of the Red Hat[2] Summit this year. Last week they briefly ceased to be for no publicly stated reason, although it's been sugggested that this was in response to Piston winning a contract that Red Hat was also bidding on. This situation didn't last for long - Red Hat's CTO tweeted that this was an error and that Red Hat would pay Piston's sponsorship fee for them.
We changed the default PGP signatures generated by enigmail in debian from Inline PGP to PGP/MIME last year, and the experiment has gone well enough that we're now using it in jessie and wheezy (where it arrived as part of a security update to make the extension work with the security-updated icedove package). After having several people poke me in different contexts about why inline cleartext PGP signatures are a bad idea, i got sufficiently tired of repeating myself, and finally documented some of the problems explicitly. The report includes a demonstration of a content-tampering attack that changes the meaning of a signed inline-PGP message without breaking the signature, which i first worked out on the notmuch mailing list, but hadn't gotten around to demonstrating until recently. The attack is demonstrated against clearsigned messages, but also works against inline encrypted messages (but is harder to demonstrate since a demonstration would require sharing secret key material for the decryption step). Please don't generate Inline-PGP messages. And if you must parse and accept them, please consider carefully the risks you expose your users to and think about ways to mitigate the problems.Tags: charset, inline-pgp, openpgp, security
I'm not an avid Kickstarter follower (if I were, I'd have gone broke
long ago). I tend to wind up backing campaigns that come to my attention via
other means (in other words, they're in the process of going viral). That said,
I've backed plenty of campaigns over the years, and so I'd like to think I have
a little bit of familiarity with how they usually operate.
When Ozobot came to my attention, I found it unusual, because they were
pre-promoting their Kickstarter campaign before it opened. To me, this looked
like a case of them trying to build hype prior to the campaign opening, which
was a new one to me. The whole thing seemed incredibly slick, and I was
surprised they were "only" seeking $100K.
The product looked like it'd be something cool for Zoe to play with, so I
decided to back it anyway. Then all the updates started flowing in about how
well it was being received at various trade shows and whatnot. Yet the amount
of dollars flowing into the Kickstarter campaign didn't seem to be reflecting
the external hype. I was watching the campaign's dashboard with great interest,
because as time marched on, it was looking more and more likely that it wasn't
going to make its funding target. This seemed highly unusual to me, given the
slickness of the product and purported external interest in it.
And then they pulled the plug on the campaign. Purportedly because they were
pursuing equity funding instead. They admitted they'd also read the writing on
the wall and it was unlikely they were going to make their funding target. I
haven't followed other campaigns to see how much of a last minute funding "pop"
they have. Usually I've found they've closed at many multiples of their
original target, and hit their target well in advance of their deadline, when
they're ridiculously popular. My interpretation of Ozobot's campaign, from a
funding perspective, is that Kickstarters gave it a big fat "MEH", which
surprised me somewhat.
Then the question comes up: was the Kickstarter campaign a ruse all along? Was
it just a new way of pitching for venture capital? The videos seemed pretty
slick. The product seemed already complete, and $100K didn't seem like enough
to take it to manufacturing.
It'll be interesting to see what becomes of Ozobot now.
This just wrinkled my brain. Be nice to programmers:
In order to be a good programmer I need to adopt a certain mindset. That mindset is slowly making me unhappy.
Programming builds an acutely negative mindset over time. I m always asking the question what s wrong with this? Positive people are always focusing on what s good about this?Go ahead and read the full transcript, you might recognize yourself. There are some other ideas in the original article that linked me to this transcript.
A new maintenance release of the RcppBDT package is now on CRAN. There is no
new code in this; it mainly accomodates a request by CRAN to standardize the
\code Imports: and \code Depends: relationships in the \code DESCRIPTION
file. We also updated the build process now that we can use Rcpp 0.11.0.
Having said that, there is a lot of new code in the
git repository but I
guess I'll talk about that when I can make a new upload. Yesterday, this
balked because win-builder
felt the need for a long long int in 64-bit mode which we can
provide once C++11 will be permitted under R 3.1.0, due out in April. Oddly,
no such need arose in 64-bit Linux. Oh well.
The complete NEWS entry is below:
Changes in version 0.2.2 (2014-02-21)Courtesy of CRANberries, there is also a diffstat report for 0.2.2 relative to 0.2.1. As always, feedback is welcome and the rcpp-devel mailing list off the R-Forge page for Rcpp is the best place to start a discussion.
- Updates to current CRAN Policy standards for
Depends:andImports:in DESCRIPTION- Also take advantage of new Rcpp 0.11.0 build options
- New code remains in GitHub repo master branch until R 3.1.0 is release so that we can use C++11 in order to get the
long long intsupport without which the package does not build on Windows (whereas Linux is fine)
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A pure maintenance release of
RDieHarder
is now on CRAN. RDieHarder provides R bindings for the DieHarder battery of
tests for random number generators by Brown et al.
This release contains no new code, but the vignette needed to be moved from
inst/doc to vignettes/ to help finalize that
transition of the R / CRAN Package Policy.
Courtesy of
CRANberries, there
is also a diffstat report
relative to the previous release.
As always, more detailed information is on the RDieHarder page.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
So finally I did it, I managed to ride the 2-wheeler in Bangalore
roads!. Officially I've got a license to drive 2 and 4 wheelers back
in 2011 but I was never confident enough to ride the vehicle on road
and in traffic. Partially this is because I don't own a vehicle and
I've never practiced driving, and partially because of road and
traffic conditions in India I was bit afraid to do so.
So today morning my roommate and me planned to go to temple in the
early morning. We got up at 530 in the morning and we were ready to
drive to Mahalaxmi Layout at 615. Since during this time traffic is
very less I asked my roommate shall I drive and he agreed!.
So I drove the bike from Malleshwaram to Mahalaxmi Layout and it was fun. I
did had hick up in uphill driving as my mind was not co-ordinating
well with breaks and gear. I did have hickups in first gear too but I
guess this will be alright once I get hold of things.
I'm still not having enough confidence to drive during the peak hours
because people are not at all following traffic rules. They just
change the lane without any hints or just come to middle of road from
side roads without looking at other side to see if there is a vehicle
is coming from other side of the road (yes they don't have courtesy to
wait). And finally they can shout at persons who is actually following
rules. In general very less people have traffic discipline in
India. But I will adapt to this once I start driving so I'm now all
set to get my 2 wheeler soon and ride on!
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu $DISTRIBUTION main
A new minor release of RcppArmadillo
is now on CRAN and in Debian.
RcppArmadillo
brings the Armadillo templated C++
library for linear algebra to R by means of Rcpp.
This release contains both a few minor bugfixes from the 4.000 branch of
Armadillo and some enhancements in
RcppArmadillo itself
that are related to the
recent Rcpp 0.11.0 release.
Changes in RcppArmadillo version 0.4.000.4 (2014-02-19)Courtesy of CRANberries, there is also a diffstat report for the most recent release As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.
- Upgraded to Armadillo release Version 4.000.4
- fix for
randi()generating out-of-interval values- fix for saving field objects
- workaround for a bug in the Intel compiler
- Updated for Rcpp (>= 0.11.0) by removing linking step from build process, added appropriate dependency on Rcpp
- Updated
RcppArmadillo.package.skeletonfunction accordingly to use properNAMESPACEimport- Rewritten
rcpparma_hello_world(which is used by theRcppArmadillo.package.skeletonfunction) to use Rcpp Attributes, and added more examples- Added two functions to set Armadillo's RNGs (ie the system RNG) from a given value and to randomize it, as suggested by G bor Cs rdi. Note that these do not work within RStudio (which itself also uses the same system RNG).
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
/etc/ssh/sshd_config should contain:
Protocol 2
PasswordAuthentication no
PermitRootLogin no
addgroup sshuser
and then add the relevant users to it:
adduser francois sshuser
Finally, add this to /etc/ssh/sshd_config:
AllowGroups sshuser
/var/log/auth.log) and
temporarily blocks IP addresses after a number of failed login attempts.
Another approach is to hide the ssh service using
Single-Packet Authentication. I
have fwknop installed on some of my
servers and use small
wrapper
scripts
to connect to them.
scp or rsync), it's a good idea to set their shell
(via chsh) to a restricted one like
rssh.
Should they attempt to log into the server, these users will be greeted with
the following error message:
This account is restricted by rssh.
Allowed commands: rsync
If you believe this is in error, please contact your system administrator.
Connection to server.example.com closed.
~/.ssh/authorized_keys file also allows (as the
man page
points out) a user to impose a number of restrictions.
Perhaps the most useful option is from which allows a user to restrict the
IP addresses which can login using a specific key.
Here's what one of my authorized_keys looks like:
from="192.0.2.2" ssh-rsa AAAAB3Nz...zvCn bot@example
You may also want to include the following options to each entry:
no-X11-forwarding, no-user-rc, no-pty, no-agent-forwarding and
no-port-forwarding.
/etc/ssh/sshd_config:
LogLevel VERBOSE
which will, amongst other things, log the fingerprints of keys used to login:
sshd: Connection from 192.0.2.2 port 39671
sshd: Found matching RSA key: de:ad:be:ef:ca:fe
sshd: Postponed publickey for francois from 192.0.2.2 port 39671 ssh2 [preauth]
sshd: Accepted publickey for francois from 192.0.2.2 port 39671 ssh2
Secondly, if you run logcheck
and would like to whitelist the "Accepted publickey" messages on your
server, you'll have to start by deleting the first line of
/etc/logcheck/ignore.d.server/sshd. Then you can add an entry for all of
the usernames and IP addresses that you expect to see.
Finally, it is also possible to
log all commands issued by a specific user over ssh
by enabling the pam_tty_audit module in /etc/pam.d/sshd:
session required pam_tty_audit.so enable=francois
However this module is not included in wheezy and has only recently been re-added to Debian.
/var/log/auth.log:
sshd: Connection from 198.51.100.10 port 39492
sshd: Authentication tried for francois with correct key but not from a permitted host (host=198.51.100.10, ip=198.51.100.10).
sshd: Failed publickey for francois from 198.51.100.10 port 39492 ssh2
sshd: Connection closed by 198.51.100.10 [preauth]
So I can get the IP address of the attacker (likely to be a random VPS or a
Tor exit node), but unfortunately, the key fingerprints don't appear for
failed connections like they do for successful ones. So I don't know which key
to revoke.
Is there any way to identify which key was used in a failed login attempt or
is the solution to only ever have a single public key in each
authorized_keys file and create a separate user account for each user?
Today was a pretty good day. I've found that I quite enjoyed it. Zoe woke up a
bit early, around 5:30am. She decided that despite the ridiculous heat, she
wanted porridge for breakfast, with cherries in it, so we pitted the cherries
and threw it all into the Thermomix to
cook while she got dressed.
After breakfast and the obligatory bit of TV, we biked over to Playgroup.
Zoe's got a few toys that she's taken a liking to, and immediately sought
them out. She also seems to really enjoy just running the length of the hall
after Playgroup is all done and everything has been packed away and most of
the kids are gone. Today the craft activity was making paper crowns, and she
wanted to that immediately upon arrival. After we got home, while I was
preparing lunch, she blinged it up a bit more with some stuff from home.
She took a 2 hour nap after lunch, and I did some more work on my taxes, and
then, because it was still stupidly hot, we biked over to Colmslie pool for
a swim.
Zoe's swimming progress continues in leaps and bounds. She's had one lesson
at her new level, and she's started with a kickboard and is doing strokes,
so I borrowed a kickboard from the pool, and she did really well with it. We
also just fooled around with the kickboard a bit. I took it to the bottom of
the pool and launched it out of the water with its own buoyancy, and Zoe
tried standing on it under water like a skateboard. The sinkies were also
popular again.
We grabbed a few things for dinner from the Hawthorne Garage on the way
home, and I managed to get Zoe to bed a little bit early. I thought I was
going to have a smooth bedtime, but unfortunately, as is a common occurrence
at the moment, after lights out, she started crying for her mother. It took
about 15 minutes to get her from near-hysterical to calm and drowsy.
I'm starting to think I might need to either shorten or eliminate the
afternoon naps. One of her complaints recently has been that she's had
trouble sleeping at bedtime. That said, she still seems to get to sleep
relatively quickly once she gets into the right frame of mind.
In my article Contributing on GitHub I recently explained
that I can not use certain social features of GitHub on their website directly.
I also explained that I make great use of Hub to circumvent some
accessibility issues I have with GitHub.
Well, it turns out that adding star, unstar, follow and unfollow
to Hub was actually a lot easier then I thought.
It is long ago (probably 10 years) that I touched Ruby code the last time.
However, since I do learn a lot from examples, I was actually
able to add what I needed just by looking at surrounding code.
Well, I had to lookup how you add an element to the end of an array (push)
but that was basically it.
You can have a look at the final outcome in Hub pull request #490.
The code resides in the social branch of my hub fork.
If you already have an OAuth token for hub, you need
to login to GitHub and edit your token to add the user:follow scope if
you want to use the follow and unfollow commands. Interestingly,
this type of operation is accessible enough to still work with Lynx!
I hope this gets merged, I don't particularily like to maintain my own forks of
quite obvious functionality. Anyway, problem solved, mostly.
All I am missing now is the ability to delete a repository.
A dangerous feature, so probably controversial. Anyway, something
for another day.
In cycling, a ride's Training Stress Score is a function of that ride's duration, average power and the intensity of the ride relative to the rider's capability. This Slowtwitch article provides a good overview on how intensity and TSS is calculated on a bike.
However, having TSS values for other sports allows a multisport athelete to take into consideration the physiological cost of activities in different sports. This is achieved by ensuring, say, 50 TSS on the bike "counts" the same as a 50 TSS run.
This can be used to simply determine the length, intensity and scheduling of the athletes next workout (to ensure adequate recovery) regardless of the combination of sports, or to identify the athlete's long-term tolerance to and targets for training load using metrics such as Chronic Training Load.
To make this possible when using Strava, I wrote a Chrome extension that estimates the TSS score of a run from its Grade Adjusted Pace distribution:
The "TSS (estimated)" value is calculated by the extension.
Writing this because there seems to be no correct documentation on the
relevant google websites and it turns out to be non-trivial. Our goal
here is to unsubscribe from a ordinary google group.
Mails from the google group contain the quoted footer:
--
You received this message because you are subscribed to the Google
Groups "FOO" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to FOO+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/FOO
For more options, visit https://groups.google.com/groups/opt_out.
Seems easy enough, so let's send a Mail to this FOO+unsubscribe
address. Back comes a E-Mail:
From: FOO <FOO+unsubconfirm@googlegroups.com>
Subject: Unsubscribe request for FOO [ EJzZjpgFhDHd9seTdRA0 ]
To: Christoph Egger <christoph@example.com>
Date: Tue, 18 Feb 2014 18:55:24 +0000 (38 minutes, 53 seconds ago)
[Leave This Group]
Visit Go
[Start] your own group, [visit] the help center, or [report]
abuse.
So click on the [Leave This Group] link and be done? Unfortunately
not. Looking at the link you notice it's called
http://groups.google.com/group/FOO/subscribe -- no token and
"subscribe"? I actually want to unsubscribe! And indeed, clicking
gets an Interface that offers to "Enter the email address to
subscribe:" + Captcha. And whatever it does, it -- of course --
doesn't unsubscribe. (My guess is, it would actually work if you had a real google account associated with that email address and were logged in to that account but there's no way of verifying this as already the first condition is false in this case)
Now if you disable HTML completely for the email, a totally different
content emerges:
Hello christoph@example.com,
We have received your request to unsubscribe from FOO. In order for us to complete the request, please reply to this email or visit the following confirmation URL:
http://groups.google.com/group/FOO/subscribe
If you have questions related to this or any other Google Group, visit the Help Center at http://groups.google.com/support/.
Thanks,
Google Groups
Still the non-functional link, however it also mentions a different
solution: "please reply to this email" which was not present in the
HTML mail at all. And it works.
I really like to read code written by different people.
I've always been the type of learner that can cover a lot of ground by looking
at examples. A few of the programming tricks I acquired over time have definitely
been learnt by reading programs written by other people. There are of course
cases of disagrement with coding style (lets put that very mildly), so not every
project is fun to read. But I tend to find projects I like enough to actually
look at their source code.
Now, if you get into this habit, there is also the occasional spotting of a bug.
Many are really cosmetic, like typos in comments or documentation.
Others are maybe more serious, who knows what can happen if you read a few
lines of code written by someone you have never met in person.
This is one of the original arguments of open source and free software.
It basically goes like: "People will read your code and report problems."
I know that happens, but I also know that there are cases of people finding
relatively minor things during a small code review, which they don't
report, or which get lost in some developers INBOX.
I remember waiting months to see memory corruption fixes for a particular
project I submitted by email to actually appear in the development repository.
In some cases you really need to track your patches and prod someone to
remind them about your contribution if need be.
True, some of these issues are probably minor enough to not really
hurt if they get lost, but I have a feel that a lot of minor things also
sort of add up.
This is where GitHub comes into play. We have had project hosting services since
at least a decade now, but none of them (to my experience) have ever made it so
easy for all involved parties to submit and merge changes into projects.
Pull requests are just amazing. Well, at least for me, they are
since a few months. I have a sort of mixed hate-love relationship
with GitHub when it comes to a topic that is very important to me,
Accessibility.
The last project hosting site I really liked for their simple web interface
(read, still usable with Lynx) was Google Code. That was in the days when
Google still seemed to care about such things. These days, their newer services
are next to unusable to me (with the tools I prefer). SourceForge
was always a catastrophy. Many things were cumbersome to do, because
the site is so loaded with links to all sorts of things I never need.
However, at the time I was using it, all the things I really needed did work.
GitHub is a different beast, in a different era of the internet.
While I can read project pages and a few basic things perfectly fine,
some parts of the GitHub site are simply unusable for no particular reason.
For instance, I can edit (some of my) preferences and even save them.
But I can not star a project, nor can I follow other developers.
Invoking these links gives me a 404, which seems to indicate that
some JavaScript (read, client side code execution) is required which my
browser does not perform. However, I really wonder why. Because something like
"I want to star this project" will eventually have to end up as a
request on the server anyway, so it seems technically unnecessary to
rely on Javascript for such an operation to succeed.
Luckily, these days, hip projects do have an API. An GitHub is no exception.
I want to emphasis that an API alone is not an accessibility fix,
since you rarely have the time to implement a clinet for a random API, just to
get access to a service you want to use. Sometimes you do, and
an API is a great enabler in such situations, but a reference client
with a rich feature-set is much better. I have to admit that I haven't
evaluated any of the possible alternatives, but one client
I found for GitHub's API did really boost my productivity in the last year.
I am talking about Hub. It is a simple wrapper around Git that adds
a few and enhances some other git commands.
Most importantly, hub fork will fork the current checkout on GitHub,
and hub pull-request allows you to quickly (and I really mean quickly!)
open a pull request for some commits you've just done to your fork of some project.
This is very helpful, and very accessible. While it does not
solve all my accessibility problems with GitHub, it at least
enables me to take part in the GitHub workflow. I can easily
fork projects and submit pull reuqests for changes I did.
And that is what I did, at least a bit, in roughly the past year.
I am not sure exactly, but I think it was spring when someone made me
aware of Hub. One approach would be to check my GitHub
activity graph, but I probably don't have to mention that it is not
accessible.
Here is a list of some of my contributions to open source projects
on GitHub since I discovered a good client for the GitHub API:
I really like to read code written by different people.
I've always been the type of learner that can cover a lot of ground by looking
at examples. A few of the programming tricks I acquired over time have definitely
been learnt by reading programs written by other people. There are of course
cases of disagrement with coding style (lets put that very mildly), so not every
project is fun to read. But I tend to find projects I like enough to actually
look at their source code.
Now, if you get into this habit, there is also the occasional spotting of a bug.
Many are really cosmetic, like typos in comments or documentation.
Others are maybe more serious, who knows what can happen if you read a few
lines of code written by someone you have never met in person.
This is one of the original arguments of open source and free software.
It basically goes like: "People will read your code and report problems."
I know that happens, but I also know that there are cases of people finding
relatively minor things during a small code review, which they don't
report, or which get lost in some developers INBOX.
I remember waiting months to see memory corruption fixes for a particular
project I submitted by email to actually appear in the development repository.
In some cases you really need to track your patches and prod someone to
remind them about your contribution if need be.
True, some of these issues are probably minor enough to not really
hurt if they get lost, but I have a feel that a lot of minor things also
sort of add up.
This is where GitHub comes into play. We have had project hosting services since
at least a decade now, but none of them (to my experience) have ever made it so
easy for all involved parties to submit and merge changes into projects.
Pull requests are just amazing. Well, at least for me, they are
since a few months. I have a sort of mixed hate-love relationship
with GitHub when it comes to a topic that is very important to me,
Accessibility.
The last project hosting site I really liked for their simple web interface
(read, still usable with Lynx) was Google Code. That was in the days when
Google still seemed to care about such things. These days, their newer services
are next to unusable to me (with the tools I prefer). SourceForge
was always a catastrophy. Many things were cumbersome to do, because
the site is so loaded with links to all sorts of things I never need.
However, at the time I was using it, all the things I really needed did work.
GitHub is a different beast, in a different era of the internet.
While I can read project pages and a few basic things perfectly fine,
some parts of the GitHub site are simply unusable for no particular reason.
For instance, I can edit (some of my) preferences and even save them.
But I can not star a project, nor can I follow other developers.
Invoking these links gives me a 404, which seems to indicate that
some JavaScript (read, client side code execution) is required which my
browser does not perform. However, I really wonder why. Because something like
"I want to star this project" will eventually have to end up as a
request on the server anyway, so it seems technically unnecessary to
rely on Javascript for such an operation to succeed.
Luckily, these days, hip projects do have an API. An GitHub is no exception.
I want to emphasis that an API alone is not an accessibility fix,
since you rarely have the time to implement a clinet for a random API, just to
get access to a service you want to use. Sometimes you do, and
an API is a great enabler in such situations, but a reference client
with a rich feature-set is much better. I have to admit that I haven't
evaluated any of the possible alternatives, but one client
I found for GitHub's API did really boost my productivity in the last year.
I am talking about Hub. It is a simple wrapper around Git that adds
a few and enhances some other git commands.
Most importantly, hub fork will fork the current checkout on GitHub,
and hub pull-request allows you to quickly (and I really mean quickly!)
open a pull request for some commits you've just done to your fork of some project.
This is very helpful, and very accessible. While it does not
solve all my accessibility problems with GitHub, it at least
enables me to take part in the GitHub workflow. I can easily
fork projects and submit pull reuqests for changes I did.
And that is what I did, at least a bit, in roughly the past year.
I am not sure exactly, but I think it was spring when someone made me
aware of Hub. One approach would be to check my GitHub
activity graph, but I probably don't have to mention that it is not
accessible.
Here is a list of some of my contributions to open source projects
on GitHub since I discovered a good client for the GitHub API:
Next.