Skip to content

Instantly share code, notes, and snippets.

View ojura's full-sized avatar
:octocat:
⏯⏺⏮⏭

Juraj Oršulić ojura

:octocat:
⏯⏺⏮⏭
View GitHub Profile
@ojura
ojura / README.md
Created March 4, 2022 23:10 — forked from pojntfx/README.md
Share a terminal from Debian to the web using ttyd and localhost.run

Shortened link to this Gist: https://git.io/JPMB8

To use, run:

curl -L 'https://git.io/JPMBa' | bash -s -- sharedusername sharedpassword

Or if you only have wget installed, run:

@ojura
ojura / spend_double_wrapped_cat.py
Last active February 22, 2022 20:56
Full POC for unwrapping doublewrapped Chia CATs
from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.program import Program
from chia.wallet.wallet import Wallet
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.cmds.wallet_funcs import get_wallet
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.util.default_root import DEFAULT_ROOT_PATH
from chia.util.config import load_config
from chia.util.ints import uint16
@ojura
ojura / cat_unwrap_excerpt.py
Last active February 22, 2022 21:26
CAT unwrap excerpt
# Coin with index 0 - "coin 0"; regular CAT coin worth 2 mojos; our value extractor
# Coin with index 6 - "coin 6"; double wrapped CAT worth 1 mojo; we're trying to salvage it
inner_puzzle[0] = puzzle_for_pk(key[0].get_g1())
cat_puzzle[0] = construct_cat_puzzle(CAT_MOD, tail_hash, inner_puzzle[0])
inner_puzzle[6] = puzzle_for_pk(key[6].get_g1())
cat_puzzle[6] = construct_cat_puzzle(CAT_MOD, tail_hash, inner_puzzle[6])
cat_cat_puzzle[6] = construct_cat_puzzle(CAT_MOD, tail_hash, cat_puzzle[6])
### Keybase proof
I hereby claim:
* I am ojura on github.
* I am ojura (https://keybase.io/ojura) on keybase.
* I have a public key ASCVSP9OAeol2BN5d00C1RsMmR9FMvrJWXRZRHM5sWXniAo
To claim this, I am signing this object:
import rosbag
import os
import sys
def remove_tf(inbag,outbag,frame_ids):
rospy.loginfo(' Processing input bagfile: %s', inbag)
rospy.loginfo(' Writing to output bagfile: %s', outbag)
rospy.loginfo(' Removing frame_ids: %s', ' '.join(frame_ids))
@ojura
ojura / gist:8b8a5102e7c07e4eb4d0ebc93c1d80ac
Created October 26, 2018 09:49
ros-kinetic-abseil-cpp build errors
In file included from /ws2/build/cartographer_ros/abseil/src/abseil/absl/types/variant.h:77:0,
from /ws2/build/cartographer_ros/abseil/src/abseil/absl/hash/internal/hash.h:48,
from /ws2/build/cartographer_ros/abseil/src/abseil/absl/hash/hash.h:64,
from /ws2/build/cartographer_ros/abseil/src/abseil/absl/container/internal/hash_function_defaults.h:55,
from /ws2/build/cartographer_ros/abseil/src/abseil/absl/container/flat_hash_set.h:37,
from /ws2/devel/include/cartographer/io/points_batch.h:25,
from /ws2/devel/include/cartographer/io/image.h:27,
from /ws2/src/cartographer_ros/cartographer_ros/cartographer_ros/ros_map.h:24,
from /ws2/src/cartographer_ros/cartographer_ros/cartographer_ros/ros_map.cc:17:
/ws2/build/cartographer_ros/abseil/src/abseil/absl/types/internal/variant.h:1091:29: error: ‘absl::type_traits_internal::is_detected_convertible’ has not been declared
#include "cartographer/io/proto_stream.h"
#include "cartographer/io/proto_stream_deserializer.h"
#include "cartographer/mapping/pose_graph.h"
#include "cartographer_ros/msg_conversion.h"
#include "cartographer_ros/time_conversion.h"
#include "cartographer_ros/split_string.h"
#include "geometry_msgs/TransformStamped.h"
namespace cartographer_ros {
@ojura
ojura / landmark_direct_cost_function.h
Last active July 16, 2018 10:25
DirectLandmarkCostFunction3DWithTwoObservations
// Cost function measuring the weighted error between the observed pose given by
// the landmark measurement and the linearly interpolated pose.
class DirectLandmarkCostFunction3DWithTwoObservations {
public:
using LandmarkObservation =
PoseGraphInterface::LandmarkNode::LandmarkObservation;
static ceres::CostFunction* CreateAutoDiffCostFunction(
const LandmarkObservation& observation1, const NodeSpec3D& prev_node1,
const NodeSpec3D& next_node1, const LandmarkObservation& observation2,
sensor_msgs::PointCloud2 prepareTimedPointCloud2Message(const ros::Time timestamp, const std::string &frameId,
const int numPoints) {
sensor_msgs::PointCloud2 msg;
msg.header.stamp = timestamp;
msg.header.frame_id = frameId;
msg.height = 1;
msg.width = numPoints;
msg.fields.resize(4);
msg.fields[0].name = "x";
msg.fields[0].offset = 0;
@ojura
ojura / install_cartographer_local.sh
Created January 31, 2018 15:38 — forked from kdaun/install_cartographer_local.sh
Cartographer install script depending on a local protobuf install
# Install wstool and rosdep.
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
# Create a new workspace in 'catkin_ws'.
mkdir cartographer_ws
cd cartographer_ws
wstool init src
# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.