Skip to content

Instantly share code, notes, and snippets.

View akadata's full-sized avatar
🎯
Focusing

Andrew Smalley akadata

🎯
Focusing
View GitHub Profile
@akadata
akadata / ArchLinuxARM-M1
Created November 10, 2021 21:34 — forked from thalamus/ArchLinuxARM-M1
How to boot Arch Linux ARM in QEMU (patched for M1)
/*
* This document is provided to the public domain under the
* terms of the Creative Commons CC0 public domain license
*/
How to boot Arch Linux ARM in QEMU (patched for M1)
Prerequisites:
QEMU - patched for M1 processors - patches: https://github.com/utmapp/qemu
@akadata
akadata / stream_to_s3.py
Created November 6, 2021 02:59 — forked from amalgjose/stream_to_s3.py
Python program to Stream data from a URL and upload it directly to S3 without saving it to local disk. This program is very suitable to use in AWS Lambda functions. This works well with large files. This program acts like a relay between the source and the S3. For more details refer to https://amalgjose.com/2020/08/13/python-program-to-stream-da…
import boto3
import requests
authentication = {"USER": "", "PASSWORD": ""}
payload = {"query": "some query"}
session = requests.Session()
response = session.post("URL",
data=payload,
auth=(authentication["USER"],
@akadata
akadata / PostMessageToSlackChannel.php
Created January 14, 2020 22:58 — forked from nadar/PostMessageToSlackChannel.php
Post a message to a slack channel with PHP
<?php
/**
* Send a Message to a Slack Channel.
*
* In order to get the API Token visit: https://api.slack.com/custom-integrations/legacy-tokens
* The token will look something like this `xoxo-2100000415-0000000000-0000000000-ab1ab1`.
*
* @param string $message The message to post into a channel.
* @param string $channel The name of the channel prefixed with #, example #foobar
@akadata
akadata / arrayColumn.php
Created December 16, 2019 21:35 — forked from debuss/arrayColumn.php
Implementation of array_column function for PHP 5.3+, support for array of objects is also provided.
<?php
/**
* Implementation of array_column function for PHP 5.3+, support for array of objects is also provided.
*
* @param array $input
* @param mixed $column_key
* @param mixed $index_key
* @return array
* @see http://php.net/manual/en/function.array-column.php
@akadata
akadata / haproxy.config
Created December 14, 2018 01:40 — forked from meineerde/haproxy.config
Set all cookies set in the HTTP response to HttpOnly
acl httponly_cookie res.hdr(Set-Cookie),lower -m sub httponly
rspirep ^(set-cookie:.*) \1;\ HttpOnly if !httponly_cookie
@akadata
akadata / LICENSE.txt
Created December 14, 2018 01:40 — forked from meineerde/LICENSE.txt
Update existing OCSP responses in HAProxy. Assuming you have all your SSL certificates in one directory, you can simply call `haproxy_update_ocsp /path/to/haproxy/certificates` with cron every couple of hours. For new certificates, call `haproxy_ocsp /path/to/haproxy/certificates/server.pem` once to fetch the initial OCSP response.
The MIT License (MIT)
Copyright (c) 2015 Holger Just, Planio GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: