Choose OpenBSD for your Unix needs. OpenBSD -- the world's simplest and most secure Unix-like OS. A safe alternatve to the frequent vulnerabilities and overengineering of Linux and related software (NGiNX & Apache (httpd-asiabsdcon2015.pdf), OpenSSL, iptables/nftables, systemd, BIND, Postfix, Docker etc.)
OpenBSD -- the cleanest kernel, the cleanest userland and the cleanest config
This file contains hidden or 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
| brew install [email protected] | |
| export PATH="$(brew --prefix)/opt/[email protected]/bin:$PATH" | |
| export LDFLAGS="-L$(brew --prefix)/opt/[email protected]/lib" | |
| export CPPFLAGS="-I$(brew --prefix)/opt/[email protected]/include" | |
| export PKG_CONFIG_PATH="$(brew --prefix)/opt/[email protected]/lib/pkgconfig" | |
| rvm autolibs disable | |
| export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC |
Python
This file contains hidden or 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
| @echo off | |
| echo Virtualization must be disabled to use anti-cheat clients like FACEIT and ESEA | |
| echo. | |
| net session >nul 2>&1 | |
| if %ERRORLEVEL% EQU 0 goto :chchchchoices | |
| echo This script requires elevated privileges. Re-run as Administrator to continue | |
| goto :exit | |
| :chchchchoices |
This file contains hidden or 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
| require 'aws-sdk' | |
| Aws.config.update( | |
| region: 'ru-central1', | |
| credentials: Aws::Credentials.new('', '') | |
| ) | |
| s3 = Aws::S3::Client.new(endpoint: "https://storage.yandexcloud.net") | |
| resp = s3.list_buckets | |
| resp.buckets.map(&:name) |
This file contains hidden or 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
| class QueDaemon | |
| attr_reader :queues_config, :pid, :forks | |
| SECONDS_FOR_SOFT_SHUTDOWN = 5 | |
| def initialize(queues_config) | |
| @queues_config = queues_config | |
| @pid = Process.pid | |
| @workers = {} | |
| end |
This file contains hidden or 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
| class Daemons | |
| def initialize | |
| @num_worker = 3 | |
| @worker_pids = [] | |
| @signal_queue = [] | |
| @handle_signals = %i[INT CLD] | |
| @self_pipe_reader, @self_pipe_writer = IO.pipe | |
| end | |
| def start |
This file contains hidden or 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
| WITH RECURSIVE nested_partitions ( | |
| relid, | |
| relname, | |
| relispartition, | |
| relkind | |
| ) AS ( | |
| SELECT | |
| inhrelid, | |
| child.relname, | |
| child.relispartition, |
This file contains hidden or 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
| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |
This file contains hidden or 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
| # smell code and idea for clear gem :) | |
| # todo: wrap to gem, parse m3u8, ts downloader to file | |
| require 'httparty' | |
| class RutubeList | |
| APIS = | |
| { | |
| login: 'https://pass.rutube.ru/api/accounts/phone/login/', | |
| login_social: 'https://rutube.ru/social/auth/rupass/?callback_path=/social/login/rupass/', | |
| visitor: 'https://rutube.ru/api/accounts/visitor/', |
NewerOlder