Skip to content

Instantly share code, notes, and snippets.

@v-lopez
v-lopez / README.md
Created October 18, 2022 16:29 — forked from obscurerichard/README.md
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.

#!/bin/bash
# Fixes a downloaded apt mirror
# See: https://github.com/apt-mirror/apt-mirror/issues/113#issuecomment-464932493
## first parameter is optional mirror list file
if [ "$1" != "" ]
then
mirrorlist=$1
else
#include <behaviortree_ros_actions/do_ros_action.h>
#include <behaviortree_cpp/decorators/timeout_node.h>
#include <gtest/gtest.h>
using namespace std::chrono_literals;
class SimpleCoroAction : public BT::CoroActionNode
{
public:
SimpleCoroAction(std::chrono::milliseconds timeout, bool will_fail,
#!/usr/bin/env python
from __future__ import division
import os
import psutil
previous_mem=0
def print_memory(label=""):
global previous_mem
process = psutil.Process(os.getpid())
try:
#!/usr/bin/env python
from __future__ import division
import os
import psutil
previous_mem=0
def print_memory(label=""):
global previous_mem
process = psutil.Process(os.getpid())
new_mem=process.memory_info().rss / 1024
- git: {local-name: gazebo_ros_pkgs, uri: 'https://github.com/pal-robotics-forks/gazebo_ros_pkgs', version: 'kinetic-devel'}
- git: {local-name: pal_gazebo_plugins, uri: 'https://github.com/pal-robotics/pal_gazebo_plugins.git', version: 'kinetic-devel'}
- git: {local-name: pal_gazebo_worlds, uri: 'https://github.com/pal-robotics/pal_gazebo_worlds.git', version: 'kinetic-devel'}
- git: {local-name: pal_hardware_gazebo, uri: 'https://github.com/pal-robotics/pal_hardware_gazebo.git', version: 'kinetic-devel'}
- git: {local-name: pal_hardware_interfaces, uri: 'https://github.com/pal-robotics/pal_hardware_interfaces.git', version: 'indigo-devel'}
- git: {local-name: pal_msgs, uri: 'https://github.com/pal-robotics/pal_msgs.git', version: 'indigo-devel'}
- git: {local-name: pal_transmissions, uri: 'https://github.com/pal-robotics/pal_transmissions', version: 'indigo-devel'}
- git: {local-name: play_motion, uri: 'https://github.com/pal-robotics/play_motion.git', version: 'kinetic-devel'}
- git: {local-name: roboticsg
@v-lopez
v-lopez / python_debian_from_source.md
Last active February 24, 2022 10:01
python_debian_from_source

From: https://pypi.python.org/pypi/stdeb/0.8.5#examples

Example for package Reindent

Download source code: wget http://pypi.python.org/packages/source/R/Reindent/Reindent-0.1.0.tar.gz

You may need to install these dependencies: sudo apt install python3-all dh-python python3-stdeb

@v-lopez
v-lopez / debian_from_pip_install.sh
Last active December 26, 2023 16:34
Debian from pip install
#How to generate debian for package foobar
# Need to have install pip package stdeb
PKG=foobar
pip install -d . $PKG
tar xfvz $PKG*.tar.gz
cd $PKG*
python setup.py --command-packages=stdeb.command bdist_deb
#Debian is generated within deb_dist directory
@v-lopez
v-lopez / bashrc.append
Last active August 29, 2015 14:03 — forked from xim/bashrc.append
# vim file:34 otherfile:1337 -> Open files at respective lines. And in tabs!
vim() {
declare -a args
let fcount=0
hit_dashdash=
for arg in "$@" ;do
if [[ "$arg" =~ ^- && ! "$hit_dashdash" ]] ;then
args+=("$arg")
[[ "$arg" = "--" ]] && hit_dashdash=1
continue