Skip to content

Instantly share code, notes, and snippets.

@ailabs-software
ailabs-software / gist:2338679
Created April 8, 2012 17:38
wget going straight IPv6
root@yesmav:~/pmgr# wget http://ftp.us.debian.org/debian/
--2012-04-08 13:36:03-- http://ftp.us.debian.org/debian/
Resolving ftp.us.debian.org... 2610:148:1f10:3::89, 2001:500:61:28::70
Connecting to ftp.us.debian.org|2610:148:1f10:3::89|:80... failed: Network is unreachable.
Connecting to ftp.us.debian.org|2001:500:61:28::70|:80... failed: Network is unreachable.
root@yesmav:~/pmgr# dig A ftp.us.debian.org
; <<>> DiG 9.7.3 <<>> A ftp.us.debian.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 14715
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;ftp.us.debian.org. IN A
root@yesmav:~/pmgr# host ftp.us.debian.org
ftp.us.debian.org.com has address 23.21.224.150
root@chatmavis:~/packagemgr# dig A ftp.us.debian.org
; <<>> DiG 9.7.3 <<>> A ftp.us.debian.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 14715
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
root@yesmav:~/pmgr# host ftp.us.debian.org
ftp.us.debian.org.com has address 23.21.224.150
root@yesmav:~/pmgr# dig A ftp.us.debian.org
; <<>> DiG 9.7.3 <<>> A ftp.us.debian.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 14715
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
server
{
server_name *.theamericanpolitician.com;
listen 80;
location ^~ /socket.io
{
proxy_pass http://unix:/tmp/$SERVER_NAME.socket:;
proxy_set_header X-Real-IP $remote_addr;
}
@ailabs-software
ailabs-software / gist:2847283
Created May 31, 2012 23:49
Is this good code?
if ($(_parent).hasClass('item'))
{
$(_parent)[selected && $(this).closest('table').find('.item:not(.selected)').length == 0 ? 'addClass' : 'removeClass']('selected');
var _grandparent = $(_parent).parent().parent().parent().parent().parent().siblings();
if ($(_grandparent).hasClass('item')) $(_grandparent)[selected && $(_parent).closest('table').find('.item:not(.selected)').length == 0 ? 'addClass' : 'removeClass']('selected');
}
@ailabs-software
ailabs-software / gist:3136976
Created July 18, 2012 15:36
Is this ECMAScript okay?
var __objectInheritanceCalculated = [];
while((function()
{
/* There is a object class that has not been processed */
var __t = 0;
for (var m in objectclasses) { __t++; }
if (__t <= __objectInheritanceCalculated.length) return false;
return true;
})())
{
@ailabs-software
ailabs-software / gist:4192377
Created December 3, 2012 03:07
Is this good JavaScript code?
(function () {
var __vm = new __vmExecutionContextCtor();
function madonna() {
var __vm = new __vmExecutionContextCtor();
__vm.yield(JSON.stringify('YES YES THIS IS WORKING!!!!'), function (__val13) {
var lookAtMe = __val13;
__vm.returnValue({
idol: 'Madonna Mommy. ' + lookAtMe
});
@ailabs-software
ailabs-software / Why can't I use Python conditionals to select the function to invoke to return the value to .append()?
Created January 12, 2013 16:42
Why can't I use Python conditionals to select the function to invoke to return the value to .append()?
def writeConfigString(endpointsTuple):
for endpoint in endpointsTuple:
generatedLines.append( (if ENDPOINT_TYPE['STATIC'] == endpoint['type'] generateStaticEndpoint else if ENDPOINT_TYPE['SERVICE'] == endpoint['type'] else None)(endpoint['uri'], endpoint['destination']) )
presidentuncletom=# SELECT name, ARRAY(SELECT (title, id) FROM groups_map RIGHT OUTER JOIN
groups ON (groups_map.group_id = groups.id) WHERE groups_map.item_id=person.id)
AS groups FROM person;
name | groups
-----------------+----------------------------------------------------
Harley Earl | {}
Henry Ford | {"(\"industry mogul\",1)","(\"capital mogul\",2)"}
Rick Wagoner | {}
Alfred P. Sloan | {"(\"industry mogul\",1)","(\"capital mogul\",2)"}
Bob Eaton | {}