Skip to content

Instantly share code, notes, and snippets.

View jdorfman's full-sized avatar

Justin Dorfman jdorfman

View GitHub Profile
@jdorfman
jdorfman / gist:9896843
Created March 31, 2014 16:57
bootstrapcdn-cloc
~/github/bootstrap$ cloc bootstrap-cdn/
3369 text files.
2254 unique files.
2476 files ignored.
http://cloc.sourceforge.net v 1.60 T=24.97 s (66.2 files/s, 19531.6 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
Javascript 1218 42456 44388 204958
$ curl -I https://localbitcoins.com
HTTP/1.1 200 OK
Server: cloudflare-nginx
Date: Mon, 02 Jun 2014 17:48:23 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Set-Cookie: __cfduid=d32b93728338081c546f4d5970553c6e11401731283939; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.localbitcoins.com; HttpOnly
X-Content-Type-Options: nosniff
Content-Language: en

                      |H|a|p|p|y| |4|t|h| |B|i|r|t|h|d|a|y|
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                    |B|o|o|t|s|t|r|a|p|!|  <3   |M|a|x|C|D|N|


    https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha/css/bootstrap.min.css
    https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha/js/bootstrap.min.js

Keybase proof

I hereby claim:

  • I am jdorfman on github.
  • I am jdorfman (https://keybase.io/jdorfman) on keybase.
  • I have a public key whose fingerprint is B201 D628 F130 2A5E 3815 B7CE BB28 B310 B9F9 0A33

To claim this, I am signing this object:

# transparency - true or false (default)
URxvt*transparent:true
# tint with any color; i.e., blue, red, tomato4, olivedrab2, etc.
# some nice listings are at:
# http://www.nisrv.com/modules.php?name=Hex_Colors
# http://www.htmlgoodies.com/tutorials/colors/article.php/3478921
URxvt*tintColor:blue
# shading - 0 to 99 darkens, 101 to 200 lightens.
@jdorfman
jdorfman / forloop-inet_ntoa
Created February 18, 2012 02:01
just in case you need to convert many IPs from numbers to addresses
for i in `cat ip-addresses`; do echo "SELECT INET_NTOA(${i});" |mysql -uanonymous |awk "NR==2" >> /tmp/ntoa; done
@jdorfman
jdorfman / gist:1886408
Created February 22, 2012 18:09
Convert an IP Address to a Number using a Bash function
# insert in .bashrc or .bash_profile & run source ~/.bashrc
function aton {
echo "SELECT INET_ATON('$1');" |mysql -uanonymous > /tmp/aton
awk "NR==2" /tmp/aton
}
# if the request starts with our frontcontroller, pass it on to fastcgi
location ~ ^/index.php
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /var/www/default/pub$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}
<?php
require_once("OAuth.php");
require_once("OAuthServer.php");
//$domain = $_SERVER['HTTP_HOST'];
$base = "/netdna_api";
//$base_url = "http://$domain$base";
# Echo a Range
echo 192.168.0.{2..102} > file.txt
# Replace spaces with newlines
tr ' ' '\n' < file.txt
# Remove a line (386) from a file