Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
"""Hi, ini adalah code snippet tentang parsing multiple line text | |
biasanya dipakai untuk file file konfigurasi. | |
Berikut adalah sample_text yang saya ingin buat spt ini: | |
{'COBA': 'sedang ini adalah coba\ncoba lagi\ncoba lagi', | |
'INITIAL': 'ini adalah initial\ndan ini adalah kalimat\njuga ini'} | |
dari: sample_text dibawah ini, | |
semoga bermanfaat, dan saya tidak bingung lagi.....""" | |
sample_text = """####INITIAL#### |
#!/usr/bin/env/python | |
# | |
# More of a reference of using jinaj2 without actual template files. | |
# This is great for a simple output transformation to standard out. | |
# | |
# Of course you will need to "sudo pip install jinja2" first! | |
# | |
# I like to refer to the following to remember how to use jinja2 :) | |
# http://jinja.pocoo.org/docs/templates/ | |
# |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import mimetypes, sys | |
import datetime | |
from os import curdir, sep | |
from os.path import splitext | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
import codecs | |
try: |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
server { | |
listen 80; | |
server_name www.yupyupnope.com; | |
rewrite ^/(.*) https://yupyupnope.com/$1 permanent; | |
} | |
server { | |
listen 80; | |
server_name yupyupnope.com; | |
rewrite ^/(.*) https://yupyupnope.com/$1 permanent; |
git init # 初始化本地git仓库(创建新仓库) | |
git config --global user.name "xxx" # 配置用户名 | |
git config --global user.email "[email protected]" # 配置邮件 | |
git config --global color.ui true # git status等命令自动着色 | |
git config --global color.status auto | |
git config --global color.diff auto | |
git config --global color.branch auto | |
git config --global color.interactive auto | |
git config --global --unset http.proxy # remove proxy configuration on git | |
git clone git+ssh://[email protected]/VT.git # clone远程仓库 |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser(description='Help iSCSI deployment.') | |
parser.add_argument('-s', '--service', choices=['target', 'initiator'], | |
default=None, | |
help='type of service deployment') | |
parser.add_argument('-o', '--host', default=None, | |
help='Host address for the machine to configure') | |
parser.add_argument('-t', '--target_host', default=None, | |
help='Host address where the initiator search the target') | |
parser.add_argument('-d', '--device', default='/dev/loop0', |
#!/usr/bin/env python | |
# encoding: utf-8 | |
# | |
# Copyright (c) 2010 Doug Hellmann. All rights reserved. | |
# | |
"""Show the built-in argument actions. | |
""" | |
#end_pymotw_header | |
import argparse |
import argparse | |
def exist_user(string): | |
exist_users = ['taro','jiro','saburo','ichi','ni','san'] | |
if string not in exist_users: | |
raise argparse.ArgumentTypeError("%s is not exist user"%(string)) | |
return string | |
parser = argparse.ArgumentParser(prog='test command', description='this is description text.') |
#!/bin/bash | |
# dirc - DracOS IRc Client | |
# Copyright (c) 2016 - randalltux | |
################################### | |
##### HOW TO ##### | |
##### -h: hostname ##### | |
##### -p: port ##### | |
##### -n: nick ##### | |
##### -k: password ##### | |
##### -c: config ##### |