Skip to content

Instantly share code, notes, and snippets.

View sumskyi's full-sized avatar

Vladyslav Sumskyi sumskyi

View GitHub Profile
@sumskyi
sumskyi / iwlist.log
Created April 10, 2012 19:03
iwlist: neighbours channels
-> # iwlist wlan0 scanning | ruby -ne "readlines.each{|l| puts l if l =~ /(?:Cell|ESSID|Channel)/ }"
Cell 01 - Address: 00:1A:70:9E:98:60
Channel:1
Frequency:2.412 GHz (Channel 1)
ESSID:"Uncle Zhora"
Cell 02 - Address: 00:22:6B:86:F6:C8
Channel:1
Frequency:2.412 GHz (Channel 1)
ESSID:"sabaka2"
Cell 03 - Address: 00:15:E9:62:A7:44
@sumskyi
sumskyi / Gemfile
Created April 18, 2012 16:10
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
require 'spec_helper'
describe 'Fabricators' do
Fabrication::Support.find_definitions if Fabrication.schematics.empty?
Fabrication.schematics.schematics.keys.each do |fabrication|
it "The #{fabrication} fabrication is valid" do
f = Fabricate.build(fabrication)
f.should be_valid if f.respond_to?(:valid?)
end
@sumskyi
sumskyi / 42-things.md
Created November 28, 2012 18:01 — forked from xdite/42-things.md
Ten (42) Things You Didn't Know Rails Could Do
class ApplicationController < ActionController::Base
before_filter :require_authentication
private
def require_authentication
unless current_certificate.verify(public_key)
head :forbidden
end
end
@sumskyi
sumskyi / view.html
Created January 16, 2013 13:09
knockout.js + CoffeeScript learn.knockoutjs.com: Introduction
<p>First name: <strong data-bind="text: firstName">Bert</strong></p>
<p>Last name: <strong data-bind="text: lastName">Bertington</strong></p>
<p>First name: <input data-bind="value: firstName" /></p>
<p>Last name: <input data-bind="value: lastName" /></p>
<p>Full name: <strong data-bind="text: fullName"></strong></p>
<button data-bind="click: capitalizeLastName">Go caps</button>
@sumskyi
sumskyi / view.haml
Last active December 11, 2015 04:48
knockout.js + CoffeeScript learn.knockoutjs.com: Working with Lists and Collections
%h2
Your seat reservations
%span{:"data-bind" => "text: seats().length"}
%table
%thead
%tr
%th Passenger name
%th Meal
%th Surcharge
@sumskyi
sumskyi / app.rb
Last active December 11, 2015 07:09
Padrino Rspec multiple app
def app
spec_file = caller.grep(/_spec\.rb/).first
case spec_file
when /admin/
Admin
when /app/
Wordstat
else
raise "Unknown application!"
@sumskyi
sumskyi / proxy.rb
Created March 27, 2013 16:50
want proper index
def pick(provider, current_proxy=nil)
_accessible = {"unaccessible" => nil}
_not_banned = []
_not_banned << {"banned.#{provider}" => nil }
_not_banned << {"banned.#{provider}" => { '$lt' => BANNED_UNTIL[BANNED_SECONDS] }}
_different_subnet = {}
if current_proxy
_different_subnet = {

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby