Skip to content

Instantly share code, notes, and snippets.

View GunjiD's full-sized avatar

Gunzi GunjiD

View GitHub Profile
@GunjiD
GunjiD / init.el
Created November 14, 2022 03:48
emacs config
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(setq inhibit-startup-message t)
(setq initial-scratch-message nil)
@GunjiD
GunjiD / main.cpp
Created June 28, 2022 14:24
Redis クライアントに触ってみる
#include <iostream>
#include <iterator>
#include <ostream>
#include <string>
#include <sw/redis++/redis++.h>
#include <vector>
int main() {
// redis への接続
auto redis = sw::redis::Redis("tcp://127.0.0.1:6379");

Flask Quickstart の翻訳

A Minimal Application 最小限のアプリケーション

A minimal Flask application looks something like this:
最小限の Flask アプリケーションはこのように見える:

from flask import Flask 
@GunjiD
GunjiD / byte_order.c
Created August 15, 2020 11:09
ntoh and hton implementation
#include <string.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netpacket/packet.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <net/if.h>
#include <netinet/in_systm.h>
@GunjiD
GunjiD / ntop.c
Last active July 28, 2020 07:30
簡易ntop実装
#include <string.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
/*
https://code.woboq.org/userspace/glibc/resolv/inet_ntop.c.html#15tmp
*/
void ip_ntop(uint32_t src, char *dest){
@GunjiD
GunjiD / main.c
Created July 20, 2020 03:16
C言語のビットフィールドについて
#include <string.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netpacket/packet.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <net/if.h>
#include <netinet/ip.h>
@GunjiD
GunjiD / socket.c
Last active July 5, 2020 10:01
raw packet メモ
#include <string.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netpacket/packet.h>
#include <net/ethernet.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/ip.h>

Terminal 環境構築

font

git clone --branch=master --depth 1 https://github.com/ryanoasis/nerd-fonts.git 
./nerd-fonts/install.sh

neovim 環境構築

@GunjiD
GunjiD / centos7_network.md
Created July 27, 2019 15:13
インストール直後のcentos7のネットワークを設定する

インストール直後

reboot したら network is unreachable するので nmcli 使って設定

nmcli を使って設定する

設定しないと ethenet の STATE が disconnect になってる
下記はネットワークの設定後の状態

@GunjiD
GunjiD / opennebula_install.md
Last active July 25, 2019 15:34
OpenNebulaのインストール記録

ruby_gems のインストールまで終わった

DBインストール

MariaDB を使う。

手順通りにインストール

ユーザー名は oneadmin パスワード opennebula