Skip to content

Instantly share code, notes, and snippets.

View levlaz's full-sized avatar

Lev Lazinskiy levlaz

View GitHub Profile
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
@levlaz
levlaz / gist:a3d84f2eacaf52147ce0
Created June 1, 2015 16:25
Regenerate HostKeys
#!/bin/sh
### BEGIN INIT INFO
# Provides: ssh-host-keys
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Regenerates SSH host keys on first boot.
### END INIT INFO
KeepAlive Off
<IfModule mpm_prefork_module>
StartServers 16
MinSpareServers 48
MaxSpareServers 96
MaxClients 240
MaxRequestsPerChild 3000
</IfModule>
@levlaz
levlaz / getHash.py
Last active August 29, 2015 14:25
Gravatar Hash
# import code for encoding urls and generating md5 hashes
import urllib, hashlib
def get_url(email):
gravatar_url = "http://www.gravatar.com/avatar/" + hashlib.md5(email.lower()).hexdigest() + "?"
return gravatar_url
print get_url("[email protected]")
@levlaz
levlaz / Index File
Created August 16, 2015 04:15
Simple JS API using JQuery
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<script src="api.js"></script>
</body>
</html>
#include <iostream>
int main()
{
// << is an output operator that prints the message to STDOUT
// Writing endl to std ends the current line and flushes the buffer
// Prefix std:: referes to the std namespace and is used to avoid
// collision.
std::cout << "Enter two numners:" << std::endl;
int v1 = 0, v2 = 0;
@levlaz
levlaz / gist:6ebfeac20aa769defc72
Created November 24, 2015 00:45
Sample Markdown
# Top Level Heading
First Item
Second Item
Third Item
Regular Paragraph
You can also make [links](https://google.com) to all sorts of stuff. The best part is you can include code blocks to make it really shine.
run-test Tests.xctest (iphonesimulator9.0, iPhone 6, logic-test)
-[BicycleDataManagerTest testDoBicycleMeasurementScan]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2015-11-22 10:58:25.840 xctest[1732:7153] OSStatus error: [-25291] Security error has occurred.
2015-11-22 10:58:25.844 xctest[1732:7153] OSStatus error: [-25291] Security error has occurred.
2015-11-22 10:58:25.851 xctest[1732:7153] OSStatus error: [-25291] Security error has occurred.
2015-11-22 10:58:25.851 xctest[1732:7153] OSStatus error: [-25291] Security error has occurred.
2015-11-22 10:58:25.852 xctest[1732:7153] OSStatus error: [-25291] Security error has occurred.
<p>Dear {{ recipient }},</p>
<p> {{ user.username }} has shared a note with you from <a href="https://braindump.pw">braindump</a>!</p>
<hr>
<h1>{{ note.title }}</h1>
<br />
{{ note.body_html | safe }}