Skip to content

Instantly share code, notes, and snippets.

# cat /etc/sockd.conf
logoutput: syslog /var/log/danted.log
internal: eth0 port = 8765
external: eth0
socksmethod: username
user.privileged: root
user.unprivileged: nobody
client pass {
@atatarn
atatarn / uhost.pl
Created February 8, 2018 15:04
Perl script to pass thru all domain's CNAMEs and find resulting IPs
#!/usr/bin/perl -w
use strict;
use Net::DNS;
if ($ARGV[0]) {
gptr_a($ARGV[0]);
} else {
die "Usage: $0 HOSTNAME\n";
}
@atatarn
atatarn / oauth.pl
Last active January 20, 2021 12:49
Google OpenIDConnect (OAuth 2.0 for Login) example with Mojolicious
use Mojolicious::Lite;
use Mojo::Util qw(url_escape b64_decode);
use Mojo::JSON qw(from_json);
# Sample Google OAuth2 user email application using Mojolicious
# Based on the idea of https://gist.github.com/throughnothing/3726907
# For more info see:
# https://developers.google.com/accounts/docs/OpenIDConnect
# https://developers.google.com/wallet/digital/docs/jwtdecoder
#
@atatarn
atatarn / domainSearch.sh
Last active August 29, 2015 14:04
Parse Apache.conf, find domainName from args and sudo into VirtualHost user
#!/usr/local/bin/bash
DOM="$1"
# Базовая логика вызовов sed
# sed -nE '/^START$/h;/^END$/{x;/^START.*\nFLAG 0(\n|$)/{p;x;p;x;};};/^START$/!{x;/^START/!x;/^START/{x;H;};};' filename
# Логика следующая:
# Если текущая строка START - сохраняем её в hold space (сбрасывая прежнее содержимое);
# Если текущая строка END - проверяем, если в hold space присутствует и START и FLAG 0,
# то печатаем hold space, печатаем текущую строку и "сбрасываем" hold space (для того чтоб не попасться на START-FLAG 0-END-END)
# Eсли текущая строка не STARТ и в hold space уже пристутствует START, то дописываем текущую строку к hold space#