Skip to content

Instantly share code, notes, and snippets.

View orleika's full-sized avatar
🏠
Working from home

Koki Yasuda orleika

🏠
Working from home
  • HackathonMonster
  • Tokyo, Japan
View GitHub Profile
ascii -> hex(little endian)
echo "/bin/sh" | rev | xxd -p | sed 's/.\{2\}$//' | fold -s8 | sed 's/^\(.*\)/0x\1/g'
hex format
echo "68732f6e69622f" | sed 's/^0x\(.*\)$/\1/g' | fold -s2 | perl -pe 's/(\w{2})\s+/\\x\1/g'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Fix x-y-header table</title>
<style>
.view-table {
overflow: scroll;
width: 600px;
@orleika
orleika / Browser_environment_on_Node.js
Last active July 27, 2016 05:45
Running Browser environment on Node.js
## Requirements
Python
`$ npm install -g phantomjs`
`$ npm install -g casperjs`
## Run
`$ casperjs index.js`
(define (atom? x)
(and (not (null? x))
(not (pair? x))))
(define (append a b)
(cond ((null? a) b)
(else (cons (car a) (append (cdr a) b)))))
(define (linearize x)
(cond ((null? x) '())
@orleika
orleika / oneline.sh
Last active November 15, 2015 08:51
Mongo oneline export
$ mongo --quiet dbname --eval 'db.collection.find();' > result.tsv
@orleika
orleika / agm.js
Last active October 5, 2015 15:06
AGM Method
var pi = agm(3);
console.log(pi);
function agm(n) {
var a = 1,
b = 1 / Math.sqrt(2),
t = 1 / 4,
p = 1,
an;
for (var i = 0; i < n; i++) {
@orleika
orleika / gist:c8f33b90cab712766550
Last active November 8, 2015 15:16
sendmail対策
Return-to-Address
X-PHP-Originating-Script
X-Authentication-Warning
SPF v=spf1 include:_spf.google.com ~all
@orleika
orleika / template.cpp
Created February 13, 2015 14:35
プロコン用
#include <bits/stdc++.h>
#define dump(x) cerr << #x << "=" << (x) << endl
#define FOR(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define all(p) (p).begin(), (p).end()
#define rall(p) (p).rbegin(), (p).rend()
#define MP make_pair
#define PB push_back
@orleika
orleika / x509_cetificate.md
Last active August 1, 2017 07:06
How to make x.509 self-signed certificate

How to make x.509 self-signed certificate

# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout myPrivateKey.key -out myCert.pem
# chmod 600 myPrivateKey.key
# openssl  x509 -outform der -in myCert.pem -out myCert.cer
myCert.cer
CER certificate
@orleika
orleika / git_sshkey.md
Last active August 1, 2017 07:03
Git ssh key

Git ssh key

registration a ssh key with Github

Make ssh key

Answer yes to the all questions, and ~/.ssh/id_ed25519[.pub] are generated.

$ ssh-keygen -t ed25519 -C "[email protected]"

Register ssh key