Skip to content

Instantly share code, notes, and snippets.

View tobiasgoecke's full-sized avatar
🖖
working on next level of smart X environment

Tobias Goecke (Göcke) tobiasgoecke

🖖
working on next level of smart X environment
View GitHub Profile
@johnyvelho
johnyvelho / readme.md
Last active April 22, 2024 13:18
Installing Supervisor on Elastic Beanstalk - 2021 - Linux AMI 2 - Laravel Worker Setup
  • Create the following folder structure in your root project directory: .ebextensions/supervisor

  • Place the supervisor.config under .ebextensions/

  • Place the setup.sh under .ebextensions/supervisor/

  • Run "chmod +x .ebextensions/supervisor/setup.sh"

  • Place the supervisord.conf under .ebextensions/supervisor/

@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active February 29, 2024 17:35
iOS Widget, das die Anzahl an Klopapier Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// dm Klopapier Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@Fanna1119
Fanna1119 / Django_ajax_file_upload.py
Last active May 26, 2021 19:47
Django Ajax File Upload with image compression
//HtML
<form>
{% csrf_token %}
<input type="file" name="pic" accept="image/*" id="image">
<input type="submit" id="send">
</form>
//JS
@mortenege
mortenege / django_channels_aws_eb_alb.md
Created March 4, 2018 06:48
Django Channels on AWS Elastic Beanstalk using an ALB

Django Channels on AWS Elastic Beanstalk using an ALB

This post will describe how to set up a Django Channels solution using AWS Elastic Beanstalk [EB]. This guide is written in response to there being very little information on the combination of Channels and AWS. Mainly many solutions end with problems regarding websockets, which is a fundamental part of Channels. See here and here. This guide will consist of multiple step-by-step parts including

  • How to set up a local Django Channels solution
  • How to set up an Application Load Balancer [ALB] to serve websockets
  • How to configure EB to deploy Cha
files:
"/etc/httpd/conf.d/proxy-pass.conf":
mode: 000644
owner: root
group: root
content: |
<Location /socket>
ProxyPass ws://127.0.0.1:8081/
ProxyPassReverse ws://127.0.0.1:8081/
</Location>
LINUX
======
rajdeeprath@rajdeeprath-VirtualBox:~$ ffmpeg -i /home/rajdeeprath/Downloads/bbb_480p_1000_64_1.mp4 -vcodec libx264 -vb 500k -vprofile baseline -level 2.1 -acodec libfdk_aac -ab 64000 -ar 48000 -ac 2 -f flv "rtmp://127.0.0.1:1935/live?username=testuser&password=testpass/streamname"
WINDOWS
=======
C:\Users\rajde>ffmpeg -i K:\lpackage\bbb_480p_1000_64.mp4 -vcodec libx264 -vb 500k -vprofile baseline -level 2.1 -acodec aac -ab 64000 -ar 48000 -ac 2 -strict experimental -f flv "rtmp://127.0.0.1:1935/live/streamname app=live?username=testuser&password=testpass live=1"
@vrajroham
vrajroham / laravel-supervisor.md
Last active December 1, 2023 01:55
Installing Supervisor on AWS EC2 and Beanstalk

Installing Supervisor on AWS EC2 and Beanstalk

This gist may help you to install supervisor Manually on AWS Beanstalk host. I was enable to install and configure referring supervisor docs. Here are the steps by which I was able to use supervisor on my project.

Note: I have performed this steps on Laravel project and my instance was Debian powered. You can change according to your requirement.


  • Check python with easy_install is installed
  • Install supervisor > $ easy_install supervisor
  • Create directory for supervisor workers > mkdir /etc/supervisor/conf.d/
  • Create laravel worker file > touch /etc/supervisor/conf.d/laravel-worker.conf
@Spaider
Spaider / envelope_encryption_kms_boto_pycrypto.md
Last active December 12, 2023 23:59 — forked from pmp/envelope_encryption_kms_boto_pycrypto.md
Envelope Encryption using AWS KMS, Python Boto, and PyCrypto.

If you use Amazon AWS for nearly anything, then you are probably familiar with KMS, the Amazon Key Management Service.

KMS is a service which allows API-level access to cryptographic primitives without the expense and complexity of a full-fledged HSM or CloudHSM implementation. There are trade-offs in that the key material does reside on servers rather than tamper-proof devices, but these risks should be acceptable to a wide range of customers based on the care Amazon has put into the product. You should perform your own diligence on whether KMS is appropriate for your environment. If the security profile is not adequate, you should consider a stronger product such as CloudHSM or managing your own HSM solutions.

The goal here is to provide some introductory code on how to perform envelope encrypt a message using the AWS KMS API.

KMS allows you to encrypt messages of up to 4kb in size directly using the encrypt()/decrypt() API. To exceed these limitations, you must use a technique called "envelope encryptio

@rverton
rverton / chrome_headless_screenshot.py
Created July 10, 2017 08:53
Make a screenshot with a headless google chrome in python
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
# Taken from https://forums.aws.amazon.com/thread.jspa?messageID=332091
sudo su -
cd /usr/local/bin
mkdir ffmpeg
cd ffmpeg
wget http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.latest.tar.gz
tar -xzf ffmpeg.static.64bit.latest.tar.gz