I hereby claim:
- I am angelix on github.
- I am angelix (https://keybase.io/angelix) on keybase.
- I have a public key ASBxcfQUJEuK6yV9LlsMWSHzoTt_dyy-IKr5IsYxxSN0HQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| app.factory('csrfRequestInterceptor' , function($q , $injector){ | |
| var _token = false; | |
| return { | |
| request : function(config){ | |
| var CSRF_URL = '/csrfToken'; | |
| if(config.url == CSRF_URL || config.method == "GET"){ | |
| return config; | |
| } | |
| // sailsjs hasn't time limit for csrf token, so it is safe to cache this | |
| // remove this to request a new token |
| public class ManagedDataHelper { | |
| static ManagedDataHelper sSelf = null; | |
| static final String SHARED_PREFERENCES_FILENAME = "managed_data"; | |
| Context mContext; | |
| Resources mResources; | |
| SharedPreferences mSharedPreferences; | |
| private ManagedDataHelper(Context context) { | |
| mContext = context; | |
| mResources = mContext.getResources(); |
| # 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: |