Skip to content

Instantly share code, notes, and snippets.

View iasonliu's full-sized avatar
🐛
(╯°□°)╯︵ ┻━┻

Xiangxu iasonliu

🐛
(╯°□°)╯︵ ┻━┻
View GitHub Profile
@iasonliu
iasonliu / python_resources.md
Created August 25, 2014 09:47 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@iasonliu
iasonliu / gist:ac620c46688535e4fc7a0a9321122d3e
Last active April 20, 2016 06:59
staticmethod classmethod 区别

一般来说,要使用某个类的方法,需要先实例化一个对象再调用方法。 而使用@staticmethod或@classmethod,就可以不需要实例化,直接类名.方法名()来调用。 这有利于组织代码,把某些应该属于某个类的函数给放到那个类里去,同时有利于命名空间的整洁。

既然@staticmethod和@classmethod都可以直接类名.方法名()来调用,那他们有什么区别呢 从它们的使用上来看,

  • @staticmethod不需要表示自身对象的self和自身类的cls参数,就跟使用函数一样。
  • @classmethod也不需要self参数,但第一个参数需要是表示自身类的cls参数。
@iasonliu
iasonliu / kerberos_setup.md
Created May 6, 2017 14:34 — forked from ashrithr/kerberos_setup.md
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

@iasonliu
iasonliu / keybase.md
Created October 6, 2017 13:36
keybase.md

Keybase proof

I hereby claim:

  • I am iasonliu on github.
  • I am xiangxu (https://keybase.io/xiangxu) on keybase.
  • I have a public key ASAtzF3wr-ZxN8asAkTmX5LbdnF1tE73b2OS0L0XLqg4kAo

To claim this, I am signing this object:

@iasonliu
iasonliu / devops_best_practices.md
Created August 7, 2018 00:28 — forked from jpswade/devops_best_practices.md
Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.

In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.

Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud, open source and business](https://blogs.the451group.com/opensource/2010/03/03/devops-mixing-dev-ops-agile-cloud-open-source-and-busi

@iasonliu
iasonliu / certdump.go
Created December 14, 2018 04:51 — forked from tam7t/certdump.go
certdump consul-template plugin for writing vault-generated certificates to separate files
package main
import (
"io/ioutil"
"log"
"os"
"os/user"
"strconv"
)
@iasonliu
iasonliu / LearnGoIn5mins.md
Created January 15, 2021 01:30 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins