Skip to content

Instantly share code, notes, and snippets.

View hangingman's full-sized avatar
🦙

hangedman hangingman

🦙
  • Kanagawa, Japan
  • 00:57 (UTC +09:00)
View GitHub Profile
/*
Copyright (c) 2006 Tim Kosse
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
@hangingman
hangingman / bootpack.ld
Created June 26, 2016 16:03 — forked from uchan-nos/bootpack.ld
GNU LD linker script for BitNOS (HariboteOS-like operating system)
OUTPUT_FORMAT("binary")
ENTRY(KernelMain)
HEAP_SIZE = 0;
MMAREA_SIZE = 0;
__ctors = ADDR(.ctors);
__ctors_count = SIZEOF(.ctors) / 4;
SECTIONS
@hangingman
hangingman / bootpack.ld
Created November 23, 2016 05:50
object から .hrb 形式変換のためのリンカスクリプト(from: http://seesaawiki.jp/w/yamaneko1144/)
/*入力オブジェクトファイル
入力ファイルを増やすときはここに追加*/
INPUT(bootpack.o nasmfunc.o)
/*出力オブジェクトファイル*/
OUTPUT(bootpack.bim)
/*エントリーポイントファイル
これを設定するとstartupルーチンが.textセクションの先頭にくる*/
STARTUP(startup.o)
@hangingman
hangingman / bootpack.ld
Created November 23, 2016 06:06
object から .bim 形式変換のためのリンカスクリプト(from: http://hrb.osask.jp/wiki/?tools/obj2bim)
SECTIONS {
/*
* .bimのヘッダ
*/
.head 0x0 :
{
/*
* GNU ld version 2.14.90.0.7 20031029では、以下は、なぜか'+ 0'が必要。
* LOADADDR(.text)
* ADDR(.text)
@hangingman
hangingman / os.lds
Created November 23, 2016 06:17
object から .hrb 形式変換のためのリンカスクリプト(from: http://vanya.jp.net/os/haribote.html)
OUTPUT_FORMAT("binary");
SECTIONS
{
.head 0x0 : {
LONG(64 * 1024) /* 0 : stack+.data+heap の大きさ(4KBの倍数) */
LONG(0x69726148) /* 4 : シグネチャ "Hari" */
LONG(0) /* 8 : mmarea の大きさ(4KBの倍数) */
LONG(0x310000) /* 12 : スタック初期値&.data転送先 */
LONG(SIZEOF(.data)) /* 16 : .dataサイズ */
@hangingman
hangingman / funcs.sql
Last active August 24, 2017 14:52
MySQLの関数作成
--
-- 単純な文字列結合の関数 String#join() 相当?
--
DROP FUNCTION IF EXISTS concat_as_ymd;
CREATE FUNCTION concat_as_ymd(ymd VARCHAR(8)) RETURNS VARCHAR(10) DETERMINISTIC
BEGIN
RETURN CONCAT_WS('-', SUBSTRING(ymd, 1, 4), SUBSTRING(ymd, 5, 2), SUBSTRING(ymd, 7, 2));
END;
<!DOCTYPE html>
<head>
<title>ビルド状況</title>
<style type="text/css">
body
{
margin: 0px;
padding: 15px;
}
@hangingman
hangingman / C.rb
Created November 12, 2017 07:28
AtCoder C - コイン
lines = <<'EOS'
3
2
4
8
EOS
#lines = $stdin.read
array = lines.split("\n")
@hangingman
hangingman / Dockerfile
Created December 6, 2017 09:11
Airflow使いたい
FROM amazonlinux
# set yum repository mirror for jp
RUN yum -y install yum-plugin-fastestmirror
RUN sed -ri 's/#include_only=.nl,.de,.uk,.ie/include_only=.jp/g' /etc/yum/pluginconf.d/fastestmirror.conf
# install packages
RUN yum -y update
RUN yum -y install vim
RUN yum -y install passwd openssh openssh-server openssh-clients sudo iproute
@hangingman
hangingman / Vagrantfile
Last active March 20, 2018 03:52
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "mvbcoding/awslinux"
config.vm.box_version = "2017.03.0.20170401"
config.vm.network "forwarded_port", guest: 80, host: 80
# deploy codes
config.vm.provision "shell", privileged: false, inline: <<-SHELL
whoami #=> vagrant
echo $HOME #=> /home/vagrant