Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
my $exclude_list_path_static = "/etc/ovznodes_backup_rsync_exclude_list.static";
my $exclude_list_path_dynamic = "/etc/ovznodes_backup_rsync_exclude_list.dynamic";
my $config_file_path = '/etc/ovznodes_backup_config';
# должна объявляться в конфиге
<VirtualHost 127.0.0.1:81>
DocumentRoot "/absolute/path/to/project/www"
DirectoryIndex index.php
ServerAdmin admin@example.com
ServerAlias test.dev
ErrorLog "/absolute/path/to/project/logs/apache-error.log"
CustomLog "/absolute/path/to/project/logs/apache-access.log" common
package main
import (
"fmt"
"github.com/moovweb/gokogiri"
"io/ioutil"
"net/http"
"net/url"
"time"
)
/**
* Return the value of any protected class variable.
*
* // Get the response parameters
* $params = $response->params;
*
* @param string variable name
* @return mixed
*/
public function __get($key)
@max107
max107 / sshd.go
Last active August 29, 2015 14:11 — forked from jpillora/sshd.go
// A simple SSH server providing bash sessions
//
// Server:
// cd my/new/dir/
// ssh-keygen -t rsa #generate server keypair
// go get -v .
// go run sshd.go
//
// Client:
// ssh foo@localhost -p 2022 #pass=bar
@max107
max107 / 1
Created February 4, 2015 13:25
1
Server Software:
Server Hostname: studio107.ru
Server Port: 80
Document Path: /
Document Length: 20083 bytes
Concurrency Level: 20
Time taken for tests: 4.745 seconds
Complete requests: 150
<?php
function main() {
$data = [1 => 1, 2 => 2, 3 => 3];
foreach($data as $key => $value) {
yield $key, $value;
}
}
foreach(main() as $key => $value) {
@max107
max107 / cn_tw_korea
Created March 17, 2015 13:39
CN, TW, KOREA ip list
1.0.1.0/24
1.0.2.0/23
1.0.8.0/21
1.0.32.0/19
1.1.0.0/24
1.1.2.0/23
1.1.4.0/22
1.1.8.0/21
1.1.16.0/20
1.1.32.0/19
@max107
max107 / del.js
Created March 30, 2015 09:41
Delete all wall posts from
var h = document.getElementsByClassName("post_actions");
var i = 0;
function del_wall() {
var fn_str = h[i].getElementsByTagName("div")[0].onclick.toString();
var fn_arr_1 = fn_str.split("{");
var fn_arr_2 = fn_arr_1[1].split(";");
eval(fn_arr_2[0]);
if (i == h.length) {
clearInterval(int_id)
@max107
max107 / main_window.py
Created April 28, 2015 15:53
Modified files
# -*- coding: utf-8 -*-
"""
This module contains the main window implementation.
"""
from __future__ import print_function
# from future.builtins import super
import mimetypes
import os