Skip to content

Instantly share code, notes, and snippets.

@alexprivalov
alexprivalov / iptables.txt
Created June 9, 2019 07:29 — forked from mhils/iptables.txt
mitmproxy client ip spoofing
You currently suggest the following iptables rules:
# iptables -A PREROUTING -s {SOURCE} -p tcp -m tcp --dport 80 -j
REDIRECT --to-ports 8080
In order to utilize fully transparent mode, you also need:
# iptables -t mangle -N DIVERT
# iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
# ip tables -t mangle -A DIVERT -j MARK --set-mark 0x2/0x2 # your mark may vary
# iptables -t mangle -A DIVERT -j ACCEPT
# принудительная очистка висящих слоев, удаление остановленных контейнеров.
if docker images -f "dangling=true" | grep specific_img --quiet; then
docker rmi -f $(docker images -f "dangling=true" -q)
fi
#!/bin/bash
COMPANY_REGISTRY="hub.company_name.com"
set -e
script() {
[ "$#" -lt 3 ] && ( usage && exit 0 ) || main "$@"
}
function main {
docker run -d -p 5000:5000 --restart=always --name registry -v /docker_registry:/var/lib/registry -v /docker_registry/certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/fullchain.pem -e REGISTRY_HTTP_TLS_KEY=/certs/privkey.pem registry:2
curl -X GET https://hub.docker.company_name.com.ua:5000/v2/_catalog - общий список репозиториев
curl -X GET https://hub.docker.company_name.com.ua:5000/v2/repo1/mag324/tags/list - список образов для репозитория repo1
curl -X GET https://hub.docker.company_name.com.ua:5000/v2/repo2/mag351/tags/list - список образов для репозитория repo2
@alexprivalov
alexprivalov / t470s.md
Created February 3, 2018 13:35 — forked from okapies/t470s.md
Ubuntu 16.04 on ThinkPad T470s

This is a document describing how to install Ubuntu 16.04 LTS on ThinkPad T470s.

My Hardware

  • CPU: Intel Core i7-7600U (2.80GHz, 4MB cache)
  • Graphics: Intel HD Graphics 620
  • Display: 14” WQHD (2560 X 1440) IPS Non-Touch Anti-Glare
  • Memory: 24GB DDR4 2133 MHz (8GB Onboard + 16GB)
  • SSD: PCIe-NVMe 256G OPAL 2.0
  • Wireless: Intel Dual Band Wireless AC (2x2) 8265 Bluetooth 4.1
  • Fingerprint Reader
@alexprivalov
alexprivalov / latency.txt
Created January 5, 2018 08:57 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
DOCKER
docker run -t -i ubuntu /bin/bash
docker run -t -v /home/alex/local_work/SDK-16.4-work/:/broadcom_arm -i ubuntu /bin/bash
docker rm `docker ps -aq` - remove all stopped containers
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
docker start -a -i $container_id - run last commant in exited container
=========RUN stopped/exited container ===========
http://stackoverflow.com/a/39329138
Title : Revisiting Mac OS X Kernel Rootkits
Author : fG!
Date : April 18, 2014
|=----------------------------------------------------------------------------=|
|=----------------=[ Revisiting Mac OS X Kernel Rootkits ]=-------------------=|
|=----------------------------------------------------------------------------=|
|=------------------------=[ fG! <phrack@put.as> ]=---------------------------=|
|=----------------------------------------------------------------------------=|
/**
Handle multiple socket connections with select and fd_set on Linux
Silver Moon ( m00n.silv3r@gmail.com)
*/
#include <stdio.h>
#include <string.h> //strlen
#include <stdlib.h>
#include <errno.h>