Skip to content

Instantly share code, notes, and snippets.

View rayluo's full-sized avatar
🎯
Focusing

Ray Luo rayluo

🎯
Focusing
View GitHub Profile
@brianhsu
brianhsu / gist.py
Created November 30, 2011 02:49
[Python] reStructuredText GitHub Gist directive.
class GitHubGist(Directive):
""" Embed GitHub Gist.
Usage:
.. gist:: GIST_ID
"""
required_arguments = 1
optional_arguments = 1
@diewland
diewland / n10_hdmi_resolution.txt
Created June 16, 2016 04:44
Nexus 10 change resolution script for fix hdmi problem
# ----------------
# http://forum.xda-developers.com/showthread.php?t=2278508
# http://forum.xda-developers.com/showthread.php?t=2294786
#
# (require root)
# reset
wm size reset
wm density reset
wm overscan reset
@tomdeboer
tomdeboer / for_me_on_github.html
Last active April 3, 2021 05:09 — forked from matthua/main.html
Show a "Fork me on Github" banner on the top right corner. With z-index.
<a href="https://github.com/tomdeboer/imito"><img style="position: absolute; top: 0; right: 0; border: 0; z-index:100;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
@demaniak
demaniak / Dockerfile
Created April 24, 2020 06:55
Run Microsoft teams in docker on linux
FROM ubuntu
RUN apt-get update && \
apt-get install -y curl apt-utils \
libasound2 libatk-bridge2.0-0 libcairo2 libcups2 libgdk-pixbuf2.0-0 \
libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \
libsecret-1-0 libx11-xcb1 libxcomposite1 libxcomposite1 \
libxss1 apt-transport-https libxkbfile1
COPY teams.deb /tmp/teams.deb
@iMilnb
iMilnb / boto3_hands_on.md
Last active October 19, 2022 09:15
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@gene1wood
gene1wood / analyze_pypi_package_names.py
Last active June 12, 2023 02:24
Analysis of PyPi package names and the use of dashes underscores upper and lower case
try:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
packages = client.list_packages()
total = len(packages)
dashes = len([x for x in packages if '-' in x])
@bgavrilMS
bgavrilMS / clone_gh_issue.ps1
Last active January 17, 2024 20:03
Clone GitHub issue cross MSAL repos
# 1. One time setup: install GH CLI https://cli.github.com/
# 2. Update $issue_to_clone and $target_repos variables
# 3. Manually update the project if needed (e.g. Customer Trust). Labels should be automatically cloned.
# Config - step 1
$issue_to_clone = "https://github.com/AzureAD/microsoft-authentication-library-for-java/issues/757"
$repo_java = 'https://github.com/AzureAD/microsoft-authentication-library-for-java/'
$repo_go = 'https://github.com/AzureAD/microsoft-authentication-library-for-go/'
$repo_py = 'https://github.com/AzureAD/microsoft-authentication-library-for-python/'
@jpf
jpf / signed-jwt-in-python.md
Last active February 17, 2024 15:07
JWTs signed with RS256 in Python: A demonstration of org-babel

Introduction

This is a guide to using pyjwt to sign and validate a JWT using RS256.

The trickiest part of doing this is knowing what the proper OpenSSL commands are to generate the RSA keypair. I demonstrate that below.

Generating RSA keys

@althonos
althonos / setup.cfg
Last active March 4, 2024 18:08
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@j-c-cook
j-c-cook / cross-compile-python.md
Last active April 9, 2024 17:09
Cross-compile Python for use on armv7l

Cross-compile Python for use on armv7l

Introduction

This post shows how to cross compile Python (using the [CPython][#cpython] implementation) for use on an armv7l chip. This can likely be extrapolated to other chip archetectures, but the proper cross-compilation toolchain would need to be substituded. The Python version utilized here is version 3.7.13. The driving force behind this effort was to get [python-can][#python-can] functional on an armv7l platform. This compilation process is done on a Ubuntu 20.04.4 LTS operating system. I have utilized various online references and will do my best to provide citation and links.

In my case the device with an armv7l chip contains a root file system and shared objects that are compiled using a version of [buildroot][#buildroot]. The buildroot menu configuration allows for the selection of Python 3 for installation, but not all of the basic packages are included. For example, importing the python-can package into an environment using Python 3 installed b