Skip to content

Instantly share code, notes, and snippets.

View tesuji's full-sized avatar
🦀
...

tesuji

🦀
...
  • D28DBB1A0E26FEDA
View GitHub Profile
syntax = "proto3";
package main;
message SimpleMessage {
int32 id = 1; // Unique ID number for this message.
string mode = 2;
string email = 3;
enum MsgMode {
MESSAGE = 0;
@tesuji
tesuji / accessing-virtualbox.md
Created April 29, 2018 20:47
Accessing your Virtualbox Guest from your Host OS

Accessing your Virtualbox Guest from your Host OS

As a developer you want to ping and access the webserver on your virtual machine. This is a very simple solution to enable the bridge to the guest VM.

Requirements

  • VirtualBox (latest version)
  • A guest operation system (e.g. Ubuntu)
-- Logs begin at Sat 2018-04-28 00:00:30 +07, end at Sat 2018-04-28 12:38:43 +07. --
Apr 28 12:37:48 ubox kernel: mmc0: Unknown controller version (3). You may experience problems.
Apr 28 12:37:48 ubox kernel: radeon 0000:01:00.0: failed VCE resume (-110).
Apr 28 12:37:48 ubox systemd-rfkill[475]: Failed to open device rfkill0: No such device
Apr 28 12:37:48 ubox systemd-udevd[338]: Error calling EVIOCSKEYCODE on device node '/dev/input/event10' (scan code 0x100150, key code 
Apr 28 12:37:50 ubox wpa_supplicant[657]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (none) none
Apr 28 12:37:50 ubox wpa_supplicant[657]: dbus: Failed to construct signal
Apr 28 12:37:52 ubox spice-vdagent[930]: Cannot access vdagent virtio channel /dev/virtio-ports/com.redhat.spice.0
Apr 28 12:38:11 ubox kernel: radeon 0000:01:00.0: failed VCE resume (-110).
@tesuji
tesuji / tmp.rst
Last active March 28, 2018 03:15

ppwn

Some python script for personal use

A lite version of pwntools_ of Gallopsled

External hyperlinks, like Python.

@tesuji
tesuji / CSR.md
Last active March 29, 2018 14:33

Certificate Signing Request là gì?

Certificate Signing Request là 1 đoạn text chứa thông tin của chủ sở hữu tên miền được mã hóa từ server (public key) chuẩn bị cài đặt SSL.

Nó chứa thông tin sẽ được bao gồm trong giấy chứng nhận của bạn như tên tổ chức của bạn, tên thông thường (tên miền), địa phương. Một CSR sẽ được tạo ra ngay trước khi gửi yêu cầu cho bên cung cấp SSL (CA) để sinh ra SSL Certificate.

Để tạo một CSR, cần phải có một khoá bí mật (private key) và khoá công khai (public key) được trích ra từ nó. Chúng ta có thể dùng khoá bí mật có sẵn hoặc tạo khoá mới.

Khởi tạo Private key

Sử dụng lệnh sau để tạo Private key mới:

@tesuji
tesuji / Makefile
Last active February 5, 2018 03:56
Read headers of BMP image file type.
CC=gcc
CFLAGS=-Wfatal-errors -std=gnu11 -Wall
readbmp.elf: readbmp.c
$(CC) $(CFLAGS) -o $@ $^
@tesuji
tesuji / .fonts.conf.xml
Last active January 4, 2018 03:53 — forked from silv3rm00n/.fonts.conf
Tweak .fonts.conf for better looking fonts http://www.binarytides.com/gorgeous-looking-fonts-ubuntu-linux/
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@tesuji
tesuji / git_default.md
Last active April 17, 2018 15:33
git default

We recommend every repository include a README, LICENSE, and .gitignore

Git global setup

git config --global user.name "username"
git config --global user.email "[email protected]"

New repository

@tesuji
tesuji / vim_tips.md
Last active November 20, 2017 17:46

Some useful keyboard shortcuts in VIM

Navigation

Shortcuts Commmand
H, M, L go to Highest, Middle, Lowest
0, $ first, last char in line
gi / g; go to the last edited location
w / e go to the beginning/end of word
Ctrl+S/Ctrl+Q block/unblock terminal
@tesuji
tesuji / ABOUT.md
Created November 19, 2017 04:51 — forked from laobubu/ABOUT.md
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913