You need to provide Authorization
header in form Basic yourtoken
and User-Agent
header
/api/fresh
/api/popular
/api/search
All endpoints accept offset
and limit
(max 1000) query params.
Search endpoint also requires query
endpoint.
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 |
{ | |
"headers": [ | |
{ | |
"tool_name": "scancode-toolkit", | |
"tool_version": "21.3.1", | |
"options": { | |
"input": [ | |
"fsolver.txt" | |
], | |
"--copyright": true, |
#!/bin/python | |
from flashtext.keyword import KeywordProcessor | |
import random | |
import string | |
import re | |
import time | |
def get_word_of_length(str_length): | |
# generate a random word of given length | |
return ''.join(random.choice(string.ascii_lowercase) for _ in range(str_length)) |
Tested on Ubuntu 18.04 Docker container. The Dockerfile is a single line FROM ubuntu:18.04
. Alternatively, you can simply run docker run -it ubuntu:18.04 bash
.
NOTE: stopping services didn't work for me for some reason. That's why there is kill $(pidof <service name>)
after each failed service <service name> stop
to kill it.
This guide is basically a compilation of all the resources listed below.
var makeCRCTable = function(){ | |
var c; | |
var crcTable = []; | |
for(var n =0; n < 256; n++){ | |
c = n; | |
for(var k =0; k < 8; k++){ | |
c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); | |
} | |
crcTable[n] = c; | |
} |
{ | |
securityVulnerabilities(ecosystem: MAVEN, first: 100) { | |
nodes { | |
package { | |
name | |
ecosystem | |
} | |
vulnerableVersionRange | |
severity | |
updatedAt |
"""Upload release assets to a GitHub release | |
First create a release on Github, then: | |
python upload_release_assets.py 1.2.0 my_data.tgz | |
""" | |
import sys | |
REPOSITORY="your_organization/your_repo" | |
with open("GITHUB_TOKEN") as f: | |
TOKEN=f.read().strip() | |
from github import Github |
""" | |
Exports Issues from a specified repository to a CSV file | |
Uses basic authentication (Github username + password) to retrieve Issues | |
from a repository that username has access to. Supports Github API v3. | |
""" | |
import csv | |
import requests | |
import argparse | |
from django.core.management.base import BaseCommand | |
from django.db import connection | |
class Command(BaseCommand): | |
help = 'Renames app. Usage rename_app [old_name] [new_name] [classes ...]' | |
def add_arguments(self, parser): |