from subprocess import Popen, PIPE
def copy_clipboard(msg):
''' Copy `msg` to the clipboard '''
with Popen(['xclip','-selection', 'clipboard'], stdin=PIPE) as pipe:
pipe.communicate(input=msg.encode('utf-8'))
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 | |
# sudo apt-get install ffmpeg | |
# if ffmpeg is not installed, install it | |
if ! [ -x "$(command -v ffmpeg)" ]; then | |
sudo apt-get install ffmpeg | |
fi | |
# if no arguments are given, print usage |
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/env ruby | |
require 'wwmd' | |
require 'example_mixins' | |
include WWMD | |
puts "Traversal Fuzzer made by Outlasted\n Greetz to .:TeaMp0isoN:." | |
opts = { :base_url => "http://www.example.com" } | |
page = Page.new(opts) | |
spider = page.spider ; | |
spider.set_ignore([ /logout/i, /login/i ]) ; | |
while (url = spider.next) ; |
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
# Define here the models for your spider middleware | |
# | |
# See documentation in: | |
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html | |
import sys | |
import time | |
import logging | |
from scrapy import signals | |
from scrapy.mail import MailSender | |
from scrapy.utils.project import get_project_settings |
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
package main | |
import ( | |
"net/http" | |
"os" | |
"bytes" | |
"path" | |
"path/filepath" | |
"mime/multipart" | |
"io" |
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
function uuid() { | |
var uuid = "", i, random; | |
for (i = 0; i < 32; i++) { | |
random = Math.random() * 16 | 0; | |
if (i == 8 || i == 12 || i == 16 || i == 20) { | |
uuid += "-" | |
} | |
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16); | |
} |
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 __future__ import print_function | |
import platform | |
import sys | |
import threading | |
import time | |
class UnsyncedBankAccount(object): | |
"""Bank account with no synchronization lock, prone to race condition.""" |
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
# How to convert IPv4 addresses between integer <=> dot-decimal notation | |
INTEGER = 1698212032 | |
DOT_DECIMAL = '192.168.56.101' | |
# [ 192, 168, 56, 101 ] | |
DOT_DECIMAL_PARTS = DOT_DECIMAL.split('.').map(&:to_i) | |
#################################### | |
# integer to dot-decimal |
In your command-line run the following commands:
brew doctor
brew update
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
function getRandomLatLng(map) { | |
var bounds = map.getBounds(), | |
southWest = bounds.getSouthWest(), | |
northEast = bounds.getNorthEast(), | |
lngSpan = northEast.lng - southWest.lng, | |
latSpan = northEast.lat - southWest.lat; | |
return new L.LatLng( | |
southWest.lat + latSpan * Math.random(), | |
southWest.lng + lngSpan * Math.random()); |
NewerOlder