Skip to content

Instantly share code, notes, and snippets.

@vahaah
vahaah / le-renew-webroot
Created February 29, 2016 12:59 — forked from thisismitch/le-renew-webroot
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

import os
#путь до settings.py
PROJECT_DIR = os.path.dirname(os.path.realpath(__file__))
#функция которая поднимается на один уровень вверх до того места где находятся папки со статикой и медиа
def j(*args):
return os.path.join(PROJECT_DIR, '..', *args)
MEDIA_ROOT = j('media')
MEDIA_URL = '/media/'
#! /bin/bash
# Redmine
# Maintainer: @randx
# App Version: 2.3
### BEGIN INIT INFO
# Provides: redmine
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
@vahaah
vahaah / yourWheather.chunk
Created August 9, 2012 12:07
yourWheather.chunk
[[+icon]]<br>
[[+temp_c]]<br>
[[+condition]]<br>
[[+wind_condition]]<br>
[[+humidity]]
@vahaah
vahaah / yourWheather.php
Created August 9, 2012 11:40
yourWheather
<?php
if(!isset($city)){
$city="Moskow";
}
if(!isset($lang)){
$lang="ru";
}
$requestAddress = "http://www.google.com/ig/api?weather=$city&oe=utf8&hl=$lang";
$xml_str = file_get_contents($requestAddress,0);
$xml = new SimplexmlElement($xml_str);