Skip to content

Instantly share code, notes, and snippets.

View fiefdx's full-sized avatar

Haitao Yang fiefdx

View GitHub Profile
@fiefdx
fiefdx / bag_to_images.py
Created July 1, 2022 06:34 — forked from wngreene/bag_to_images.py
Extract images from a rosbag.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Massachusetts Institute of Technology
"""Extract images from a rosbag.
"""
import os
import argparse
@fiefdx
fiefdx / rosbag2images.py
Created July 1, 2022 06:34 — forked from priteshgohil/rosbag2images.py
Extract images from a rosbag file. It will also show the list of topics in rosbag.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Massachusetts Institute of Technology
# Tutorial : http://wiki.ros.org/rosbag/Code%20API#Python_API
"""
Extract images from a rosbag.
How to use: In terminal, cd DIRECTORY_OF_THIS_FILE and then type following
python bag_to_images.py --bag_file camera_odom_compressed.bag --output_dir output/ --image_topic '/camera/image_raw'
python bag_to_images.py --bag_file my_rosbag_file.bag --output_dir output/ --image_topic '/eGolf/front_cam/image_raw'
@fiefdx
fiefdx / readme.txt
Created June 7, 2022 03:30 — forked from nathanqthai/readme.txt
simple tornado server with ssl
to generate example certs
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout host.key -out host.crt
run server:
chmod +x server.py
./server.py
test server:
openssl s_client -connect localhost:8888

Installing Arch linux with EFI

  1. Change keyboard layout:

    • loadkeys no
  2. Verify boot mode:

    • ls /sys/firmware/efi/efivars (If the directory exist your computer supports EFI)
  3. Ping some site on the Internet to verify connection:

  • ping archlinux.org
@fiefdx
fiefdx / csgo-server-guide.md
Created December 21, 2021 05:29 — forked from fanjin-z/csgo-server-guide.md
Complete Guide for Hosting CS:GO Dedicated Servers

Complete Guide for Hosting a CS:GO Dedicated Server

Creative Commons License.

I tested the setup on Debian Stretch (naive installation) and Jessie (LinuxGSM installation). The setup should work on Debian 8 (Jessie), Debian 9 (Stretch) and Ubuntu (16.04). However, If you're running on Windows or other non-debian based Linux OS (e.g. CentOS, openSUSE), this guide doesn't apply to you.

My Servers:

I'm hosting FFA warm-up and HvH(soon) servers in San Francisco, welcome to join by:

IPv4: 159.89.154.137   
Ipv6: 2604:a880:2:d0::20ad:2001 
@fiefdx
fiefdx / yuv2rgb.py
Created November 2, 2021 06:19 — forked from fzakaria/yuv2rgb.py
A way to convert YUV (NV12) files to RGB (BMP). Requires PIL (Python Image Library)
__author__ = "Farid Zakaria"
__copyright__ = "Copyright 2011, AMD"
__credits__ = ["Sherin Sasidhan (serin.s@gmail.com)"]
__license__ = "GPL"
__version__ = "1.0."
__maintainer__ = "Farid Zakaria"
__email__ = "farid.zakaria@amd.com"
__status__ = "Prototype"
import argparse
@fiefdx
fiefdx / install_openssl_aarch64.sh
Created September 28, 2021 02:06 — forked from Matheus-Garbelini/install_openssl_aarch64.sh
Compile and install OpenSSL 1.1.1 for arm64 aarch64 android
wget https://www.openssl.org/source/openssl-1.1.1.tar.gz
tar -xvzf openssl-1.1.1.tar.gz
cd openssl-1.1.1/
./Configure linux-aarch64 --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
make -j$(($(nproc)+1))
sudo make install
sudo echo 'LD_LIBRARY_PATH=/usr/local/ssl/lib:${LD_LIBRARY_PATH}' >> /etc/environment
rm openssl-1.1.1.tar.gz
sudo rm openssl-1.1.1 -r
@fiefdx
fiefdx / test_http.py
Created July 8, 2021 05:54 — forked from matteomattei/test_http.py
HTTP/HTTPS GET and POST (including files) with built-in python modules
#!/usr/bin/env python3
# This script performs a GET and a POST request through HTTP/HTTPS using
# builtin python3 moudules. There is also a class to encode files for upload!
import urllib.request
import http.client
import mimetypes
import codecs
import uuid
import binascii
<html>
<!-- You may need to download them from https://github.com/brix/crypto-js/tree/release-3.1.2/build -->
<script src="rollups/sha1.js"></script>
<script src='components/lib-typedarrays-min.js'></script>
<body>
<script>
function sha1sum() {
var oFile = document.getElementById('uploadFile').files[0];
var sha1 = CryptoJS.algo.SHA1.create();
var read = 0;
@fiefdx
fiefdx / how-to-connect-an-iOS-device-to-your-computer-using-SOCKS.md How to connect an iOS device to your computer via a SOCKS proxy. Say you're running a virtual machine on your work computer. Say this machine, for whatever reason, can only connect to the internet over NAT - as in, it does not get it's own IP address. Say this VM is running a webserver, and you need a device outside of your computer to connect t…

How to connect an iOS device to your computer via a SOCKS proxy

Say you're running a virtual machine on your work computer. Say this machine, for whatever reason, can only connect to the internet over NAT - as in, it does not get it's own IP address. Say this VM is running a webserver, and you need a device outside of your computer to connect to it.

If only there was a way to get your work computer to 'share' it's network, so that you could get at that VM… Here's how you do it!

For all instructions, I assume your work computer is a mac

  1. Get your computer's IP address: