Skip to content

Instantly share code, notes, and snippets.

@xnyhps
xnyhps / tor-prosody.py
Created August 26, 2015 11:32
Proof-of-concept script to create ephemeral XMPP servers with Prosody. Not very well tested, use at your own risk.
import stem.control
import time
import socket
import os
telnet = socket.create_connection(("localhost", 5582))
assert(telnet != None)
print(" * Connected to Prosody telnet interface.")
func replicate<C : ExtensibleCollectionType>(s:Int, x:C) -> C {
var ret : C = C()
for element in x {
for i in 1...s {
ret.append(element)
}
}
return ret
-(void)selectionDidChange:(NSNotification *)notification {
WebView *view = [notification object];
[view copy:self];
}
-(void)installPlugin {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(selectionDidChange:)
name:@"WebViewDidChangeSelectionNotification"
object:nil];
@xnyhps
xnyhps / gist:33f7de50cf91a70acf93
Created July 4, 2014 14:29
mod_onions: Install instructions on Debian
# Add the Prosody repository, because we want the latest version
echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list
wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add -
sudo apt-get update
# Install tor and prosody, and lua-bitop, which is required for mod_onions
sudo apt-get install prosody tor lua-bitop
# Prepare the directories where Tor will store the hidden service's private key

Keybase proof

I hereby claim:

  • I am xnyhps on github.
  • I am xnyhps (https://keybase.io/xnyhps) on keybase.
  • I have a public key whose fingerprint is 34C3 811C D22C 152D 20AD 0A74 3269 6F0C 5049 D537

To claim this, I am signing this object:

b3b067055a8f1ff86d5d34bd10540cf0fb42b8dd
{-# LANGUAGE OverloadedStrings #-}
import OpenSSL.Digest.ByteString
import OpenSSL.Digest (MessageDigest(..))
import Data.ByteString.Base64
import Data.ByteString (ByteString(..), unpack, append)
import Data.ByteString.Char8 (pack)
import Data.Char (ord)
import Data.IORef
import base58
import scrypt
import pycoin
from Crypto.Cipher import AES
from hashlib import sha256
import hashlib
import os, sys
from pycoin.ecdsa import generator_secp256k1, public_pair_for_secret_exponent
-----BEGIN CERTIFICATE-----
MIIHbTCCBlWgAwIBAgICCRkwDQYJKoZIhvcNAQEFBQAwgYwxCzAJBgNVBAYTAklM
MRYwFAYDVQQKEw1TdGFydENvbSBMdGQuMSswKQYDVQQLEyJTZWN1cmUgRGlnaXRh
bCBDZXJ0aWZpY2F0ZSBTaWduaW5nMTgwNgYDVQQDEy9TdGFydENvbSBDbGFzcyAz
IFByaW1hcnkgSW50ZXJtZWRpYXRlIFNlcnZlciBDQTAeFw0xMzAxMDQwODAzMjha
Fw0xNjAxMDQxMDMzMzhaMIGwMRkwFwYDVQQNExBHdTZEWVdsOHlQa0wyeVkzMQsw
CQYDVQQGEwJERTEaMBgGA1UECBQRQmFkZW4tV/xydHRlbWJlcmcxETAPBgNVBAcT
CEFpY2h3YWxkMRwwGgYDVQQKFBNKZW5zZW4gJiBLcuRtZXIgR2JSMRcwFQYDVQQD
Ew5pbS5mbG9zb2Z0LmJpejEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZmxvc29mdC5i
aXowggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDg9X9CUlwV4ItnXOet
/*** Initial Settings ***/
* {
margin: 0;
padding: 0;
font-weight: normal;
font-style: normal;
}
html {
font-size: 100%;