Skip to content

Instantly share code, notes, and snippets.

View sottabyte's full-sized avatar

Amirreza valizade sottabyte

View GitHub Profile
@yosemitebandit
yosemitebandit / meduele_login_with_requests.py
Created February 12, 2012 02:46
using the request lib's sessions to login; bonus: beautiful soup finds the csrf token
#!/usr/bin/env python
'''
testing a login to meduele using sessions
meduele checks csrf tokens with every request, even during login
'''
import requests
from BeautifulSoup import BeautifulSoup
# need to capture a valid csrf token
# first visit the login page to generate one
@jverdeyen
jverdeyen / deployer_defaults_main.yml
Last active December 29, 2021 16:16
Ansible role to push deploy key onto Gitlab instance
---
deployer_user: deploy
deployer_group: deploy
deployer_groups: ['admin']
deployer_user_ssh_key_file: .ssh/id_rsa
deployer_gitlab_api: https://[gitlab-domain]/api/v3/
deployer_gitlab_token: [gitlab-token-for-specific-user]
deployer_gitlab_key_title: "{{ ansible_hostname }}_deployer"
@chrislavender
chrislavender / gist:cad26500c9655627544f
Last active April 19, 2024 15:28
HTTP Live Streaming Tutorial

Note: This is an older post that I did back when I thought I might have time to be a blogger. Oh I was oh so wrong. However, it has proven useful for some folks on stackoverflow. Thus I'm keeping it alive here on Gist.

One of my past projects dealt heavily with an open source Apple technology called HTTP Live Streaming. It’s an HTTP based streaming protocol that at its most fundamental level provides a way to stream video and audio from just about any server with nothing but a few free software tools provided by Apple**. However, it has a few additional features that I think make it a really exciting tool. Yet, I haven’t seen HTTP Live Streaming used very much. This is probably mainly due to the combination of a lack of good/clear documentation, and Apple’s Live Streaming Developer Tools being command line based also make the barrier to entry higher than many developers want to deal with.

The hope is to share my understanding of how to use this technology to:

@amrza
amrza / run.py
Last active July 8, 2024 08:13
How to write RTL(Arabic/Persian) text on images in python.
# Tested on Python 3.6.1
# install: pip install --upgrade arabic-reshaper
import arabic_reshaper
# install: pip install python-bidi
from bidi.algorithm import get_display
# install: pip install Pillow
from PIL import ImageFont