Libcurl requires openssl and zlib to be fully operationnal
- Step 1 : cross compile zlib
- Step 2 : cross compile openssl
- Step 3 : cross compile curl with zlib/openssl external link
Prerequisites :
# Here a few bash one-liners that helped me analyze / fight a weak DOS attack against debuggable.com. Mostly for future reference. | |
# The attacker was opening lots of tcp connections without sending data, I believe it's called a SYN flood, see: http://tools.ietf.org/html/rfc4987#section-3.2 | |
# Step 0: Check what is going on at port 80 | |
$ netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c | |
# Step 1: Increase the number of available fds | |
$ ulimit -n 32000 | |
# Step 2: Restart your webserver, for me: |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
#!/bin/sh | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
423-279-3200 | |
440-564-7014 | |
845-677-7300 | |
904-266-4468 | |
315-393-1555 | |
918-423-5858 | |
440-293-4555 | |
701-577-1212 | |
765-584-6891 | |
863-291-5200 |
import 'package:flutter/material.dart'; | |
class NewRecording extends StatefulWidget { | |
@override | |
_NewRecordingState createState() => _NewRecordingState(); | |
} | |
class _NewRecordingState extends State<NewRecording> { | |
@override | |
void initState() { |
// Add this to your Scaffold in dashboard.dart | |
floatinActionButton: FloatingActionButton( | |
onPressed: () { | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => NewRecording()), | |
); | |
}, | |
child: Icon(Icons.add), |