Skip to content

Instantly share code, notes, and snippets.

View ompugao's full-sized avatar

ompugao

View GitHub Profile
@ompugao
ompugao / mattermost_to_slack.py
Last active January 11, 2024 11:12
message migration from mattermost to slack
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import pprint
import csv
if __name__ == '__main__':
with open('./bulk.csv', 'w') as csvf:
writer = csv.writer(csvf, lineterminator='\n', quoting=csv.QUOTE_ALL)
with open('./bulk.json', 'r') as f:
@ompugao
ompugao / dstarlite.cpp
Created May 4, 2019 14:13
D* Lite implementation in C++ (experimental)
////
// D* Lite implementation in C++
// @tokoro10g
// Reference: http://idm-lab.org/bib/abstracts/papers/aaai02b.pdf
////
#include <bits/stdc++.h>
using namespace std;
using Cost = float;
@ompugao
ompugao / Dockerfile
Created September 30, 2020 11:35
openrave dockerfile (ubuntu 20.04)
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt -y update && apt -y upgrade && apt -y install git cmake build-essential lsb-release sudo && rm -rf /var/lib/apt/lists
WORKDIR /workdir
RUN apt -y update && \
apt install -y --no-install-recommends build-essential cmake doxygen \
g++ git octave python-dev python-setuptools wget mlocate \

Keybase proof

I hereby claim:

  • I am ompugao on github.
  • I am ompugao (https://keybase.io/ompugao) on keybase.
  • I have a public key ASCvgIzHlvaBMqkp3j15ycXkQMor2b9-F_X4Vdjc6cyNbwo

To claim this, I am signing this object:

@ompugao
ompugao / README.md
Last active October 10, 2022 06:01
password duplicates merger for conversion of passwords from google to bitwarden

Password Duplicates Merger

Usage

# export passwords from google
python3 convert_googlepasswords_to_bitwarden.py ./Google\ Passwords.csv ./bitwarden.csv
# import bitwarden.csv via csv(bitwarden)
@ompugao
ompugao / install.sh
Last active June 17, 2022 03:16
Logseq desktop
curl https://gist.githubusercontent.com/ompugao/d98780de08f3e71caffbfc0cd8522e6e/raw/fcf708f6ef9d98ed924c4a4c8485c84c12aae7b3/setup.sh | /bin/bash
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ompugao
ompugao / auto-cpufreq.conf
Created January 15, 2022 02:19
/etc/auto-cpufreq.conf
# settings for when connected to a power source
[charger]
# see available governors by running: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
# preferred governor.
governor = performance
# minimum cpu frequency (in kHz)
# example: for 800 MHz = 800000 kHz --> scaling_min_freq = 800000
# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html
# to use this feature, uncomment the following line and set the value accordingly
@ompugao
ompugao / linux_magic.cpp
Created August 15, 2020 15:30 — forked from xymopen/linux_magic.cpp
C++ equivalences of the famous offset_of and container_of(owner_of) macro from Linux kernel
template< class T, class M >
static inline constexpr ptrdiff_t offset_of( const M T::*member ) {
return reinterpret_cast< ptrdiff_t >( &( reinterpret_cast< T* >( 0 )->*member ) );
}
template< class T, class M >
static inline constexpr T* owner_of( M *ptr, const M T::*member ) {
return reinterpret_cast< T* >( reinterpret_cast< intptr_t >( ptr ) - offset_of( member ) );
}
@ompugao
ompugao / casadi_mpc.py
Last active October 8, 2021 02:56 — forked from mayataka/casadi_mpc.py
MPC via CasADi
from casadi import *
import math
import numpy as np
class MPC:
def __init__(self):
# 問題設定
T = 1.0 # ホライゾン長さ (MPCなので短め)
N = 20 # ホライゾン離散化グリッド数 (MPCなので荒め)