Skip to content

Instantly share code, notes, and snippets.

View skakri's full-sized avatar
🖱️
Click to enable Adobe Flash Player

Kristaps Karlsons skakri

🖱️
Click to enable Adobe Flash Player
View GitHub Profile
@skakri
skakri / 00readme.md
Created June 5, 2016 19:48 — forked from indrora/00readme.md
DeadUpdate: Kickin' it bigtime.

... my first disclosure. Man, it feels weird doing this.

From the vendor that brought you a
                        vulnerable cloud storage platform comes
                        
           ___              ____  __        __     __ 
          / _ \___ ___ ____/ / / / /__  ___/ /__ _/ /____ 
         / // / -_) _ `/ _  / /_/ / _ \/ _  / _ `/ __/ -_)

//_/_,/_,/_/ ./_,/_,/_/_/

@skakri
skakri / send_file_partial.py
Last active May 18, 2017 19:16 — forked from lizhiwei/send_file_partial.py
HTTP 206 (Partial Content) For Flask
import mimetypes
import os
import re
from flask import request, send_file, Response
@app.after_request
def after_request(response):
response.headers.add('Accept-Ranges', 'bytes')
return response
Building wheels for collected packages: django-grappelli, django-imagekit, django-haystack, django-taggit-labels, django-wysiwyg-redactor, django-reversion, Pillow, psycopg2, sh, pilkit
Running setup.py bdist_wheel for django-grappelli
Stored in directory: /home/skakri/.cache/pip/wheels/70/62/e6/34b93f49018597d842f29ed28a4ceb04612cca41dce9c35b35
Running setup.py bdist_wheel for django-imagekit
Stored in directory: /home/skakri/.cache/pip/wheels/e5/01/97/684d4d8b68ad1874fcc158117c309875514bbb2512ffdc345f
Running setup.py bdist_wheel for django-haystack
Stored in directory: /home/skakri/.cache/pip/wheels/c2/71/28/0b02057e76b39e29b18c8c38a06e05def283e0d3a0d7dd5813
Running setup.py bdist_wheel for django-taggit-labels
Stored in directory: /home/skakri/.cache/pip/wheels/2e/0c/bb/1e5d9293ee93569cae3d06eeacaa9080ab81c558705c5997fd
Running setup.py bdist_wheel for django-wysiwyg-redactor
@skakri
skakri / doot.c
Created September 14, 2015 17:42
#include <stdio.h>
int main(int argc, char* argv[]){
printf("%c",~~-~~~-~~~~-~~~~~-~~'2'+'2');
printf("%c",-~~~-~~~~~~~-~~~~~~~'3'+'3');
printf("%c",~-~~~~~-~~~~~-~~~-~-'4'+'4');
printf("%c",~~~-~~-~~~-~~-~~-~~~'5'+'5');
printf("%c",~-~-~-~-~-~-~-~-~-~-'6'+'6');
printf("%c",~~-~-~-~~~-~-~~~-~-~'7'+'7');
printf("%c",~~-~-~~~-~~~~~~~-~~~'8'+'8');
printf("%c",~~~-~~-~~~-~~~~~-~~~'9'+'9');
@skakri
skakri / vunits.js
Last active August 29, 2015 14:25 — forked from LeaVerou/vunits.js
/**
* Polyfill for the vw, vh, vm units
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/
* @author Lea Verou
*/
(function() {
if(!window.StyleFix) {
return;
@skakri
skakri / broadcast-ip.sh
Created April 30, 2015 12:40
broadcast-ip.sh
#!/bin/sh
# Broadcasts IP on 20420 (UDP) to local network.
# To get IP of this device, run `nc -ul 20420` and wait a bit.
ip -o -4 addr show | awk -F '[ /]+' '/global/ {print $4}' | socat - "UDP-DATAGRAM:255.255.255.255:20420,broadcast"
@skakri
skakri / rails_tz.py
Created August 26, 2014 15:35 — forked from amitu/rails_tz.py
{
"Abu Dhabi": "Asia/Muscat",
"Adelaide": "Australia/Adelaide",
"Alaska": "America/Juneau",
"Almaty": "Asia/Almaty",
"American Samoa": "Pacific/Pago_Pago",
"Amsterdam": "Europe/Amsterdam",
"Arizona": "America/Phoenix",
"Astana": "Asia/Dhaka",
"Athens": "Europe/Athens",
// Comments and commas for syntax
highlighting = [
//POST test
{
"settings": {
"analysis": {
"filter": {
"synonym": {
"synonyms_path": "/usr/share/wordnet-prolog/wn_s.pl",
@skakri
skakri / LV-CVE-2014-0160.txt
Last active August 29, 2015 13:59
CVE-2014-0160
19.lv
2m.lv
3000.lv
32maijs.lv
4dance.lv
4metri.lv
57paralele.lv
5ezeri.lv
5g.lv
a4d.lv
@skakri
skakri / snips.py
Created April 3, 2014 06:44
Python snippets
#
# Django
#
# better solution than model_to_dict, if you need model instance dict, which holds m2m field values
# source: https://djangosnippets.org/snippets/2278/ (gabipurcaru)
from types import NoneType
from django.db.models.manager import Manager
from django.db.models import Model