systemd ssh SOCKS proxy

There is nothing to say, just example..

cat /etc/systemd/system/ssh-scocks-proxy.service
Description=Socks proxy via SSH

ExecStart=/usr/bin/ssh -NTC -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i -D

# Restart every >2 seconds to avoid StartLimitInterval failure



Linux memory usage per user


if [[ "$1" = "-h" || "$1" = "--help" ]]
        echo "Usage: $(basename $0) [user]"
        echo ""
        echo "  -h [--help] - shows this help"
        exit 0

if [[ -z $1 ]]
        for i in `ps -e -o user --no-header | sort | uniq`; do
                echo "$i: $(ps -u $i  -o rss --no-header | paste -sd+ -| bc)KB"
        echo "$1: $(ps -u $1  -o rss --no-header | paste -sd+ -| bc) KB"

bind9 log file Ubuntu

to forward log info from syslog to another file for bind9 server in Ubuntu you have to:

  1. add logging section in any name.conf* file:
    logging {
        channel bind_log {
        file "/var/log/named.log";
        print-time yes;
        print-category yes;
        print-severity yes;
        category default { bind_log;};
        category xfer-in { bind_log;};
        category xfer-out { bind_log;};
        category update { bind_log;};
        category security { bind_log;};
        category queries { bind_log;};
  2. update apparmor config by adding to file /etc/apparmor.d/usr.sbin.named
     /var/log/named.log rw, 
  3. apparmor_parser -r /etc/apparmor.d/usr.sbin.named
  4. service bind9 restart

git commands

  • add new user in gitolite:
    * cd /tmp/
    * git clone git@git-host:gitolite-admin
    where: git - git-user, git-host - address or hostname of server, gitolite-admin - repo name
    * ssh-keygen -t rsa
    .pub - keep on server side.
    * cp /some/where/ /tmp/gitolite-admin/keydir
    * git add keydir
    * git commit
    * git push
  • create new repositories:
    * update file: gitolite-admin/conf/gitolite.conf
    * git add .
    * git commit -a -m "some comment"
    * git push