Skip to content

Instantly share code, notes, and snippets.

@ysarro
ysarro / PPPoE on FreeBSD
Created January 31, 2011 16:20
PPPoE on FreeBSD
/etc/ppp/ppp.conf
default:
set device PPPoE:<interface connected to modem>:<profile name>:
<profile name>:
set authname <pppoe username>
set authkey <pppoe password>
add default HISADDR
@mtigas
mtigas / gist:952344
Last active June 20, 2024 11:22
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@eightysteele
eightysteele / data.csv
Created August 27, 2011 01:05
Unicode DictReader and DictWriter
id name age
0 aaron 34
1 tina 36
2 noah ©
@csanz
csanz / encrypt_decrypt.js
Created August 30, 2011 16:06
Simple String Encryption & Decryption with Node.js
function encrypt(text){
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
function decrypt(text){
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq')
var dec = decipher.update(text,'hex','utf8')
@ties
ties / gist:1424374
Created December 2, 2011 18:51
pcap/dpkt example that dumps (some) http request headers
#!/usr/bin/env python
import dpkt, pcap, socket
from ipaddr import IPv4Address, IPv6Address
import syslog
class HTTPRequest():
def __init__(self, host, uri, ip = None, user_agent = None):
self.uri = uri
self.user_agent = user_agent
self.host = host
@bcse
bcse / scrdec18-VC8.exe
Created February 15, 2012 10:13
Windows Script Decoder 1.8 (Decoding JScript.Encoded)
@jayswan
jayswan / uncipher.py
Created February 27, 2012 23:58
Python: reverse Cisco type 7 passwords with input from file or stdin
"""
Uncipher Cisco type 7 ciphered passwords
Usage: python uncipher.py <pass> where <pass> is the text of the type 7 password
Example:
$ python uncipher.py 094F4F1D1A0403
catcat
"""
import fileinput
import sys
@revolunet
revolunet / xor.py
Created April 18, 2012 09:14
Simple python XOR encrypt/decrypt
#
# NB : this is not secure
# from http://code.activestate.com/recipes/266586-simple-xor-keyword-encryption/
# added base64 encoding for simple querystring :)
#
def xor_crypt_string(data, key='awesomepassword', encode=False, decode=False):
from itertools import izip, cycle
import base64
if decode:
@JaviSoto
JaviSoto / newJiraTask.py
Created May 5, 2012 02:41
Python script to create a task on Jira (You can use this with Alfred)
import sys
import webbrowser as wb
import simplejson as json
from restkit import Resource, BasicAuth, request
def createTask(server_base_url, user, password, project, task_summary):
auth = BasicAuth(user, password)
@baali
baali / dlAttachments.py
Created May 8, 2012 08:32
Python script to download all gmail attachments.
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail
# Make sure you have IMAP enabled in your gmail settings.
# Right now it won't download same file name twice even if their contents are different.
import email
import getpass, imaplib
import os
import sys
detach_dir = '.'