Skip to content

Instantly share code, notes, and snippets.

@zuriby
zuriby / gist:5059550
Last active December 14, 2015 08:38
#myscript.sh
while read line; do
echo "$line" | awk '{print "first Field:"$1}'
echo "$line" | tee -a /tmp/myfile.log | tr ['a-z'] ['A-Z']
done
#! /bin/bash
cat - | awk '{print "here come my long line aws statement:"$1}'
@zuriby
zuriby / yuval.py
Created November 14, 2012 19:28
Yuval's first python program
>>> 300000000000000000000000000000000000000000000000000000000000000000000000000222222222222222222222222222222222222222222222222222222222222222222222222222222255555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555544444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444466666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666699999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333388888888888888888888888888888888888888888888888888888888888888888888888888
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
... Bluetooth output here ...
console.log("starting...")
setTimeout('console.log("5 seconds later...")', 5000)
setTimeout('console.log("10 seconds later...")',10000)
setTimeout('console.log("15 seconds later...")',15000)
<script
function loadNewLogo() {
new Image().src="http://orlead.com/v/$SESSION$EVENT/new-logo.png"
}
$().ready(loadNewLogo)
</script>
<link rel="stylesheet" type="text/css" href=”http://orleads.com/$SESSION$EVENT/ipad-retina.css” />
<script>
var _ocx = window.ActiveXObject;
proxyOcx = function() { alert(arguments); return _ocx(arguments)};
window.ActiveXObject = proxyOcx;
</script>
<script>
function sendRequest(url,callback,postData) {
var req = createXMLHTTPObject();
if (!req) return;
<a
href="http://example.com/not/existing/path/with/html/extension.html">
<img
style="width:1px;height:1px;border:0;background:transparent"
src="http://example.com/not/existing/path/with/png/extension.png">
</img>
</a>
@zuriby
zuriby / gist:2216379
Created March 27, 2012 14:27
yada yada
for logfile in iglob(os.path.join(path, '*.log')):
# e.g. '2012-12-31'
today_stamp = gen_stamp()
# example.com.[error.]log -> example.com
domain_name = parse_domain_name(logfile)
# new file name: $date_stamp-$domainname.log
rotate_name = today_stamp + '-' + logfile
# rotate file.
@zuriby
zuriby / sgmllib.py
Created December 26, 2011 04:01
add UnicodeError, UnicodeEncodeError,UnicodeDecodeError at except in finish_starttag and finish_endtag methods (between lines: 331-377)
"""A parser for SGML, using the derived class as a static DTD."""
# XXX This only supports those SGML features used by HTML.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDATA (character data -- only end tags are special). RCDATA is
# not supported at all.
@zuriby
zuriby / logger.py
Created December 14, 2011 02:34
python logger with colors
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = 'Tzury Bar Yochay'
__version__ = '0.1'
__license__ = 'GPLv3'
import logging
from logging import handlers