Skip to content

Instantly share code, notes, and snippets.

View komamitsu's full-sized avatar

Mitsunori Komatsu komamitsu

View GitHub Profile
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.fury.Fury;
import org.apache.fury.config.Language;
import org.msgpack.jackson.dataformat.MessagePackMapper;
import java.io.IOException;
import java.util.*;
@komamitsu
komamitsu / how-to-build-and-run-ydb.md
Created June 1, 2024 03:48
How to build and run YugabyteDB on macOS

Download the source code

git clone https://github.com/yugabyte/yugabyte-db.git
cd yugabyte-db

Build YugabyteDB

@komamitsu
komamitsu / millions-hello-worlds.c
Created March 2, 2024 03:35
"Hello, World!" without recursions or loop
#include <stdio.h>
#include <ucontext.h>
#define N 1000000
int main(){
int i = 0;
ucontext_t ctxt;
getcontext(&ctxt);
package org.example;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@komamitsu
komamitsu / systemd-xremap.md
Last active November 2, 2024 11:22
Execute xremap from systemd

Execute xremap as root user

Create /etc/systemd/system/xremap.service file

[Unit]
Description=xremap service
After=default.target

[Service]
package org.komamitsu.unixdomainsockettest;
import java.net.StandardProtocolFamily;
import java.net.UnixDomainSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
fun calcite() {
val schema = Frameworks.createRootSchema(true)
val config = Frameworks.newConfigBuilder()
.defaultSchema(schema)
.sqlValidatorConfig(SqlValidator.Config.DEFAULT)
.parserConfig(
SqlParser.config()
.withQuoting(Quoting.BRACKET)
.withCaseSensitive(true)
@komamitsu
komamitsu / log.md
Created March 7, 2022 05:04
AMD sleep issue with Ubuntu 20.04
Mar 07 13:53:46 komamitsu-laptop systemd[1]: Reached target Sleep.
Mar 07 13:53:46 komamitsu-laptop systemd[1]: Starting Record successful boot for GRUB...
Mar 07 13:53:46 komamitsu-laptop systemd[1]: Starting NVIDIA system suspend actions...
Mar 07 13:53:46 komamitsu-laptop suspend[2802]: nvidia-suspend.service
Mar 07 13:53:46 komamitsu-laptop logger[2802]: <13>Mar  7 13:53:46 suspend: nvidia-suspend.service
Mar 07 13:53:46 komamitsu-laptop systemd[1]: grub-common.service: Succeeded.
Mar 07 13:53:46 komamitsu-laptop systemd[1]: Finished Record successful boot for GRUB.
Mar 07 13:53:46 komamitsu-laptop systemd[1]: nvidia-suspend.service: Succeeded.
Mar 07 13:53:46 komamitsu-laptop systemd[1]: Finished NVIDIA system suspend actions.
@komamitsu
komamitsu / key-remap-on-xkb.md
Last active October 22, 2024 18:38
Key remapping on Linux using xkb-options

Goal

  • Make Muhenkan key a left Control key
  • Make Hiragana Katakana key an Escape key
  • Make Capslock key a Zenkaku Hankaku key

Options

  • xmodmap: Easy, but my laptop's suspend/resume resets xmodmap configuration
  • xkb: Let's try this