Skip to content

Instantly share code, notes, and snippets.

View VonStruddle's full-sized avatar
🕶️
Doing stuff on the interwebs

Quentin Durantay VonStruddle

🕶️
Doing stuff on the interwebs
View GitHub Profile

How to create a fake wireless access point

Equipment

  1. Raspberry Pi 3
  2. An Ethernet connection that will need during the installation

Intructions

You need to assign users an IP Address when they connect to our network. Hostapd is a user space daemon for wireless access point and authentication servers and DNSMasq is used as our DNS server. To install these programs, run the following command:

@sladkovm
sladkovm / dospaces.py
Created April 21, 2018 09:20
Getting started with Digital Ocean Spaces using python and boto3
import boto3
import os
import json
client = boto3.client('s3',
region_name=os.getenv('DO_SPACES_REGION'),
endpoint_url='https://{}.digitaloceanspaces.com'.format(os.getenv('DO_SPACES_REGION')),
aws_access_key_id=os.getenv('DO_SPACES_KEY'),
aws_secret_access_key=os.getenv('DO_SPACES_SECRET'))
@matt-e-king
matt-e-king / gtmPlugin.js
Last active November 12, 2022 19:47
Vuex plugin for VueGtm (Google Tag Manager) (https://github.com/mib200/vue-gtm)
/**
Using the Vuex plugin pattern: https://vuex.vuejs.org/en/plugins.html,
this plugin will fire off a gtm.trackEvent for each mutation that occurs within your app.
It will also do a lookup on a literal object methods named after your mutation types. From those methods,
return a object with looks up on the store.
*/
import Vue from 'vue'
// import mutation-types, see example:
/**
@dillansimmons
dillansimmons / firstTouchUTMCookie.js
Created October 25, 2016 19:29
Store first touch utm in cookie and input into hidden field (Cookie.js, JQuery)
// Initiate JQUERY
// Initiate cookie.js : https://github.com/js-cookie/js-cookie
// Parse the URL
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Give the URL parameters variable names
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@evandrix
evandrix / README.md
Created September 11, 2012 00:06
Headless web browsers

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@jacobian
jacobian / models.py
Created February 15, 2011 18:11
An example of using many-to-many "through" to augment m2m relationships. See http://www.quora.com/How-do-you-query-with-a-condition-on-a-ManyToMany-model-in-Django for context.
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
groups = models.ManyToManyField('Group', through='GroupMember', related_name='people')
class Meta:
ordering = ['name']
def __unicode__(self):