Showing posts from November, 2015

[Django] How to upload a file to via Django REST Framework?

Here is an example to use Parser: MultiPartParser to parse the media type: multipart/form-data. You also can take a look at this for more in detail:

Client Side via curl: ( Basically you can use either PUT or POST)
Command format:
curl -X PUT -H 'Content-Type:multipart/form-data' -F 'data=@/{your_file}' -u {account}:{password} http://{your server ip address}/

for instance:
curl -X PUT -H 'Content-Type:multipart/form-data' -F 'data=@/Users/administrator/Desktop/2015.12.01.yaml' -udanny:password

Server side ( Django REST Framework )

in your, add the following lines

For, you can refer to this example as below:

class UploadAction(APIView):
    permission_classes = (IsAuthenticated, IsAdminOrReadOnly)
    parser_classes = (MultiPa…

[Virtual Switching] What are macvlan and macvtap?

I excerpt the content of the following URL about what macvlan and macvtap are for reference quickly.

VLAN using not 802.1Q tag butmac address
    • 4 types of mode
        • private
        • vepa
        • bridge
        • passthru
Using unicast filtering if supported, instead of promiscuous mode (except for passthru)
    • Unicast filtering allows

NIC to receive multiple mac addresses
    • Light weight bridge
    • No source learning
    • No STP
Only one uplink
Allow traffic between macvlans (via macvlan stack)

withKVM has three mode
tap-like macvlan variant
    • packet reception
        -> file read
    • filewrite
        -> packet transmission

Further reading:
Virtual networking: TUN/TAP, MacVLAN, and MacVTap

[GitHub] How to rebase your branch from upstream branch?

If you fork a copy (branch) from a repository and you want to rebase your branch with this upstream repository, you can refer to the following URLs or directly see the content below.

List the current configured remote repository for your fork. git remote -v# origin (fetch)# origin (push) Specify a new remote upstream repository that will be synced with the fork. git remote add upstream Verify the new upstream repository you've specified for your fork. git remote -v