Skip to content

Instantly share code, notes, and snippets.

require 'erubis'
template = <<'END'
<%= Time.now %>
<%= ::Time.now %>
<%= "string gsub".gsub!(//, '') %>
## Hello <%= @user %>!
<% for item in @list %>
- <%= item %>
#!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
import argparse
parser = argparse.ArgumentParser(description='http_server.')
parser.add_argument('-p', help='port number', default=8000)
parser.add_argument('-b', help='bind address', default="127.0.0.1")

localhost に https でつなげるようにする

$ mkdir ~/ssl
$ cd ~/ssl
$ openssl genrsa -out localhost.key 2048
$ openssl req -new -x509 -key localhost.key -out localhost.crt -days 3650 -subj /CN=localhost
$ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain localhost.crt
$ brew install nginx
$ cp ~/ssl/localhost.crt /opt/boxen/homebrew/etc/nginx/cert.pem
@yalab
yalab / README.md
Last active June 5, 2019 11:39
Bridge between C++ and ruby.

Try to implement C++ and ruby Bridge.

How to use

$ ruby extconf.rb
$ make
$ ruby test.rb
@yalab
yalab / bootstrap-memo.md
Last active July 20, 2022 20:29
rails5 + webpacker + bootstrap
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
@yalab
yalab / numeric.c
Last active September 15, 2017 05:47
diff --git a/numeric.c b/numeric.c
index 480ab7e0cb..bdf885cf57 100644
--- a/numeric.c
+++ b/numeric.c
@@ -186,7 +186,7 @@ VALUE rb_cFixnum;
VALUE rb_eZeroDivError;
VALUE rb_eFloatDomainError;
-static ID id_to, id_by;
+static ID id_to, id_by, id_from;
FROM alpine
MAINTAINER yalab <rudeboyjet@gmail.com>
RUN apk --update --no-cache add alpine-sdk ncurses-dev bc linux-headers perl
ENV ARCH="x86_64"
RUN git clone --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git /linux
WORKDIR /linux
@yalab
yalab / iptables.md
Created September 24, 2017 07:32
iptables の設定

iptables の設定

# apt-get install iptables-persistent
# cd /etc
# git add -A
# git commit -m 'apt-get install iptables-persistent'
# vi /root/iptables.sh
スタッフ
1, yuukyun
2,yamazoeakiyo
3,
4,morisaki
5, higaki
6, aki
7, kyara
8,
@yalab
yalab / process.md
Created November 20, 2017 09:02
LinuxKernel勉強会2017-11.md

プロセス

プロセスってどうやって起動するのか調べる

linux kernel process invoke で検索すると http://www.tldp.org/LDP/tlk/kernel/processes.html

Linux の process とは task_struct 構造体の事で、task vector に 512 個まで格納される

process と task の違い?