Skip to content

Instantly share code, notes, and snippets.

View xiaopeng163's full-sized avatar
🇳🇱
Focusing

Peng Xiao xiaopeng163

🇳🇱
Focusing
View GitHub Profile
~~~ clear

➜  ~ python
Python 2.7.10 (default, Jul 30 2016, 18:31:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
# Copyright 2016 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@xiaopeng163
xiaopeng163 / tar_gz_file.py
Created February 8, 2017 07:54
tar.gz file in a folder
import os
import tarfile
MSG_PATH = './'
file_list = os.listdir(MSG_PATH)
for msg_file in file_list:
if not msg_file.endswith('.msg'):
continue
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-5530101703628975",
enable_page_level_ads: true
});
</script>
print("hell")
from flask import Flask, jsonify
import random
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@xiaopeng163
xiaopeng163 / install-python-from-source.md
Last active April 18, 2024 08:51
Install Python 3.7 from source code on Ubuntu 18.04
[12:12:41] pengxiao:~ $ sudo apt-get install libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libssl-doc libssl1.1
The following NEW packages will be installed:
  libssl-dev libssl-doc
The following packages will be upgraded:
@xiaopeng163
xiaopeng163 / install.md
Last active August 9, 2019 08:27
install ansible on ubuntu1804

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-18-04

penxiao@WPU8L0042502:~$ sudo apt update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8570 kB]
hosts: localhost
vars:
data:
key1: 1
key2: 2
tasks:
- name: Hello World debug
debug: