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 / 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 / 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.

# Работает - файл обновляется
* * * * * 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 / add-task.bat
Created March 29, 2015 17:29
Windows VPN auto routes
schtasks /create /F /RL HIGHEST /TN "Маршруты для VPN" /TR "C:\vpnroutes.bat /connect" /SC ONEVENT /EC System /MO "*[System[Provider[@Name='Rasman'] and (Level=4 or Level=0) and (EventID=20267)]] and *[EventData[Data='My VPN Connection']]"
@soar
soar / ssh-copy-id.ps1
Created March 29, 2015 16:35
ssh-copy-id for windows
# ssh-copy-id analog for Windows systems
# Script to install your public key on a remote machine
# The remote machine must accept password authentication,
# or one of the other keys in your Putty Agent, for this to work.
#
# (c) soar - http://soar.name
# Dialog for public key selection
Function Select-File()
{
@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 / 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 / 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 будет сохранен в той же директории."