Skip to content

Instantly share code, notes, and snippets.

View YouSysAdmin's full-sized avatar
🤪

Oleksii Samoliuk YouSysAdmin

🤪
View GitHub Profile
@YouSysAdmin
YouSysAdmin / scan.rb
Last active October 30, 2015 07:37
Async network scanner
#!/usr/bin/env ruby
# gem install celluloid net-ping
require 'celluloid/current'
require 'net/ping'
require 'ipaddr'
class ScanPort
include Celluloid
def scan host, port
@YouSysAdmin
YouSysAdmin / travis.rb
Created February 8, 2015 14:40
Get Travis-CI status
require 'open-uri'
require 'string_color'
xml_data = open('https://api.travis-ci.org/repos/POStroi/EveOnlineItemParse/cc.xml').read
status = xml_data.scan(%r{lastBuildStatus="(.*)"})[0][0]
case status
when 'Success'
puts 'Ok'.green
when 'Failure'
puts 'Not Ok'.red

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

# coding: utf-8
##########################################################
# Специально для владельцев предприятий
# Инновационно новый метод расчёта зарплаты для работников IT
# После запуска, остаётся только подписать
###########################################################
puts "Month\t$"
1.upto(12) {|i| print(i,"\t\t",rand(1001),"\r\n")}