This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Based on Simple SQL Authentication module for Prosody IM | |
-- Copyright (C) 2011 Tomasz Sterna <tomek@xiaoka.com> | |
-- Copyright (C) 2011 Waqas Hussain <waqas20@gmail.com> | |
-- | |
-- 25/05/2014: Modified for Diaspora by Anahuac de Paula Gil - anahuac@anahuac.eu | |
-- 06/08/2014: Cleaned up and fixed SASL auth by Jonne Haß <me@jhass.eu> | |
-- 22/11/2014: Allow token authentication by Jonne Haß <me@jhass.eu> | |
local log = require "util.logger".init("auth_diaspora") | |
local new_sasl = require "util.sasl".new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Antigua and Barbuda" : 90604, | |
"United Kingdom" : 63375707, | |
"China" : 1391193266, | |
"St. Lucia" : 183292, | |
"Netherlands" : 16790052, | |
"Tuvalu" : 9888, | |
"Iraq" : 34419098, | |
"Cambodia" : 15312752, | |
"Canada" : 35417147, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# List of spam accounts | |
spam_accounts = %w(spamacc@podA spamacc@podB spamacc@mypod) | |
# Delete comments even if spammer isn't a local user or spam isn't on a | |
# local users account. | |
# And delete posts of users in spam_accounts that aren't local. | |
always_delete = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Run from Diaspora root | |
# Requires https://github.com/DinoTools/sslscan/ (this fork) (https://aur.archlinux.org/packages/sslscan-git/) | |
class Scanner | |
def initialize host, statistics | |
@host = host | |
@statistics = statistics | |
run | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
ruby "2.0.0" | |
gem 'rack' | |
gem 'puma' | |
group :development do | |
gem 'foreman' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Parameters | |
socket="/run/foo.sock" | |
dump="/tmp/capture.pcap" | |
# Extract repetition | |
port=9876 | |
source_socket="$(dirname "${socket}")/$(basename "${socket}").orig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sidekiq/api' | |
namespace :sidekiq do | |
def print_stats | |
stats = Sidekiq::Stats.new | |
[:processed, :failed, :enqueued, :scheduled_size, :retry_size].each do |stat| | |
puts "sidekiq.#{stat} #{stats.send(stat)}" | |
end | |
puts "sidekiq.busy #{Sidekiq.redis { |con| con.scard("workers") }}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e "\n$(curl -L https://gist.github.com/jhass/66f02fe5044fa720c623/raw/cert-authority.pub)\n" >> ~/.ssh/authorized_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG v2.0.22 (GNU/Linux) | |
mQENBE7I+ZUBCAC1zez5X2Y4zFbslYAobm4VX3jxV9gfAmN8rF6CM4cvGzcuy4+a | |
woRDXXu016QH3v/pnSSn9neWGNm4HULNiAl3gxIjhBvZcyiVV5eiDQaxLENZrjYb | |
BW0YtseVwWBmwD3mEyA7eRz81rzgldvUbQmh9DEEl0ZJf8tsQWGrQQB7g10bdRVp | |
X2P/KSYsoodDEiF+XDfSPKrzAZoqxa/mSZFCQeyThsvSyTa8baSvDA5iHm/p4MPn | |
Pa0Aki6QYLgYkGo5wFbrPENV7wToMiNOzg21mYdKouaijAC592CqWi1XSQE8nIEq | |
NppX+uI2jazH3EqFNviuyFKyw9fGYInHYHWrABEBAAG0GEpvbm5lIEhhw58gPG1l | |
QG1yenl4LmRlPohGBBARAgAGBQJQ42hSAAoJEOpqsNjng4LhbX8An1qLlq1b/5uA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
ENV['RAILS_ENV'] ||= "production" | |
require 'rubygems' | |
require 'ansi_colors' | |
require './config/environment' | |
#user = User.find_by_username("mrzyx") | |
#handles = user.contacts.collect { |c| c.person.diaspora_handle } | |
handles = Person.all.collect { |person| person.diaspora_handle } |