Skip to content

Instantly share code, notes, and snippets.

View akszydelko's full-sized avatar
🐒
Don't worry, code, be happy.

Arkadiusz Szydełko akszydelko

🐒
Don't worry, code, be happy.
  • Infermedica
  • Poland
View GitHub Profile
@coryodaniel
coryodaniel / list.txt
Created May 13, 2020 22:04
GCP List of API Services
NAME TITLE
abusiveexperiencereport.googleapis.com Abusive Experience Report API
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API
accessapproval.googleapis.com Access Approval API
accesscontextmanager.googleapis.com Access Context Manager API
actions.googleapis.com Actions API
adexchangebuyer-json.googleapis.com Ad Exchange Buyer API
adexchangebuyer.googleapis.com Ad Exchange Buyer API II
adexchangeseller.googleapis.com Ad Exchange Seller API
adexperiencereport.googleapis.com Ad Experience Report API
@vparitskiy
vparitskiy / request.py
Created November 14, 2017 01:04
get Django request everywhere using threading.local
# -*- coding: utf-8 -*-
import logging
from threading import local
from django.contrib.auth.models import AnonymousUser
_thread_locals = local()
logger = logging.getLogger(__name__)
@huyinghuan
huyinghuan / encrypt_file_pkcs5_pkcs7.go
Created May 31, 2017 07:44
golang encrypt with pkcs5 and pkcs7
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"errors"
"io"
"io/ioutil"
@thehesiod
thehesiod / async_worker_pool.py
Last active June 30, 2023 11:01
Asynchronous Worker Pool, allows for limiting number of concurrent tasks
import asyncio
from datetime import datetime, timezone
import os
def utc_now():
# utcnow returns a naive datetime, so we have to set the timezone manually <sigh>
return datetime.utcnow().replace(tzinfo=timezone.utc)
class Terminator:
pass
@atrepca
atrepca / kafka.service
Created September 27, 2016 13:53
Kafka Systemd Service Configuration File for Ubuntu 16.04
[Unit]
Description=Apache Kafka server (broker)
Documentation=http://kafka.apache.org/documentation.html
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple
PIDFile=/var/run/kafka.pid
User=kafka
@riverans
riverans / backup-hook.pl
Created June 22, 2016 10:37 — forked from bitcloud/backup-hook.pl
Proxmox backup-hook for Hetzner Server
#!/usr/bin/perl -w
# hook script for vzdump (--script option)
=begin comment
backuphook for Proxmox
renames files so that they include the hostname of the machine
Instructions for Hetzner Backup Server auth via SSH
@cboettig
cboettig / docker-compose.yml
Last active December 31, 2023 15:23
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@inindev
inindev / postgresql_jsonb_crud.sql
Last active February 13, 2024 03:18 — forked from matheusoliveira/json_manipulator.sql
Simple PostgreSQL 9.4 functions to manipulate jsonb objects adapted from Matheus de Oliveira's json_manipulator.sql. https://gist.github.com/matheusoliveira/9488951 (Note: performance is not a concern for those functions)
/*
* derivative work of Matheus de Oliveira's json_manipulator.sql
* https://gist.github.com/matheusoliveira/9488951
*
* adapted to support postgresql 9.4 jsonb type
* no warranties or guarantees of any kind are implied or offered
*
* license is as Matheus conferred it on 4/9/2015:
* matheusoliveira commented on Apr 9
* @hannes-landeholm, I'd like to take credit if you share them
@bitcloud
bitcloud / backup-hook.pl
Last active July 10, 2021 11:01
Proxmox backup-hook for Hetzner Server
#!/usr/bin/perl -w
# hook script for vzdump (--script option)
=begin comment
backuphook for Proxmox
renames files so that they include the hostname of the machine
Instructions for Hetzner Backup Server auth via SSH
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/