Skip to content

Instantly share code, notes, and snippets.

View pombredanne's full-sized avatar

Philippe Ombredanne pombredanne

View GitHub Profile
@satra
satra / fastio.py
Last active March 7, 2022 20:16 — forked from jart/fastio.py
Multithreaded Python os.walk
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@q3k
q3k / cursed.c
Last active April 3, 2024 09:19
Linux syscalls in .exe executed under Wine
#include <stdio.h>
#include <string.h>
const char *buf = "hello from linux\n";
char * const argv[] = {
"/bin/sh",
"-c",
"echo 'hello from execve'",
NULL,
};
@AmitGupta7580
AmitGupta7580 / api.py
Created April 17, 2021 09:46
bulk_search API Code suggestion for vulnerablecode
from urllib.parse import unquote
from django.db.models import Q
from django.urls import reverse
from django_filters import rest_framework as filters
from drf_spectacular.utils import extend_schema, inline_serializer
from packageurl import PackageURL
from rest_framework import serializers, viewsets, mixins
from rest_framework.decorators import action
@pombredanne
pombredanne / migrate-redis.py
Created December 20, 2019 16:09 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
@jayvdb
jayvdb / missing-license-task.md
Last active December 29, 2021 19:53
Missing license GitHub task

Add a missing license to a repository

Three steps:

  1. Find a repository without a LICENSE or LICENSE.md file.
  2. Determine the most appropriate license for the repository.
  3. Create a pull request adding a LICENSE or LICENSE.md file.

@EricDuminil
EricDuminil / trie.py
Last active December 31, 2023 06:04 — forked from atiking/regexp-trie.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#author: rex
#blog: http://iregex.org
#filename trie.py
#created: 2010-08-01 20:24
#source uri: http://iregex.org/blog/trie-in-python.html
# escape bug fix by fcicq @ 2012.8.19
@jart
jart / fastio.py
Created October 23, 2016 06:44
Multithreaded Python os.walk
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
#!/bin/sh
""":"
which python3 >/dev/null 2>&1 && exec python3 "$0" "$@"
which python >/dev/null 2>&1 && exec python "$0" "$@"
which python2 >/dev/null 2>&1 && exec python2 "$0" "$@"
echo "Error: configure wrapper requires python"
exec echo "Either install python, or use cmake directly"
":"""
{% extends "admin/change_list.html" %}
{% load admin_list i18n mptt_admin %}
{% block result_list %}
{% mptt_result_list cl %}
{% endblock %}