Skip to content

Instantly share code, notes, and snippets.

View vimagick's full-sized avatar
🐰
🐰🐰🐰🐰🐰🐰🐰🐰🐰

K̶e̶v̶i̶n̶ vimagick

🐰
🐰🐰🐰🐰🐰🐰🐰🐰🐰
View GitHub Profile
fs = require('fs');
page = require('webpage').create();
url = 'http://stackoverflow.com/users/348785/kev';
cjf = '/Users/kev/cookies.txt';
function load_cookies(cjf){
f = fs.open(cjf, 'r');
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from twisted.internet import defer, reactor, task
from twisted.web.client import getPage
import json
import redis
import logging
ps = [
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from twisted.internet import defer, reactor, task
from twisted.web.client import getPage
from ipaddress import ip_address
import os
import csv
import json
import logging
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from libmproxy.flow import Response
from netlib.odict import ODictCaseless
from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
def start(ctx, argv):
#!/usr/bin/env python
# mitmproxy script to turn images upside down
def contains(x, y):
return any(y in i for i in x)
def request(content, flow):
hd = flow.request.headers
@vimagick
vimagick / gist:332100c8ab80d2ca6bd2
Created February 22, 2016 02:41
Use docker-machine to provision AlarmPi
~ $ docker-machine create -d generic --generic-ip-address 192.168.1.200 --generic-ssh-user root --generic-ssh-key ~/.ssh/id_rsa alarmpi
Running pre-create checks...
Creating machine...
(alarmpi) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with arch...
Copying certs to the local machine directory...
@vimagick
vimagick / imdb-top-250.tsv
Last active July 3, 2023 11:06
IMDB Top 250 (2023-07-03)
rank title year rate titleid
1 The Shawshank Redemption 1994 9.2 tt0111161
2 The Godfather 1972 9.2 tt0068646
3 The Dark Knight 2008 9.0 tt0468569
4 The Godfather Part II 1974 9.0 tt0071562
5 12 Angry Men 1957 9.0 tt0050083
6 Schindler's List 1993 8.9 tt0108052
7 The Lord of the Rings: The Return of the King 2003 8.9 tt0167260
8 Pulp Fiction 1994 8.8 tt0110912
9 The Lord of the Rings: The Fellowship of the Ring 2001 8.8 tt0120737
#!/bin/bash
ufw status | awk '/telegram/ && /DENY FWD/{print $1}' | xargs -rt -n1 -I{} ufw route delete deny to {}
ufw status | awk '/telegram/ && /DENY OUT/{print $1}' | xargs -rt -n1 -I{} ufw rule delete deny out to {}
curl -s https://core.telegram.org/resources/cidr.txt | grep -v :: | xargs -rt -n1 -I{} ufw route insert 1 deny to {} comment telegram
curl -s https://core.telegram.org/resources/cidr.txt | grep -v :: | xargs -rt -n1 -I{} ufw rule insert 1 deny out to {} comment telegram
#/bin/bash
#
# Device Listing in Linksys Smart Wi-Fi
#
IPADDR=x.x.x.x
PASSWD=********
ACTION=devicelist/GetDevices
curl -s -H 'Content-Type: application/json' -H "X-JNAP-Authorization: Basic $(echo -n "admin:$PASSWD" | base64)" -H "X-JNAP-Action: http://linksys.com/jnap/$ACTION" http://$IPADDR/JNAP/ -d '{}' |