Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tzuryby's full-sized avatar

Tzury Bar Yochay tzuryby

View GitHub Profile
@tzuryby
tzuryby / defaultdict.lua
Created June 6, 2020 14:10
lua implementaiton of python's default dict
function defaultdict(callable)
local T = {}
setmetatable(T, {
__index = function(T, key)
local val = rawget(T, key)
if not val then
rawset(T, key, callable())
end
return rawget(T, key)
end
@tzuryby
tzuryby / random-ipv4.sh
Created April 3, 2020 05:46
random ipv4
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
done
@tzuryby
tzuryby / aggregate-cidr-addresses.pl
Created August 30, 2018 08:13 — forked from denji/README.md
Take a list of CIDR address blocks and combine them, for example, 192.168.0.0/24 and 192.168.1.0/24 gives 192.168.0.0/23. I usually use "list-iana-reserved-ranges | aggregate-cidr-addresses" to get a list of blocks to not report with firewall log processing. https://github.com/job/aggregate6
#!/usr/bin/perl
#
# aggregate-cidr-addresses - combine a list of CIDR address blocks
# Copyright (C) 2001,2007 Mark Suter <suter@zwitterion.org>
#
# 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
tzuryby / 0 - README.md
Created December 4, 2016 01:56 — forked from JamesMGreene/0 - README.md
A brief example of the latest idea for communicating with PhantomJS from the client-side.

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:
    https://gist.github.com/JamesMGreene/3716654

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
tzuryby / resume.c
Last active August 29, 2015 14:17 — forked from klange/_.md
#include <stdio.h>
#include <time.h>
/* TODO: resume.h */
typedef struct {
char * company;
char * location;
char * title;
@tzuryby
tzuryby / config.py
Last active August 29, 2015 14:16
config.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#config for haaretz premium checks
#host to check
#edgecast
# host = '93.184.219.20';
#Akamai
host = '82.166.201.147';
mbp:~ tzury$ curl -v http://images4.engageya.com/05/d8/website_93720/53/fd/d2/grazeit.com.Couple_LowSavings_200x200_133965_1.jpg > /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 images4.engageya.com port 80 (#0)
* Trying 94.31.29.229...
<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl">
<head id="ctl00_Head1">
<base href="http://www.prima.co.il/" />
<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
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
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