Turn this cute YouTube cat video into a briefer-but-still-cute GIF:
- youtube-dl is a command-line tool for quickly downloading video files from a given YouTube URL
//Now with less jquery | |
//1) go to your my-list page, and scroll to the bottom to make sure it's all loaded: | |
//http://www.netflix.com/browse/my-list | |
//2) Next, paste this in your developer tools console and hit enter: | |
[...document.querySelectorAll('.slider [aria-label]')].map(ele => ele.getAttribute('aria-label')) | |
//or use this to copy the list to your clipboard: | |
copy([...document.querySelectorAll('.slider [aria-label]')].map(ele => ele.getAttribute('aria-label'))) |
## Configure bro to write JSON logs | |
mkdir -p /opt/bro/share/bro/site/scripts | |
sudo tee /opt/bro/share/bro/site/scripts/json-logs.bro << EOF | |
@load tuning/json-logs | |
redef LogAscii::json_timestamps = JSON::TS_ISO8601; | |
redef LogAscii::use_json = T; | |
EOF | |
sudo tee -a /opt/bro/share/bro/site/local.bro << EOF |
Turn this cute YouTube cat video into a briefer-but-still-cute GIF:
// based on http://stackoverflow.com/questions/15770879/unix-timestamp-to-ldap-timestamp | |
<?php | |
date_default_timezone_set('America/New_York'); | |
// Microsoft TIMESTAMP epoch is Jan 1, 1601 http://www.selfadsi.org/deep-inside/microsoft-integer8-attributes.htm | |
// More Info: | |
// http://blogs.technet.com/b/askds/archive/2009/04/15/the-lastlogontimestamp-attribute-what-it-was-designed-for-and-how-it-works.aspx | |
function ldapTimeToUnixTime($ldapTime) { | |
$secsAfterADEpoch = $ldapTime / 10000000; | |
$ADToUnixConverter = ((1970 - 1601) * 365 - 3 + round((1970 - 1601) / 4)) * 86400; |
#!/bin/bash | |
# stdin should be integers, one per line. | |
percentile=$1 | |
tmp="$(tempfile)" | |
total=$(sort -n | tee "$tmp" | wc -l) | |
# (n + 99) / 100 with integers is effectively ceil(n/100) with floats | |
count=$(((total * percentile + 99) / 100)) | |
head -n $count "$tmp" | tail -n 1 | |
rm "$tmp" |
If you're doing stuff with Ruby on a Mac, e.g. installling Jekyll or something, by default you'll end up having to use the sudo
command to do stuff, since the permission to modify the default config is not available to your user account.
This sucks and should be avoided. Here's how to fix that.
To make this better, we are going install a new, custom Ruby. This used to be a big, scary thing, but thanks to the awesome tools Homebrew and rbenv, it's a snap.*
A word of warning: you will have to use Terminal to install this stuff. If you are uncomfortable with text, words, and doing stuff with your computer beyond pointing and hoping, this may not work well for you. But if that's the case, I'm not sure why you were trying to use Ruby in the first place.
Hut3 Cardiac Arrest - A script to check OpenSSL servers for the Heartbleed bug (CVE-2014-0160).
Note: This code was originally a GitHub Gist but has been copied to a full GitHub Repository so issues can also be tracked. Both will be kept updated with the latest code revisions.
DISCLAIMER: There have been unconfirmed reports that this script can render HP iLO unresponsive. This script complies with the TLS specification, so responsitivity issues are likely the result of a bad implementation of TLS on the server side. CNS Hut3 and Adrian Hayter do not accept responsibility if this script crashes a server you test it against. USE IT AT YOUR OWN RISK. As always, the correct way to test for the vulnerability is to check the version of OpenSSL installed on the server in question. OpenSSL 1.0.1 through 1.0.1f are vulnerable.
This script has several advantages over similar scripts that have been re
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.
I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |