Skip to content

Instantly share code, notes, and snippets.


Tzury Bar Yochay tzuryby

View GitHub Profile
tzuryby / defaultdict.lua
Created Jun 6, 2020
lua implementaiton of python's default dict
View defaultdict.lua
function defaultdict(callable)
local T = {}
setmetatable(T, {
__index = function(T, key)
local val = rawget(T, key)
if not val then
rawset(T, key, callable())
return rawget(T, key)
while true; do
ipv4=$(dd if=/dev/urandom bs=4 count=1 2>/dev/null | od -An -tu1 | sed -e 's/^ *//' | sed 's/ */./g')
echo $ipv4
tzuryby /
Created Aug 30, 2018 — forked from denji/
Take a list of CIDR address blocks and combine them, for example, and gives I usually use "list-iana-reserved-ranges | aggregate-cidr-addresses" to get a list of blocks to not report with firewall log processing.
# aggregate-cidr-addresses - combine a list of CIDR address blocks
# Copyright (C) 2001,2007 Mark Suter <>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
tzuryby / 0 -
Created Dec 4, 2016 — forked from JamesMGreene/0 -
A brief example of the latest idea for communicating with PhantomJS from the client-side.
View 0 -

A brief example of the latest idea for communicating with PhantomJS from the client-side.

This is the next revision of ideas discussed in a previous Gist:

This example demonstrates shimming in the new communication channels under discussion via existing methods (WebPage#onCallback and window.callPhantom).

The example does, however, take advantage of a yet-to-be-implemented EventEmitter API for core modules in the PhantomJS outer context. This API would add the following methods to core modules as appropriate:

  • on / addEventListener
tzuryby / resume.c
Last active Aug 29, 2015 — forked from klange/
View resume.c
#include <stdio.h>
#include <time.h>
/* TODO: resume.h */
typedef struct {
char * company;
char * location;
char * title;
tzuryby /
Last active Aug 29, 2015
# -*- coding: utf-8 -*-
#config for haaretz premium checks
#host to check
# host = '';
host = '';
View gist:d5a025d201e989aff741
mbp:~ tzury$ curl -v > /dev/null
* Adding handle: conn: 0x7fbf0b80b600
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fbf0b80b600) send_pipe: 1, recv_pipe: 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to port 80 (#0)
* Trying
View gist:0005e8df24f569fb09ef
<html xmlns="" dir="rtl">
<head id="ctl00_Head1">
<base href="" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /><meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=yes,minimum-scale=1,maximum-scale=1" /><meta name="author" content="Prima Hotel" /><meta name="rating" content="general" /><meta name="generator" content="Prima Hotels" /><meta name="audience" content="all" /><meta name="category" content="hotel" /><meta name="copyright" content="Hotels E-Commerce - SilverTravel Ltd." /><meta name="distribution" content="Global" /><meta name="page-topic" content="hotel" /><meta name="resource-type" content="document" /><link rel="shortcut icon" href="favicon1.ico" type="image/x-icon" />
<script src="Scripts/BookingEngine/SecureCommon.js" type="text/javascript"></script>
<script src="Scripts/BookingEngine/EngineDatePicker.js" type="text/javascript"></sc
View 2048.c
M[16],X=16,W,k;main(){T(system("stty cbreak")
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2

Basecamp was under network attack

The attack detailed below has stopped (for the time being) and almost all network access for almost all customers have been restored. We're keeping this post and the timeline intact for posterity. Unless the attack resumes, we'll post a complete postmortem within 48 hours (so before Wednesday, March 26 at 11:00am central time).

Criminals have laid siege to our networks using what's called a distributed denial-of-service attack (DDoS) starting at 8:46 central time, March 24 2014. The goal is to make Basecamp, and the rest of our services, unavailable by flooding the network with bogus requests, so nothing legitimate can come through. This attack was launched together with a blackmail attempt that sought to have us pay to avoid this assault.

Note that this attack targets the network link between our servers and the internet. All the data is safe and sound, but nobody is able to get to it as long as the attack is being successfully executed. This is like a bunch of people