Skip to content

Instantly share code, notes, and snippets.

@mortymacs
mortymacs / signals.creole
Last active July 22, 2017 05:57 — forked from synther/gist:d376100a8bae896d0caf
linux signals cheat sheet
Signal Value Action Comment
SIGHUP 1 Term Hangup detected on controlling terminal or death of controlling process
SIGINT 2 Term Interrupt from keyboard
SIGQUIT 3 Core Quit from keyboard
SIGILL 4 Core Illegal Instruction
SIGABRT 6 Core Abort signal from abort(3)
SIGFPE 8 Core Floating point exception
SIGKILL 9 Term Kill signal
SIGSEGV 11 Core Invalid memory reference
SIGPIPE 13 Term Broken pipe: write to pipe with no readers
@mortymacs
mortymacs / .bashrc
Last active August 31, 2017 06:27
My bashrc
export EDITOR="vim"
alias ls='ls --color=auto'
alias v="vim"
alias e="emacs -nw"
alias p="ping 8.8.8.8"
alias i="irssi"
alias t="tmux"
alias whereiam='echo $(curl -s http://ip-api.com/json | jq -r ".country,.city")'
alias chromium-browser-proxy='chromium --proxy-server=127.0.0.1:8118'
alias x="export http_proxy='127.0.0.1:8118'"
@mortymacs
mortymacs / config.yml
Created July 18, 2017 17:37
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@mortymacs
mortymacs / manual.md
Created July 19, 2017 19:57
Set Proxy On Docker Service in Linux
  • First install tor and privoxy and config them.
  • Create a file in this directory with below config: touch /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=127.0.0.1:8118"
@mortymacs
mortymacs / http_get.go
Created July 29, 2017 10:30 — forked from ijt/http_get.go
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@mortymacs
mortymacs / apt_get-config.md
Last active August 1, 2017 06:27
Config Proxy for "apt-get" by Tor and Privoxy

Tor

Install Tor

$ apt-get install tor

Make sure Tor connected (100%) successfully:

$ tail -f /var/log/tor/log
@mortymacs
mortymacs / docker-config.md
Last active May 17, 2019 05:26
Config Proxy for Docker by Tor and Privoxy

Tor

Install Tor

$ apt-get install tor

Make sure Tor connected (100%) successfully:

$ tail -f /var/log/tor/log
@mortymacs
mortymacs / vbox-cli-manual.md
Last active February 21, 2018 07:40
VirtualBox Useful Commands

Create vm

VBoxManage createvm --name "Debian 9" --register

Modify vm

VBoxManage modifyvm "Debian 9" --memory 1024
@mortymacs
mortymacs / rabbitmq-commands.md
Created August 2, 2017 07:29
RabbitMQ Useful Commands

List of queue:

rabbitmqadmin list queues

Create a queue:

rabbitmqadmin declare queue --vhost=/ name=my_queue

Publish message to queue:

@mortymacs
mortymacs / send-read-message.md
Last active April 10, 2019 01:44
Send and Read Message in a Python Process Via stdin in GNU/Linux

To read message from stdin try this sample code:

import time
import sys

while True:
    for i in sys.stdin:
        print(i)
    time.sleep(2)