This gist was built by the community of the researchers and was scribed by Kir and Igor from the QIWI/Vulners. We are grateful for the help of all those who sent us the data, links and information. Together we can make this world a better place!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Bash best practices and style-guide | |
| Just simple methods to keep the code clean. | |
| Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/). | |
| ## Quick big rules | |
| * All code goes in a function | |
| * Always double quote variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # based on https://gist.github.com/blueyed/4fb0a807104551f103e6 | |
| # and on https://gist.github.com/TauPan/aec52e398d7288cb5a62895916182a9f (gistspection!) | |
| from django.core.management import call_command | |
| from django.db import connection | |
| from django.db.migrations.executor import MigrationExecutor | |
| import pytest | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Dynamic plotting in matplotlib. Copy and paste into a Jupyter notebook." | |
| # written October 2016 by Sam Greydanus | |
| %matplotlib notebook | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import time | |
| def plt_dynamic(x, y, ax, colors=['b']): | |
| for color in colors: | |
| ax.plot(x, y, color) |
The following attack will display a "you've been signed out" page for GMail, and attempt to steal your account credentials.
DO NOT PUT ANY ACCOUNT CREDENTIALS INTO ANY TABS CREATED AFTER VISITING THESE LINKS :)
I received an email in my GMail inbox with a fake attachment image, styled to look like the real GMail attachment UI:
This linked to a page that ended up displaying a fake "you've been signed out" link, via the data:text/html... URL feature of Chrome:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import defaultdict, deque | |
| class Graph(object): | |
| def __init__(self): | |
| self.nodes = set() | |
| self.edges = defaultdict(list) | |
| self.distances = {} | |
| def add_node(self, value): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import inspect | |
| class Singleton(type): | |
| _instances = {} | |
| _init = {} | |
| def __init__(cls, name, bases, dct): | |
| cls._init[cls] = dct.get('__init__', None) | |
| def __call__(cls, *args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Test (data) migrations in Django. | |
| This uses py.test/pytest-django (the `transactional_db` fixture comes from there), | |
| but could be easily adopted for Django's testrunner: | |
| from django.test.testcases import TransactionTestCase | |
| class FooTestcase(TransactionTestCase): | |
| def test_with_django(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- coding: utf-8 -*- | |
| # Python 3.4 | |
| # author: http://blog.dokenzy.com/ | |
| # date: 2015. 4. 8 | |
| # References | |
| # http://www.imcore.net/encrypt-decrypt-aes256-c-objective-ios-iphone-ipad-php-java-android-perl-javascript/ | |
| # http://stackoverflow.com/questions/12562021/aes-decryption-padding-with-pkcs5-python | |
| # http://stackoverflow.com/questions/12524994/encrypt-decrypt-using-pycrypto-aes-256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getLocale() { | |
| var lang; | |
| if (navigator.languages) { | |
| // chrome does not currently set navigator.language correctly https://code.google.com/p/chromium/issues/detail?id=101138 | |
| // but it does set the first element of navigator.languages correctly | |
| lang = navigator.languages[0]; | |
| } else if (navigator.userLanguage) { | |
| // IE only | |
| lang = navigator.userLanguage; |
