Skip to content

Instantly share code, notes, and snippets.

View rayluo's full-sized avatar
🎯
Focusing

Ray Luo rayluo

🎯
Focusing
View GitHub Profile
@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/'
@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
@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
@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])
@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
@erikbern
erikbern / use_pfx_with_requests.py
Last active February 26, 2024 00:23
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
@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

@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
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active March 21, 2024 09:16
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@gitaarik
gitaarik / git_submodules.md
Last active March 25, 2024 12:47
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.