Skip to content

Instantly share code, notes, and snippets.

View svetlyak40wt's full-sized avatar
💭
Making Ultralisp.org

Alexander Artemenko svetlyak40wt

💭
Making Ultralisp.org
View GitHub Profile
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (jspenguin@jspenguin.org)
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select
@svetlyak40wt
svetlyak40wt / pillar:firewall.sls
Created June 18, 2014 04:56
A module for SaltStack to setup firewall rules across many machines (change : to backslashes)
firewall:
groups:
all: [clupea, salmon, skate]
test: [clupea]
rules:
clupea:
- port: 22
- port: 80
% openssl s_client -connect lk.megafon.ru:443 -verify 3
verify depth is 3
depth=0 /1.3.6.1.4.1.311.60.2.1.3=RU/businessCategory=Private Organization/serialNumber=1027809169585/C=RU/ST=Moscow/L=Moscow/O=OJSC MegaFon/CN=lk.megafon.ru
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /1.3.6.1.4.1.311.60.2.1.3=RU/businessCategory=Private Organization/serialNumber=1027809169585/C=RU/ST=Moscow/L=Moscow/O=OJSC MegaFon/CN=lk.megafon.ru
verify error:num=27:certificate not trusted
verify return:1
depth=0 /1.3.6.1.4.1.311.60.2.1.3=RU/businessCategory=Private Organization/serialNumber=1027809169585/C=RU/ST=Moscow/L=Moscow/O=OJSC MegaFon/CN=lk.megafon.ru
verify error:num=21:unable to verify the first certificate
console_app.controller("MyCtrl", list("$scope", "$http", (function($scope, $http) {
return console.log("DONE");
})));
@svetlyak40wt
svetlyak40wt / unittest.lisp
Last active August 29, 2015 14:03
Фреймворк для юнит-тестирования на jisp
(= tests `())
(def pr line
(process.stdout.write line))
(def prn line
(pr (+ line "\n")))
(mac test name ...body

To update clock summary, place cursor on BEGIN and press C-c C-c.

Clock summary at [2014-07-31 Thu 12:39]

EffortHeadlineTime
Total time0:55
Top Level Item0:55
@svetlyak40wt
svetlyak40wt / blocks.py
Created August 2, 2014 20:40
Кусок адского мега-фреймворка, по типу БЭМ, но для питона и извращений типа bem-tools :)
# ...
def block(**modifiers):
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
"""Этот декоратор реализует отложенный вызов функции, которую он декорирует.
По сути, он возвращает promice, который при вызове, уже зовет реальную функцию.
"""
def ret():
@svetlyak40wt
svetlyak40wt / salt-shell-shock-checker.sh
Last active August 29, 2015 14:07
How to check with Salt if your servers are in danger because of ShellShock.
# first check
sudo salt '*' cmd.run \
'bash -c "echo Bash Test"' \
'env={"VAR": "() { :;}; echo Bash is vulnerable.", "FUNCTION()": "() { :;}; echo Bash is vulnerable."}'
# and then upgrade if needed
sudo salt '*' cmd.run \
'apt-get update && apt-get install --only-upgrade bash'
kupi_baton()
if there_are_eggs_on_the_shell():
for x in range(10):
kupi_baton()
@svetlyak40wt
svetlyak40wt / macro-prototype.jisp
Last active August 29, 2015 14:08
Testing jisp as react's JSX replacement
(mac mknode name
`(mac ,name ,attrs ,children
`(fn ((get React.DOM name) ,attrs ,children))))
(mknode div)
(mknode ul)
(mknode p)
; ...
(= CommentBox (React.createClass