Skip to content

Instantly share code, notes, and snippets.

View acmiyaguchi's full-sized avatar
🌎

Anthony Miyaguchi acmiyaguchi

🌎
View GitHub Profile
@jeguzzi
jeguzzi / Instructions.md
Last active February 25, 2024 20:29
How to compile CoppeliaSim on Linux

How to compile CoppeliaSim (v4.4) from source on Linux

Tested on Ubuntu 22.04 (arm64 and x64)

  1. Install dependicies

  • pip: sudo apt install python3-pip
  • colcon: pip install -U colcon-common-extensions
@cobryan05
cobryan05 / fixNvPe.py
Last active July 29, 2024 02:04
Python Script to disable ASLR and make nv fatbins read-only to reduce memory commit
# Simple script to disable ASLR and make .nv_fatb sections read-only
# Requires: pefile ( python -m pip install pefile )
# Usage: fixNvPe.py --input path/to/*.dll
import argparse
import pefile
import glob
import os
import shutil
@lucasw
lucasw / create_cloud_xyzrgb.py
Created April 25, 2018 00:08
Create PointCloud2 with python with rgb
#!/usr/bin/env python
# PointCloud2 color cube
# https://answers.ros.org/question/289576/understanding-the-bytes-in-a-pcl2-message/
import rospy
import struct
from sensor_msgs import point_cloud2
from sensor_msgs.msg import PointCloud2, PointField
from std_msgs.msg import Header
@sunahsuh
sunahsuh / download_spark_log.sh
Created November 21, 2017 17:50
Download the driver's spark log given a cluster id
# Usage: download_spark_log.sh j-XXXXXXX <optional download path>
# Required: aws cli and jq
cluster=$1
# Optional second argument defaults to .
dlLoc=${2:-\.}
instance=$(aws emr list-instances --cluster-id "$cluster" --instance-group-types MASTER | jq -r '.Instances[0].Ec2InstanceId')
logLocs3n=$(aws emr describe-cluster --cluster-id $cluster | jq -r '.Cluster.LogUri')
logLoc=${logLocs3n//s3n:/s3:}
== Parsed Logical Plan ==
Repartition 1, true
+- Project [channel#1422, geo#1421, is_funnelcake#1419, acquisition_period#1417, start_version#1583, sync_usage#1420, current_version#1418, current_week#1355L, source#1414, medium#1416, campaign#1409, content#1413, distribution_id#1410, default_search_engine#1415, locale#1411, is_active#1412, n_profiles#1636L, usage_hours#1638, sum_squared_usage_hours#1640, total_uri_count#1642L, unique_domains_count_per_profile#1645]
+- Aggregate [medium#1416, campaign#1409, source#1414, locale#1411, geo#1421, current_week#1355L, is_active#1412, content#1413, distribution_id#1410, default_search_engine#1415, acquisition_period#1417, current_version#1418, is_funnelcake#1419, sync_usage#1420, start_version#1583, channel#1422], [medium#1416, campaign#1409, source#1414, locale#1411, geo#1421, current_week#1355L, is_active#1412, content#1413, distribution_id#1410, default_search_engine#1415, acquisition_period#1417, current_version#1418, is_funnelcake#1419, sync_usage#1420, start_v
@briansmith
briansmith / how-to-generate-and-use-private-keys-with-openssl-tool.md
Last active March 21, 2025 11:43
How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use

@mattdenner
mattdenner / README.markdown
Last active April 30, 2025 01:10
Suspend and then hibernate after 60 minutes

I found a post about suspending and then going into hibernate that included a really clever script. Turns out that with NixOS this is even esaier to coordinate as you have systemd so can have a before and after service. I just include this in my /etc/nixos/configuration.nix file and nixos-rebuild; then a systemctl suspend or a close of the lid will cause the hibernate timer to be set.

@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@vidavidorra
vidavidorra / auto-deploy_documentation.md
Last active June 5, 2024 19:20
Auto-deploying Doxygen documentation to gh-pages with Travis CI

Auto-deploying Doxygen documentation to gh-pages with Travis CI

This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI. This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.

Sign up for Travis CI and add your project

Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.

Create a clean gh-pages branch

To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th

@karpathy
karpathy / min-char-rnn.py
Last active April 28, 2025 17:51
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)