Skip to content

Instantly share code, notes, and snippets.

View efazati's full-sized avatar
🎯
Focusing

Mohammad Efazati efazati

🎯
Focusing
View GitHub Profile
@buptliuwei
buptliuwei / Kubernetes cluster setup based on amd64 && NVIDIA JETSON TX2.md
Last active August 31, 2020 21:54
Our project aims to build a Multi-platform kubernetes cluster, we use the VM on x86 as master node and two nvidia tx2 development kits as node. So we can schedule both CPU and GPU resources.

Kubernetes cluster setup based on amd64 && NVIDIA JETSON TX2

Thanks to @luxas create the Kubernetes on ARM project. But my project has some different, i have a VM on x86 as master node and two nvidia tx2 development kits as work node. So my kubernetes cluster are multi-platform. I use kubeadm as a deployment method.Some basic information of my platform is as follows.

Versions

kubeadm version (use kubeadm version):1.10.0

Environment:

  • Kubernetes version (use kubectl version):1.10.0
  • Cloud provider or hardware configuration:an amd64 master and 1 arm nodes (nvidia tagra TX2)
@manicminer
manicminer / README.md
Last active January 25, 2024 12:27
Ansible invocation with assumed IAM role

Ansible invocation with assumed IAM role

How it works

  • boto3 initializes a session using the specified profile, for which it assumes a role as configured in your ~/.aws/config
  • Python script with above session initialization prints out shell-compatible environment variables of the temporary credentials
  • Wrapper script sets these a la eval
  • By the time Ansible runs, the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SECURITY_TOKEN (for boto2) / AWS_SESSION_TOKEN (for boto3) are all set, and are consumed by boto2 in the inventory script and other boto2-based modules

Notes

@gianrubio
gianrubio / circle.yml
Last active December 17, 2023 22:01
Socks proxy to connect private hosts with circleci
machine:
services:
- docker
post:
- wget https://gist.githubusercontent.com/gianrubio/dce37ee9b9c024937832d776597e2603/raw/4cdb30e5075e8e6064ac48a258e05f518f8c88c0/circleci-tunnel.sh ~/ && chmod +x ~/circleci-tunnel.sh
- ~/circleci-tunnel.sh start:
background: true
@vt0r
vt0r / GnuPG-2.2.md
Last active February 13, 2024 09:03 — forked from mattrude/GnuPG-2.1.md
Build/install instructions for GnuPG 2.2.x on Ubuntu and similar distros (formerly for 2.1.x)

GnuPG 2.2.x Build Instructions

Below are my build instructions for GnuPG 2.2.10, released on August 30th, 2018. These instructions are built for a headless Ubuntu 18.04 LTS server (and have also been tested on Ubuntu 14.04/16.04).

If you prefer, you may use the below install script to install GnuPG 2.2.x by running the following commands:

curl -OL "https://gist.githubusercontent.com/vt0r/a2f8c0bcb1400131ff51/raw/e0d2011d7b89bfe5b83c3f29f21949fb21354dd9/install-gnupg22.sh" && sudo -H bash ./install-gnupg22.sh

Install the needed dependencies

@rshk
rshk / README.md
Last active May 20, 2018 04:07
Python colorful logging example

Usage example

% python -i colorful_logging_formatter.py 
>>> import logging
>>> logger = logging.getLogger('foo')
>>> logger.setLevel(logging.DEBUG)
>>> import sys
>>> handler = logging.StreamHandler(sys.stderr)
>>> handler.setFormatter(ColorLogFormatter())
@eskriett
eskriett / GoogleMapDownloader.py
Last active April 10, 2024 13:00
A python script to download high resolution Google map images given a longitude, latitude and zoom level.
#!/usr/bin/python
# GoogleMapDownloader.py
# Created by Hayden Eskriett [http://eskriett.com]
#
# A script which when given a longitude, latitude and zoom level downloads a
# high resolution google map
# Find the associated blog post at: http://blog.eskriett.com/2013/07/19/downloading-google-maps/
import urllib
import Image
from flask import request, url_for
def modified_url(**new_args):
args = request.view_args.copy()
args.update(new_args)
return url_for(request.endpoint, **args)
app.jinja_env.globals['modified_url'] = modified_url
anonymous
anonymous / gist:4411509
Created December 30, 2012 08:04
;Add ~/.emacs.d/lisp to load-path
(add-to-list 'load-path "/usr/share/emacs/24.1.50/lisp")
(add-to-list 'load-path "~/.emacs.d/lisp")
;;====================================================================================
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
;;====================================================================================
;;Setup color theme
@nimolix
nimolix / gist:4382065
Created December 26, 2012 18:30
Convert a numeric value into Persian words
String.prototype.persianThousandsSeparator = function () {
var val = this.toString();
var x = val.split('.');
var x1 = x[0];
var x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + '٬' + '$2');
}
return x1 + x2;
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google