This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Double | |
book = double("book") | |
allow(book).to receive(:pages) | |
book.pages # => nil | |
expect(book).to have_received(:pages) | |
book.foo # exception | |
book = double("book") | |
expect(book).to receive(:pages) # will not raise an error if we call book.pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
from scapy.all import * | |
pygame.mixer.init() | |
pygame.mixer.music.load("ameno.wav") | |
playing = False | |
# while pygame.mixer.music.get_busy() == True: | |
# continue | |
def arp_display(pkt): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this one mails you the ip if it changes | |
T1=`curl -s icanhazip.com` | |
touch old_ip.dat | |
read T2 < old_ip.dat | |
if [ "$T1" = "$T2" ]; then | |
echo "`date` -- ipchange script -- IP is the same: $T1 - doing nothing " | tee -a /var/log/syslog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Get the IP address of the Raspberry Pi and connect to it through SSH. | |
echo "*************** CONNECT-PI ***************" | |
echo "* /!\ You must reboot the Raspberry Pi *" | |
echo "* now in order to make this script work. *" | |
echo "******************************************" | |
echo | |
echo -n "Getting MAC address... " |