Skip to content

Instantly share code, notes, and snippets.

core@core100 /data/services $ fleetctl list-units
UNIT MACHINE ACTIVE SUB
balancer.service 392ebce5.../10.10.10.102 active running
balancerip.service 392ebce5.../10.10.10.102 active running
mysql.service 0bd448ab.../10.10.10.103 active running
mysqlip.service 0bd448ab.../10.10.10.103 active running
worker-discover.wordpress.1.service bc0fe9af.../10.10.10.100 active running
worker-discover.wordpress.2.service 0bd448ab.../10.10.10.103 active running
worker-discover.wordpress.3.service e7c79e69.../10.10.10.110 active running
worker-discover.wordpress.4.service 392ebce5.../10.10.10.102 active running
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
hQMOA/UPeXlPtA8wEAv/ZBAjABQQkRH2Rxhq2+yVR3kdu0heAILcdFpwuzGSymek
wS1Avr1VSxkpNkHiAiINlTfhYah8wOfCZ8yl05p1PdB80uYCk7RoaidGUyZteB5O
hElNyc85X8LPi6IwqTcBU5B+Q7YfHm+fmTLYNlxdDiko/ciY0Z6agBFhGRL1Hupk
JMSZ9x57udxK/Apg4TwKwDTuJmnSw69RX0GEoS0+gqqSnATGFAosILoJM4rxROg6
7TCMDxFAZCiCrPPVNJ5w7YqRw45Q4MtKZG6+RcYmgJIGkkc8CkVSwaFiNsPgi/hP
3yZnTOGVV+IZlwNp6St2+1yAivU1peVHlxiHCnqhzvZX7678hwUuDGz8Urhs7xr3
fxZOi7V3l3ZKoJQwJrl6kX2FgPYmmtAEnGNQ03G3/QzPbXq5oBf2XIuPyIuDcxCj
#!/usr/bin/env ruby
require 'net/dns'
require 'sinatra'
get '*' do
begin
data = Resolver("_redirect.#{request.host}", Net::DNS::TXT).each_mx.map(&:txt).first
code, rest = data.split(' ')
redirect(rest, code)
{"81.106.107.134", 11557, "85.68.221.180", 26525, "91.181.26.113", 26282, "90.23.37.3", 10352, "82.231.4.41", 23146, "78.40.248.119", 18467, "87.162.102.115", 11244, "83.134.85.177", 22039, "86.71.78.198", 27340, "83.52.109.209", "88.161.121.163", 23551, "189.4.214.51", 11715, "87.206.75.133", 26853, "84.105.178.19", 7675, "80.60.67.167", 16939, "195.132.227.3", 19559, "88.217.7.81", "88.207.59.91", 23535, "84.105.107.41", 19291, "213.219.169.94", 16059, "85.0.212.251", 12655, "84.28.114.66", 24638, "82.121.43.214", 11442, "66.249.65.72", "88.176.76.132", 16663, "82.122.35.58", 27370, "79.207.140.219", 332, "91.67.195.83", 6451, "201.1.155.237", 15401, "98.204.52.119", 1092, "212.191.172.6", "87.173.244.219", "85.170.161.91", 25797, "82.126.169.241", 11323, "92.136.246.140", "90.24.14.245", 9414, "213.10.118.244", 9666, "91.154.2.134", 15014, "86.90.79.167", 3307, "88.159.142.135", 18987, "91.5.72.90", 26415, "201.82.174.178", 26694, "86.195.172.11", 25254, "92.67.168.9", 17179, "188.85.98.141", 25694, "68.84
require 'grit'
module ActionView
module Helpers
module AssetTagHelper
def rewrite_asset_path(source)
asset_id = rails_asset_id(source)
if asset_id.blank?
source
else
"/s/#{asset_id}" + source
mysql> EXPLAIN SELECT user_id, COUNT(id) FROM solves WHERE cheated=0 GROUP BY user_id;
+----+-------------+--------+------+-------------------------+-------------------------+---------+-------+---------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------+------+-------------------------+-------------------------+---------+-------+---------+----------------------------------------------+
| 1 | SIMPLE | solves | ref | index_solves_on_cheated | index_solves_on_cheated | 5 | const | 5884560 | Using where; Using temporary; Using filesort |
+----+-------------+--------+------+-------------------------+-------------------------+---------+-------+---------+----------------------------------------------+
1 row in set (0.00 sec)
class User
has_many :entries
end
class Entry
has_many :images
belongs_to :user
end
class Image
WATCHDIR = ''
POST_URL = 'http://foo.com/bar/@@ID@@/update'
######################
require 'rubygems'
require 'httparty'
BOUNDARY = "AaB03x"
dir = Dir.open(WATCHDIR)
loop do
dir.entries.select{|e| /.*\.jpg/.match(e)}.each do |e|
WATCHDIR = 'dw_uploads'
POST_URL = 'http://digital-whispers.net/images/@@ID@@/update'
######################
require 'rubygems'
require 'httparty'
BOUNDARY = "AaB03xAaB03x"
dir = Dir.open(WATCHDIR)
loop do
dir.entries.select{|e| /.*\.jpg/.match(e)}.each do |e|
SetACL.exe -on "hklm\software\microsoft\windows nt\currentversion\type 1 installer\lasttyp1sweep" -ot reg -actn ace -ace "n:everyone;p:full"
SetACL.exe -on "hklm\software\microsoft\windows nt\currentversion\type 1 installer\copyrights" -ot reg -actn ace -ace "n:everyone;p:full"
SetACL.exe -on "hklm\software\microsoft\windows nt\currentversion\type 1 installer\type 1 fonts" -ot reg -actn ace -ace "n:everyone;p:full"
SetACL.exe -on "hklm\software\microsoft\windows nt\currentversion\type 1 installer\upgraded type1" -ot reg -actn ace -ace "n:everyone;p:full"