Skip to content

Instantly share code, notes, and snippets.

@olzhas
olzhas / How to setup VirtualGL and TurboVNC on Ubuntu.md
Created September 4, 2021 13:10 — forked from cyberang3l/How to setup VirtualGL and TurboVNC on Ubuntu.md
Setup VirtualGL and TurboVNC on Ubuntu for OpenGL forwarding
@olzhas
olzhas / x11_docker_mac.md
Created April 16, 2021 04:17 — forked from cschiewek/x11_docker_mac.md
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@olzhas
olzhas / README.md
Last active September 9, 2019 14:58
Change swapfile size in Ubuntu 18.04
  1. Turn off all swap processes
sudo swapoff -a
  1. Resize the swap
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
  • if = input file
  • of = output file

The document provides description on calibration of three Kinect for Microsoft sensors connected to one computer with several usb controllers. Three cameras setup is shown below:

Figure 1

Intrinsic, extrinsic, and Kinect2Kinect calibration is performed to know the position of each sensor in the space. Our setup is ROS Indigo with Ubuntu 14.04. freenect_launch and camera_pose ROS packages are used. Camera_pose package provides the pipeline to calibrate the relative 6D poses between multiple camera's. freenect_launch package contains launch files for using OpenNI-compliant devices in ROS. It creates a nodelet graph to transform raw data from the device driver into point clouds, disparity images, and other products suitable for processing and visualization. It is installed with catkin as follows:

# Prepa
@olzhas
olzhas / cpu-governor-tutorial.md
Last active November 3, 2023 13:05
CPU Governor matters

CPU governer matters

If you need increase in computational power from your workstation this might be a right post for you. Power management, in this case CPU Governor, is a software that assures the "best" power consumption by a computer for a particular task. For some reason in Ubuntu 20.04 a default CPU governor (even on stationary PCs) is powersave. This comes in handy, if you are using it for some office applications (text processor, email, client, webbrowsing). However for a real-time control of the electromechanical systems such as robots where we have to be able to use computers performance at full, or for machine learning we desire to minimize time spent on training a model. A small amount of performance boost can be obtain choosing the right CPU governor in our case performance profile. You can enable performance CPU governor on your computer following the instructions below. Open your favorite shell and type following command.

$ sudo systemctl disable ondemand.service
$ echo perfor
@olzhas
olzhas / timer.hpp
Last active May 29, 2018 11:03
simple tic and toc
#ifndef TIMER_H
#define TIMER_H
#include <chrono>
#include <thread>
using timer = std::chrono::high_resolution_clock::time_point;
inline void tic(timer &t){
t = std::chrono::high_resolution_clock::now();
@olzhas
olzhas / make_clang_great_again.sh
Created January 26, 2018 05:35
make clang-5.0 default clang
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 100
@olzhas
olzhas / qpsolve.py
Created August 2, 2017 10:39 — forked from jaeandersson/qpsolve.py
Solve QP using qpOASES and CasADi from Python
import numpy as NP
import casadi as C
def qpsolve(H,g,lbx,ubx,A=NP.zeros((0,0)),lba=NP.zeros(0),uba=NP.zeros(0)):
# Convert to CasADi types
H = C.DMatrix(H)
g = C.DMatrix(g)
lbx = C.DMatrix(lbx)
ubx = C.DMatrix(ubx)
A = C.DMatrix(A)
A = A.reshape((A.size1(),H.size1())) # Make sure matching dimensions
ffmpeg -i 1.mov -i 2.mov -i 3.mov -filter_complex "hstack=3" output.mp4