This guide now lives at https://github.com/joyeusenoelle/GuideToMastodon/ - please check there for updates, and feel free to submit a PR if you have suggestions or want to submit a translation!
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
# Validates that MX record exists for domain to prevent typos and also block by MX servers | |
# Use by adding to app/models/user.rb | |
# validates_with EmailMXValidator, if: :email_changed? | |
# frozen_string_literal: true | |
require 'resolv' | |
class EmailMXValidator < ActiveModel::Validator | |
def validate(user) | |
domain = user.email.split('@', 2).last | |
mxs = Resolv::DNS.new.getresources(domain, Resolv::DNS::Resource::IN::MX).to_a.map { |e| e.exchange.to_s } |
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/sh /etc/rc.common | |
START=98 | |
USE_PROCD=1 | |
NAME=iface-colors | |
PROG=/root/iface-colors | |
start_service() { | |
procd_open_instance |
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
protocol ospf dn42 | |
{ | |
table vm; | |
instance id 1; | |
export all; | |
import all; | |
area 0 | |
{ | |
interface "dn42" | |
{ |
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/sh | |
modprobe vfio-pci | |
for dev in "$@"; do | |
echo Handling device "$dev" | |
devpath="/sys/bus/pci/devices/$dev" | |
if ! [ -d $devpath ]; then | |
echo "$devpath doesn't exist" | |
exit 1 | |
fi | |
if [ -L $devpath/driver/module ]; then |
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
// General | |
sensitivity 1.15 // 1200 DPI | |
zoom_sensitivity_ratio_mouse 1 | |
cl_autowepswitch 0 | |
cl_disablehtmlmotd 1 | |
net_graph 1 | |
net_graphpos 3 | |
net_graphproportionalfont 0 | |
viewmodel_offset_y 2 |
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/perl | |
use strict; | |
use warnings; | |
my @dmesg_new = (); | |
my $dmesg = "/bin/dmesg"; | |
my @dmesg_old = `$dmesg`; | |
my $now = time(); | |
my $uptime = `cat /proc/uptime | cut -d"." -f1`; |
Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.
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 | |
# | |
# rotate_desktop.sh | |
# | |
# Rotates modern Linux desktop screen and input devices to match. Handy for | |
# convertible notebooks. Call this script from panel launchers, keyboard | |
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.). | |
# | |
# Using transformation matrix bits taken from: | |
# https://wiki.ubuntu.com/X/InputCoordinateTransformation |
NewerOlder