- Copy symbols between <ca> tags into ca.crt, remove <ca> tags.
- Copy symbols between <cert> from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE----- tags into client.crt, remove <cert> tags.
- Copy symbols between <key> tags into client.key, remove <key> tags.
- Copy symbols between <tls-auth> tags into ta.key, remove <tls-auth> tags.
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 python | |
#encoding: utf-8 | |
# Copyright (C) 2013 @XiErCh | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
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
############################################################################### | |
# rpi-cat9532.py | |
# | |
# Author: electronut.in | |
# | |
# Description: | |
# | |
# Raspberry Pi communicating with I2C PWM chip CAT9532 | |
# (16-bit Programmable LED Dimmer) | |
# |
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
{% for article in articles %} | |
{% if forloop.first %}<div class="row">{% endif %} | |
<div class="col-xs-4"> | |
<a href="#"> {{ sub_article.name }} </a> | |
</div> | |
{% if forloop.counter|divisibleby:3 %}</div><div class="row">{% endif %} | |
{% if forloop.last %}</div>{% endif %} |
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
{% if page_obj.has_other_pages %} | |
<div class="row justify-content-md-center"> | |
<nav aria-label="Page navigation example"> | |
<ul class="pagination justify-content-center"> | |
<!-- Older page --> | |
{% if page_obj.has_previous %} | |
<li class="page-item"> | |
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">Назад</a> | |
</li> | |
{% else %} |
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 time | |
class StatsMiddleware(object): | |
''' | |
MIDDLEWARE_CLASSES = ( | |
'project.stats_middleware.StatsMiddleware', | |
'django.contrib.sessions.middleware.SessionMiddleware', | |
... | |
) |
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 ctypes | |
import struct | |
def get_uptime(): | |
libc = ctypes.CDLL('libc.so.6') | |
buf = ctypes.create_string_buffer(4096) # generous buffer to hold struct sysinfo | |
if libc.sysinfo(buf) != 0: | |
print('failed') | |
return -1 |
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 csv | |
import json | |
f = open('./csv/data.csv', 'rU') | |
reader = csv.DictReader(f, fieldnames=('id', 'name')) | |
out = json.dumps([row for row in reader]) | |
f=open('./output1.json', 'w+') | |
f.write(out) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Vertical menu</title> | |
</head> | |
<body> | |
<ul class="main-menu"> | |
<li><a href="#">Index</a></li> | |
<li class="active"><a href="#">Demo</a></li> |
OlderNewer