Skip to content

Instantly share code, notes, and snippets.

View khssnv's full-sized avatar

Alisher A. Khassanov khssnv

View GitHub Profile
@khssnv
khssnv / shell_oneliners.md
Last active April 18, 2023 04:19
Usefull shell commands what fits one line

Color golang test output

go test -v ./tests | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/''

Backup your user home data excluding some files

cd ~
tar -cvpzf backup.tar.gz --exclude=./backup.tar.gz --exclude=./.local/share/io.parity.ethereum/chains/ --one-file-system .
version: "3.8"
services:
nginx:
image: nginx:1.23
ports:
- 80:80
- 443:443
volumes:
- ./nginx.conf:/etc/nginx/conf.d/app.example.com.conf
version: "3.8"
services:
app:
build: .
labels:
- traefik.enable=true
- traefik.http.routers.app.entrypoints=websecure
- traefik.http.routers.app.rule=Host(`app.example.com`)
- traefik.http.routers.app.tls=true
@khssnv
khssnv / Custom_SSL_ThreadingTCPServer.py
Last active December 3, 2021 09:35
Python SSL Threading TCP Server with custom data passed to RequestsHandler
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ssl
from SocketServer import TCPServer, ThreadingMixIn, StreamRequestHandler
class SSL_TCPServer(TCPServer):
def __init__(self,
server_address,
import argparse
import socket
import sys
import time
import os
import bosdyn.client
import bosdyn.client.lease
import bosdyn.client.util
import bosdyn.geometry
@khssnv
khssnv / Vagrantfile
Created December 4, 2020 07:50
Ubuntu Server 20.04 Focal with Desktop packages and development tools
```
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Ubuntu Server with GNOME3 desktop and development tools
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.box_check_update = false
config.vm.hostname = "ufvm2"

1. Copy a segment from rosbag file

rosbag filter in.bag out.bag "t.to_sec() >= 1582908021.4 and t.to_sec() <= 1582908029.0"

Source: How to split a recorded rosbag file?

2. Graceful stop for rosbag recording

rosbag record -O out.bag cmd_vel __name:=rosbag
rosnode kill /rosbag
@khssnv
khssnv / out.md
Created September 15, 2020 09:48
% ros2 launch run_moveit_cpp run_moveit_cpp.launch.py
[INFO] [launch]: All log files can be found below /home/khassanov/.ros/log/2020-09-15-11-24-34-337151-vm20-3394
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [static_transform_publisher-1]: process started with pid [3401]
[INFO] [robot_state_publisher-2]: process started with pid [3403]
[INFO] [rviz2-3]: process started with pid [3410]
[INFO] [run_moveit_cpp-4]: process started with pid [3412]
[INFO] [fake_joint_driver_node-5]: process started with pid [3419]
[static_transform_publisher-1] [INFO] [1600161874.685619758] [static_transform_publisher]: Spinning until killed publishing transform from 'world' to 'panda_link0'

If you have a problem with ros_comm built with python3 on Ubuntu 18.04 like

$ rostopic list
Traceback (most recent call last):
  File "/home/user/Workspace/catkin_ws/devel/bin/rostopic", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/user/Workspace/catkin_ws/src/ros_comm/tools/rostopic/scripts/rostopic", line 35, in <module>
    rostopic.rostopicmain()
  File "<string>", line 2118, in rostopicmain
 File "/home/user/Workspace/catkin_ws/devel/lib/python3/dist-packages/rosbag/__init__.py", line 34, in 
@khssnv
khssnv / tmux_cheatsheet.md
Last active February 13, 2020 10:17
Tmux cheatsheet for Autonomous Kitchen
  1. Add connection config to ssh (it's only for NUC only, you may find jetsons configs in chat):

Open ~/.ssh/config.

Add this and save:

Host nuc-1
    Hostname 192.168.7.231
    User remy
 ForwardX11 yes