Skip to content

Instantly share code, notes, and snippets.

View amerov's full-sized avatar
🏠
Working from home

Marat Amerov amerov

🏠
Working from home
View GitHub Profile
@amerov
amerov / keyboardcapture.go
Created October 3, 2019 20:41 — forked from jordansissel/keyboardcapture.go
go lang keyboard capture
package main
import (
"fmt"
"syscall"
//~ "time"
"unsafe"
"golang.org/x/sys/windows"
)
@amerov
amerov / sclg4.c
Created June 28, 2017 19:39 — forked from aktau/sclg4.c
A simple WinAPI GetAsyncKeyState()-based keylogger, written a very long time ago. I dug it out of the archives because of a Hacker News post (https://news.ycombinator.com/item?id=7607082). For educational purposes only, of course.
/**
* Copyright (c) 2006, Nicolas Hillegeer
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the

This is a sequel to "Postfix: relay to authenticated SMTP".

I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.

As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):

/etc/postfix/main.cf:
    # sender-dependent sasl authentication
    smtp_sender_dependent_authentication = yes

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

@amerov
amerov / gist:08b4329745a98bc7e797
Created May 11, 2014 14:08
jetbrains stop working keyboard on ubuntu
echo "actionSystem.suspendFocusTransferIfApplicationInactive=false" >> jetbrains_app/bin/idea.properties
echo "export XMODIFIERS=\"\"" >> jetbrains_app/bin/rubymine.sh
@amerov
amerov / Preferences.sublime-settings
Last active August 29, 2015 13:57
Sublime Conf
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"fallback_encoding": "Cyrilyc (Windows 1251)",
"fade_fold_buttons": false,
"font_size": 11,
"highlight_line": true,
"highlight_modified_tabs": true,
"soda_classic_tabs": true,
"theme": "Soda Dark.sublime-theme",
@amerov
amerov / gist:8895373
Last active August 29, 2015 13:56
generate ctags for rails project
ctags -e --exclude=.git --exclude='*.log' -R * `bundle show --paths; pwd`
ctags -R --exclude=.git --exclude=log --exclude=tmp --exclude=autotest --exclude=db -f .tags * ~/.rvm/gems/`rvm current`
@amerov
amerov / .emacs
Last active August 29, 2015 13:55
emacs configuration
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(put 'set-goal-column 'disabled nil)
(setq auto-save-default nil)
(setq auto-save-list-file-name nil)
(global-linum-mode t)
(ido-mode t)