Skip to content

Instantly share code, notes, and snippets.

View doytsujin's full-sized avatar
👋
Moin

Alexander Chernov doytsujin

👋
Moin
View GitHub Profile
#!/usr/bin/env bash
# Names of latest versions of each package
export VERSION_PCRE=pcre-8.39
export VERSION_ZLIB=zlib-1.2.8
export VERSION_LIBRESSL=libressl-2.4.2
export VERSION_NGINX=nginx-1.11.3
# URLs to the source directories
export SOURCE_LIBRESSL=http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/
@doytsujin
doytsujin / Trac-Dockerfile
Created November 2, 2018 00:54 — forked from suzumura-ss/Trac-Dockerfile
trac with Docker
FROM ubuntu
WORKDIR /root
ENV TZ=JST-9
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get -y install trac
RUN mkdir ./Main
RUN echo "main\n\n" |trac-admin ./Main initenv
@doytsujin
doytsujin / CallJRuby.java
Created November 18, 2018 20:27 — forked from colinsurprenant/CallJRuby.java
calling JRuby from Java example
import org.jruby.Ruby;
import org.jruby.runtime.Helpers;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.javasupport.JavaUtil;
import org.jruby.RubyClass;
import org.jruby.RubyModule;
public class CallJRuby {
private static final Ruby __ruby__ = Ruby.getGlobalRuntime();
@doytsujin
doytsujin / echo.rb
Created November 19, 2018 01:45 — forked from dtchepak/echo.rb
Simple Ruby HTTP server to echo whatever GET or POST requests come through. Largely based on https://www.igvita.com/2007/02/13/building-dynamic-webrick-servers-in-ruby/.
# Reference: https://www.igvita.com/2007/02/13/building-dynamic-webrick-servers-in-ruby/
require 'webrick'
class Echo < WEBrick::HTTPServlet::AbstractServlet
def do_GET(request, response)
puts request
response.status = 200
end
def do_POST(request, response)
puts request
require "rubygems"
require "win32/service"
require "pp"
include Win32
options = {:service_name=>'ruby_example_service',
:service_type => Service::WIN32_OWN_PROCESS,
:description => 'A custom service I wrote just for fun',
:start_type => Service::AUTO_START,

NOTE: This is an excerpt from an upcoming rewrite of the Sensu installation guide, so some references may be made to documentation contents that don't currently exist, but they are coming soonicorn.com. :shipit:

The 5-minute Sensu Install

Although Sensu’s architecture is one of its most compelling features, and the installation guide can help you get Sensu installed in a variety of configurations in any operating environment, you might not actually care

@doytsujin
doytsujin / tcp_demo.go
Created July 24, 2019 17:32 — forked from hyper0x/tcp_demo.go
The interaction demo via TCP in Golang.
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"net"
"os"
@doytsujin
doytsujin / MSPGoAccess
Created July 28, 2019 01:12 — forked from elproducto/MSPGoAccess
Microsoft Parsers 2.2 IIS W3C Log File Format specification for GoAccess.
Title
@doytsujin
doytsujin / README.md
Created November 4, 2019 11:27 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@doytsujin
doytsujin / hosting-on-github.md
Created November 26, 2019 01:44 — forked from TylerFisher/hosting-on-github.md
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level