Skip to content

Instantly share code, notes, and snippets.

View ybur-yug's full-sized avatar

yburyug ybur-yug

View GitHub Profile
#!/bin/sh
# Reboot netgear CM400 cablemodem via curl
curl -s -u admin:password 'http://192.168.100.1'$(curl -s -u admin:password http://192.168.100.1/RouterStatus.htm | grep id=[0-9] | cut -d'"' -f2) --data 'buttonSelect=2&wantype=dhcp&enable_apmode=0' > /dev/null
@ybur-yug
ybur-yug / bot_protector.rb
Created May 2, 2017 23:44 — forked from Oshuma/bot_protector.rb
Rack middleware to fuck with bot requests.
module NerdNode
# Rack app to reject common bot attacks. Returns a random HTTP status and content type, along with some LOLs.
#
# Usage:
# use NerdNode::BotProtector, /phpmyadmin\/scripts|mysql\/scripts/
#
# # ...or use the Regexp helper which takes an array of URL strings...
# blacklist = BotProtector.build_regex(['phpmyadmin/scripts', 'mysql/scripts'])
# use NerdNode::BotProtector, blacklist
#
@ybur-yug
ybur-yug / spin.rb
Created June 27, 2016 05:03 — forked from JoshCheek/spin.rb
Spinning words in the console
# https://twitter.com/josh_cheek/status/747207002443546624
require "io/console"
text = ARGV.join(" ").split(/\b/).flat_map.with_index(0) do |word, index|
word.chars.map { |char| "\e[9#{index%7+1}m#{char}" }
end + (" "*10).chars
include Math
print "\e[H\e[2J\e[?25l"
at_exit { print "\e[#{$stdout.winsize[0]-2}H\e[A\e[?25h" }
radius = text.length / 2 / PI
@ybur-yug
ybur-yug / servo4noobs.md
Created October 16, 2015 16:05 — forked from paulrouget/servo4noobs.md
Hacking Servo For Noobs
require 'digest/sha1'
require 'zlib'
require 'pp'
module Git
OBJECTS = {}
class Object

Experimental Generation of Interpersonal Closeness

Instructions to Subjects Included With Task Slips Packet

This is a study of interpersonal closeness, and your task, which we think will be quite enjoyable, is simply to get close to your partner. We believe that the best way for you to get close to your partner is for you to share with them and for them to share with you. Of course, when we advise you about getting close to your partner, we are giving advice regarding your behavior in this demonstration only, we are not advising you about your behavior outside of this demonstration.

In order to help you get close we've arranged for the two of you to engage in a kind of sharing game. You're sharing time will be for about one hour, after which time we ask you to fill out a questionnaire concerning your experience of getting close to your partner.

You have been given three sets of slips. Each slip has a question or a task written on it. As soon as you both finish reading these instructions, you should