Skip to content

Instantly share code, notes, and snippets.

View anoduck's full-sized avatar

Anoduck, The Anonymous Duck anoduck

View GitHub Profile
@anoduck
anoduck / infor on buesiness coarse
Created January 7, 2015 22:13
online business course info
Environment of Business - 436 - BUSA 2106 - A
Online course. See the message under the Online Courses heading in the Course Schedule for important information. The Professor will email students the syllabus three days before class begins. Contact the instructor at [email protected]. Students are not required to attend any instruction sessions on the Gordon State College campus. However, students are required to attend one meeting on campus in Barnesville to complete the Final Exam on a date TBA. If the student cannot attend the final exam session the student will have to obtain the Professor's permission to take the exam(s) on the same date at a testing center selected by the student and approved by the Gordon State faculty. Students are urged to be familiar with online course delivery, including Desire2Learn, before enrolling in this online course. Please view the Desire2Learn video located at www.gordonstate.edu/departments/computerservices/ georgiaview.asp. An optional technology orientation will be
@anoduck
anoduck / pf.conf
Created January 25, 2015 19:42
Configuration file for debian pf.conf
<IfModule mod_passenger.c>
PassengerRoot %ROOT
PassengerRuby %RUBY
</IfModule>
<VirtualHost *:80>
ServerName http://www.arthar.com
# !!! Be sure to point DocumentRoot to ‘public’!
DocumentRoot /var/www/phishing-frenzy/public
RailsEnv development
@anoduck
anoduck / .vimrc
Last active August 29, 2015 14:16 — forked from todb-r7/.vimrc
" If using Janus, then this should be .vimrc.after
" Technically this is really a gvimrc but who's counting.
set nocompatible
colorscheme slate
filetype plugin indent on
set hls
" Pretty standard Ruby default tab indentation
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab shiftround smarttab
@anoduck
anoduck / Dark editor
Created March 4, 2015 07:57
How to add the Dark Editor to any webpage. Via embeded XSS
<iframe src="http://darkeditor.altervista.org/"
width="290" height="450"></iframe>
@anoduck
anoduck / scrapy-thread-crawl
Created March 22, 2015 20:52
Snippet from from sniplr, use with scrapy
# When you run the Scrapy crawler from a program, the code blocks until the Scrapy crawler is finished. This is due to how Twisted (the underlying asynchronous network library) works. This prevents using the Scrapy crawler from scripts or other code.
#
# To circumvent this issue you can run the Scrapy crawler in a thread with this code.
#
# Keep in mind that this code is mainly for illustrative purposes and far from production ready.
#
# Also the code was only tested with Scrapy 0.8, and will probably need some adjustments for newer versions (since the core API isn't stable yet), but you get the idea.
"""
Code to run Scrapy crawler in a thread - works on Scrapy 0.8
@anoduck
anoduck / scrapy-upload-uber
Created March 22, 2015 20:54
Snippet for scrapy, upload file to server file from scrapy
# This is an example of file uploading using scrapy to a server that uses uberuploader.
# The spider logins to the page to make the upload, some webpages dont need to be logged in order to upload.
# IMPORTANT : You should increment DOWNLOAD_TIMEOUT in settings.py, but by the time this snippet was wrote isnt working fine. I recompile the whole scrapy changing the default of 3min.
# Observations about my snippet:
# Is possible this is not the best code, please comment corrections.
# This could or should be implemented in a downloader middleware or pipeline?
# Don't show uploading state.
# Mime message creating could or should be in other place.
class fileUploadSpider(CrawlSpider):
@anoduck
anoduck / scrapy-norevisit
Created March 22, 2015 20:57
Scrapy snippet that prevents one from revisting sites.
# This middleware can be used to avoid re-visiting already visited items, which can be useful for speeding up the scraping for projects with immutable items, ie. items that, once scraped, don't change.
from scrapy import log
from scrapy.http import Request
from scrapy.item import BaseItem
from scrapy.utils.request import request_fingerprint
from myproject.items import MyItem
class IgnoreVisitedItems(object):
@anoduck
anoduck / raise-spider
Created March 22, 2015 21:01
scrappy snippet on queing messages to the main messagfe sonsole.
# Required import statement for CloseSpider. Note: if intending to limit items, you can pass '--SET CLOSESPIDER_ITEMCOUNT=10' like so:
#
# scrapy crawl googledir --set CLOSESPIDER_ITEMCOUNT=10
from scrapy.exceptions import CloseSpider
raise CloseSpider('reason for closing')
# Snippet imported from snippets.scrapy.org (which no longer works)
@anoduck
anoduck / fb-dl.py
Last active November 3, 2015 17:58 — forked from zmwangx/fb-dl.py
#!/usr/bin/env python
############################### README ###############################
# External dependencies:
# * libmagic
# * python-dateutil
# * python-magic
# * requests
#
# The shell command call at the end was tested with GNU date from GNU
;;; pastels-on-dark-theme.el --- Pastels on Dark theme for Emacs 24
;; Author: Mats Persson
;; Maintainer: Shane Celis <shane (at) gnufoo (dot) org>
;; URL: http://gist.github.com/1906662
;; Version: 0.3
;; Keywords: theme, color
;;; Commentary: