Skip to content

Instantly share code, notes, and snippets.

View nogweii's full-sized avatar
🍀

Nogweii nogweii

🍀
View GitHub Profile
@nogweii
nogweii / README.md
Last active November 10, 2017 00:55
Private cloud, a description

So, a private cloud.

What to include in said cloud?

Well, let's start with another cloud, [Sovereign][]:

  • IMAP over SSL via Dovecot, complete with full text search provided by Solr.
  • POP3 over SSL, also via Dovecot
  • SMTP over SSL via Postfix, including a nice set of DNSBLs to discard spam before it ever hits your filters.
@nogweii
nogweii / hipchat_hooks.rb
Created March 6, 2014 00:26
A script to set up HipChat hooks on every repository in an organization
#!/usr/bin/ruby
# Script to set up HipChat on every repository in an Organization.
# Is idempotent -- doesn't make a hook if there already is a HipChat
# notification set up.
require 'octokit'
## Settings
# What organization should we set up?
@nogweii
nogweii / plugin.rb
Last active August 29, 2015 13:57
steam login plugin for discourse
# name: discourse-steam
# about: VALVE's Steam login support for Discourse
# version: 0.0.1
# authors: Colin Shea
auth_provider :title => 'with Steam',
:authenticator => Auth::OpenIdAuthenticator.new('steam','http://steamcommunity.com/openid', trusted: true),
:message => 'Authenticating with Steam (make sure pop up blockers are not enabled)',
:frame_width => 1000, # the frame size used for the pop up window, overrides default
:frame_height => 800
jp2a picture.jpg --colors --invert | head -n20 | sed 's/\^[\[37m \^[\[0m/ /g' > picture.ansi
@nogweii
nogweii / module_methods.rb
Last active August 29, 2015 13:56
Example module code for #ruby on Freenode
module MyBase
def big_function
@_memoized_big_function ||= begin
load_lots_of_data(SettingsManager.foo_bar)
end
end
module_method :big_function
public :big_function
end
@nogweii
nogweii / gist:8278021
Last active November 25, 2017 06:34
PageKite configuration for running your own front-end (broken, sorta)
# /etc/pagekite/20_frontend.rc on kites.evaryont.me
# Front-end selection
#
# Front-ends accept incoming requests on your behalf and forward them to
# your PageKite, which in turn forwards them to the actual server.
# Running my own front-end!
isfrontend
@nogweii
nogweii / pianobar_opensuse_compile.sh
Created December 4, 2013 18:17
what dependencies to install to compile pianobar on OpenSUSE 13.1 & how to make it
sudo zypper install libjson-devel libgcrypt-devel
sudo zypper install libgnutls-devel
# Requires the PackMan repo https://forums.opensuse.org/blogs/caf4926/opensuse-13-1-multi-media-restricted-format-installation-guide-149/
sudo zypper install libmad-devel
sudo zypper install faad2 libfaad-devel
sudo zypper install libao-devel
# Making sure the output driver is pulseaudio
#cat /etc/libao.conf
@nogweii
nogweii / gist:7761427
Created December 3, 2013 00:02
Automatically install -debuginfo packages for all installed packages in OpenSUSE (tested on 13.1)
#!/bin/sh
zypper packages -i 2>/dev/null | cut -d'|' -f3 | sort -u | sed -n 's/^ \([a-z0-9-]*\)\s\+/\1-debuginfo/p' | xargs zypper search -u -t package | cut -d'|' -f2 | sed -n 's/^\s//;s/\s\+$//gp' | tail -n+2 | xargs sudo zypper install
@nogweii
nogweii / predictable_cute_hostname.rb
Created October 15, 2013 08:58
Use Frosty Meadow to generate a 'random' name for the server, but first seed Ruby's random with the contents of machine-id. Assumes that /etc/machine-id is valid and exists, and that it contains only hexadecimal numbers. Modify the source to any other source of predictable, guessable machine information. Like the MAC address or similar.
require 'frosty_meadow'
# Use [Frosty Meadow](https://github.com/andyhmltn/frosty-meadow) to generate a
# 'random' name for the server, but first seed Ruby's random with the contents
# of machine-id.
#
# Assumes that /etc/machine-id is valid and exists, and that it contains only
# hexadecimal numbers. Modify the source to any other source of predictable,
# guessable machine information. Like the MAC address or similar.
@nogweii
nogweii / Test.java
Created October 1, 2013 23:39
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");