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 | |
| ROCKSDB_VERSION=5.11.3 | |
| #Run as a root user | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root (with sudo command)" | |
| exit | |
| fi |
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
| /* | |
| MongoDB: Find by regular expression and run regex replace on results | |
| */ | |
| db.test.find({"url": { $regex: 'http:\/\/' }}).forEach(function(doc) { | |
| doc.url = doc.url.replace(/http:\/\/www\.url\.com/g, 'http://another.url.com'); | |
| db.test.save(doc); | |
| }); |
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
| #!/usr/bin/python2 | |
| """ | |
| Use scapy to modify packets going through your machine. | |
| Based on nfqueue to block packets in the kernel and pass them to scapy for validation | |
| """ | |
| import nfqueue | |
| from scapy.all import * | |
| import os |
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
| from selenium import webdriver | |
| driver = webdriver.Firefox() | |
| driver.get('https://www.facebook.com/') | |
| with open('jquery-1.9.1.min.js', 'r') as jquery_js: | |
| jquery = jquery_js.read() #read the jquery from a file | |
| driver.execute_script(jquery) #active the jquery lib | |
| driver.execute_script("$('#email').text('anhld')") |