import json
from django.views.generic import View
from django.http import HttpResponse
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import Q
from django.core.serializers.json import DjangoJSONEncoder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
USERNAME="$1" | |
PASS="$2" | |
for f in *.ovpn | |
do | |
name=`basename -s .ovpn $f`; | |
nmcli connection import type openvpn file $f | |
nmcli connection modify "${name}" +vpn.data connection-type=password-tls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @Author: xiewenqian <int> | |
# @Date: 2016-11-28T20:35:09+08:00 | |
# @Email: [email protected] | |
# @Last modified by: int | |
# @Last modified time: 2016-12-01T19:32:48+08:00 | |
import pandas as pd | |
from pymongo import MongoClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
You should try libtorrent (rasterbar). http://libtorrent.org | |
If you want to write your client in python, on linux, install it with: | |
sudo apt-get install python-libtorrent | |
A very simple example of python code to use it to download a torrent: | |
''' | |
import libtorrent as lt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2017 Mohsen Mesgarpour | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "custom_base.html" %} | |
{% block content %} | |
<form id="defaults" > | |
<input name="csrfmiddlewaretoken" type="hidden" value="{{ csrf_token }}"> | |
</form> | |
<table> | |
{% for row in items %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A(models.Model): | |
things = models.ManyToManyField("B", through=ThroughModel) | |
class B(models.Model): | |
text = models.TextField() | |
class ThroughModel(models.Model): | |
a = models.ForeignKey(A) | |
b = models.ForeignKey(B) | |
extra = models.BooleanField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logger = logging.getLogger(__name__) | |
# Note: we need dnspython for this to work | |
# Install with `pip install dnspython` | |
import dns.resolver, dns.exception | |
from django import forms | |
from django.utils.translation import ugettext as _ |
Source to download: link
1. Open Terminal Ctrl+Alt+T
Download Firefox Developer Edition tar file
NewerOlder