Skip to content

Instantly share code, notes, and snippets.

View marcostolosa's full-sized avatar
👽
Memento Mori.

Marcos 'Tr0p' Tolosa marcostolosa

👽
Memento Mori.
View GitHub Profile
@marcostolosa
marcostolosa / send-ip.sh
Created October 20, 2018 07:56
Receive an email when your IP changes
#!/bin/bash
ip_file=~/.ip
if [ ! -f "$ip_file" ]; then touch $ip_file; fi
last=$(cat "$ip_file")
current=$(dig +short myip.opendns.com @resolver1.opendns.com) || exit
if [ "$last" = "$current" ]; then exit; fi
mail -s "[IP from Everywhere]" <your_email>@server.com <<< "$current"

Keybase proof

I hereby claim:

  • I am marcostolosa on github.
  • I am marcostolosa (https://keybase.io/marcostolosa) on keybase.
  • I have a public key ASDVE7ivh7BXVlqX9tS7wzqu1mbWku58KlT-y34wvJ9Kywo

To claim this, I am signing this object:

@marcostolosa
marcostolosa / Vagrantfile
Created November 1, 2018 02:34
Offensive-Security Official Vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "offensive-security/kali-linux"
# Create a forwarded port
config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network. In VirtualBox, this is a Host-Only network
@marcostolosa
marcostolosa / kubectl-cheatsheet.md
Created November 2, 2018 18:15
KUBECTL CheatSheet
title reviewers content_template
kubectl Cheat Sheet
bgrant0607
erictune
krousey
clove
templates/concept
@marcostolosa
marcostolosa / ssh-cheatsheet.md
Created November 5, 2018 12:34
SSH Cheat-Sheet

SOCKS Proxy

Set up a SOCKS proxy on 127.0.0.1:1080 that lets you pivot through the remote host (10.0.0.1):

Command line:
ssh -D 127.0.0.1:1080 10.0.0.1
~/.ssh/config:
Host 10.0.0.1
DynamicForward 127.0.0.1:1080
@marcostolosa
marcostolosa / socat.md
Last active March 4, 2025 02:36
SOCAT Useful commands

To link serial port ttyS0 to another serial port: socat /dev/ttyS0,raw,echo=0,crnl /dev/ttyS1,raw,echo=0,crnl

To get time from time server: socat TCP:time.nist.gov:13 -

To forward local http port to remote http port: socat TCP-LISTEN:80,fork TCP:www.domain.org:80

@marcostolosa
marcostolosa / .htaccess
Created December 15, 2018 08:40
PageSpeed Module - mod_pagespeed .htaccess config
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
@marcostolosa
marcostolosa / git-update-fork.sh
Created January 7, 2019 16:01
How to upgrade a fork with changes from the original?
# How to upgrade a fork with changes from the original?
# Specify a new remote upstream repository that will be synced with the fork.
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
# Verify the new upstream repository you've specified for your fork.
# git remote -v
# origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
@marcostolosa
marcostolosa / Bin2ascii.py
Created January 9, 2019 19:44
Transform binary to text/ascii
import binascii, sys
n = int(sys.argv[1], 2)
f = binascii.unhexlify('%x' % n)
print f
@marcostolosa
marcostolosa / exif-read-coordenates.md
Last active January 14, 2019 19:11
How read coordinates
North or South Latitude East or West Longitude
North latitude West longitude
46, 11, 42,152 94, 5, 12,890

========================================

Google search: 46°11'42.152"N 94°5'12.890"W