根据启动Bash Shell的方式不同,对Shell有两种分类方式
根据Shell的启动方式不同,可以将Shell分为
class API(app.page): | |
pass | |
class DjangoAPI(API): | |
model = None | |
def __init__(self): | |
self.qs = self.model.objects | |
self.exclude = [] |
from itertools import product | |
import string | |
print(list(product(string.lowercase[:13],repeat=2))) | |
[('a', 'a'), ('a', 'b'), ('a', 'c'), ('a', 'd'), ('a', 'e'), ('a', 'f'), ('a', 'g'), ('a', 'h'), ('a', 'i'), ('a', 'j'), ('a', 'k'), ('a', 'l'), ('a', 'm'), ('b', 'a'), ('b', 'b'), ('b', 'c'), ('b', 'd'), ('b', 'e'), ('b', 'f'), ('b', 'g'), ('b', 'h'), ('b', 'i'), ('b', 'j'), ('b', 'k'), ('b', 'l'), ('b', 'm'), ('c', 'a'), ('c', 'b'), ('c', 'c'), ('c', 'd'), ('c', 'e'), ('c', 'f'), ('c', 'g'), ('c', 'h'), ('c', 'i'), ('c', 'j'), ('c', 'k'), ('c', 'l'), ('c', 'm'), ('d', 'a'), ('d', 'b'), ('d', 'c'), ('d', 'd'), ('d', 'e'), ('d', 'f'), ('d', 'g'), ('d', 'h'), ('d', 'i'), ('d', 'j'), ('d', 'k'), ('d', 'l'), ('d', 'm'), ('e', 'a'), ('e', 'b'), ('e', 'c'), ('e', 'd'), ('e', 'e'), ('e', 'f'), ('e', 'g'), ('e', 'h'), ('e', 'i'), ('e', 'j'), ('e', 'k'), ('e', 'l'), ('e', 'm'), ('f', 'a'), ('f', 'b'), ('f', 'c'), ('f', 'd'), ('f', 'e'), ('f', 'f'), ('f', 'g'), ('f', 'h'), ('f', 'i'), ('f', 'j'), ('f', 'k'), ('f', 'l'), |
#!/bin/bash | |
# FAIL! | |
echo a| read i | |
echo $i | |
# WORKS | |
read i <<<$(echo a) | |
echo $i |
This is a brief introduction about how Linux kernel handles the send
system call.
This study is based on kernel version 3.7.2, which is the latest stable kernel when writing this study.
In the latest kernel, the system call is defined using the SYSCALL_DEFINEx
macro, in which x
is the number of arguments. For example, in order to find the definition of asmlinkage long sys_sendto(int, void __user *, size_t, unsigned, struct sockaddr __user *, int);
, you need to grep
for SYSCALL_DEFINE6
because it has 6 arguments.
The definition of the system call send
can be found at net/socket.c
.
def get_readonly_fields(self, request, obj=None): | |
if obj and obj.is_processed: | |
return ('csv_file',) + self.readonly_fields | |
else: | |
return self.readonly_fields |
#!/usr/bin/env python | |
# vim: set fileencoding=utf-8 ts=4 sw=4 tw=79 : | |
from __future__ import (unicode_literals, absolute_import, | |
division, print_function) | |
import requests | |
from lxml import etree | |
from io import StringIO |
import os | |
from google.appengine.ext import vendor | |
""" | |
1. Create a virtualenv directory at the root of your project, name it "venv" | |
2. Install packages needed in your project | |
3. Freeze it and save the package list into requirements.txt file, add it to | |
version control | |
4. Exclude "venv" directory from version control | |
5. Save the content of this file as "appengine_config.py", and put it at the |
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
class MyList(list): | |
def __init__(self, raw_list, start=None, stop=None): | |
self.raw_list = raw_list | |
self.start = start or 0 | |
self.stop = stop or len(raw_list)-1 |
mkdir -p confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14B---/confdir-14 |