Skip to content

Instantly share code, notes, and snippets.

View mancubus77's full-sized avatar
🇦🇺

Mancubus mancubus77

🇦🇺
  • Just a small software company
  • Ku-ring-gai
View GitHub Profile
@mancubus77
mancubus77 / gist:1ef66501fbac7a5f3621efb411a6771f
Created February 17, 2017 23:07 — forked from firedfox/gist:2037945
find google ads with phantomjs
var page = require('webpage').create();
page.settings.loadImages = false;
page.onConsoleMessage = function(msg) { console.log(msg); };
page.onLoadFinished = function() {
page.evaluate(function() {
var getFrames = function(doc) {
var frames = doc.querySelectorAll('iframe');
for (var i = frames.length - 1; i >= 0; i--) {
var fdoc = frames[i].contentWindow.document;
@mancubus77
mancubus77 / gist:7a33de945ff9c6143ba703d55b148618
Created March 26, 2017 10:52
enable login with password in UEC ubuntu image
# Epitome
I want to have os image that can login with password.
download UEC image.
for example, this precise.
http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img
this image was forbidden to password login feature in terminal console.
it's reasonable for use of cloud image.

This is an example of using Linux Kernel's Transparent Proxy to route all TCP traffic to docker containers without having to resort to PROXY protocol which is not supported by some applications (e.g. sshd). To get the demo to work you only need vagrant installed:

git clone [this-gist] tproxy-demo
cd tproxy-demo
vagrant up
@mancubus77
mancubus77 / README
Created May 9, 2017 00:56 — forked from adilapapaya/README
Export Table Data to CSV using Javascript
Example code for exporting data in a table to a csv file.
@mancubus77
mancubus77 / elasticsearch-cheatsheet.txt
Last active July 29, 2017 07:39 — forked from stephen-puiszis/elasticsearch-cheatsheet.txt
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# Bulk actions:
# Delete all indexes via pattern
for index in $(curl -XGET esmaster:9200/_cat/indices | awk ‘/pattern/ {print $3}’); do curl -XDELETE esmaster:9200/$index?master_timeout=120s; done
# cat paths
/_cat/allocation
KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
@mancubus77
mancubus77 / tcp_flags.txt
Created November 10, 2017 00:55 — forked from tuxfight3r/tcp_flags.txt
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
8.2.3. HTTP log format
----------------------
The HTTP format is the most complete and the best suited for HTTP proxies. It
is enabled by when "option httplog" is specified in the frontend. It provides
the same level of information as the TCP format with additional features which
are specific to the HTTP protocol. Just like the TCP format, the log is usually
emitted at the end of the session, unless "option logasap" is specified, which
generally only makes sense for download sites. A session which matches the
"monitor" rules will never logged. It is also possible not to log sessions for
@mancubus77
mancubus77 / gist:3f6eff5ab5b1b0ae20d8e8fca8d4f9da
Last active May 26, 2021 20:56
HAProxy TCP log format (1.7)
8.2.2. TCP log format
---------------------
The TCP format is used when "option tcplog" is specified in the frontend, and
is the recommended format for pure TCP proxies. It provides a lot of precious
information for troubleshooting. Since this format includes timers and byte
counts, the log is normally emitted at the end of the session. It can be
emitted earlier if "option logasap" is specified, which makes sense in most
environments with long sessions such as remote terminals. Sessions which match
the "monitor" rules are never logged. It is also possible not to emit logs for