Skip to content

Instantly share code, notes, and snippets.

@insertish
insertish / .bashrc
Last active April 25, 2024 11:05
Ubuntu 20.04 + ROS Noetic + TIAGo
# ROS Noetic + TIAGo workspace
source /opt/ros/noetic/setup.bash
source /home/ubuntu/tiago_public_ws/devel/setup.bash
# Try to determine appropriate ROS_IP based on network interfaces
export ROS_IP=$(ip addr | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p' | head -n 1)
echo ROS_IP set to $ROS_IP
# Switch to and configure LASR workspace
alias lasr="cd /media/ubuntu/c26792b8-9486-4e51-8b3d-b8577a6bbf28/lasr_ws && source devel/setup.bash"
@maximebories
maximebories / convert.md
Created March 30, 2023 20:04
FFmpeg command to convert webm to mp4 video files
ffmpeg -i input.webm -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 128k output.mp4

This ffmpeg command converts a .webm video file to a standard .mp4 file using the libx264 codec for video, aac codec for audio, and a CRF value of 22. The preset is set to 'slow' for higher quality encoding, and the audio bitrate is set to 128 kbps.

@uchagani
uchagani / proxmox_usb_passthrough.md
Last active April 25, 2024 11:05
Proxmox USB Passthrough
@abaksy
abaksy / ohmyzsh-agnoster-conda.md
Last active April 25, 2024 11:04
Displaying virtualenv and conda information on the Oh-My-Zsh Agnoster theme
  • Add the virtualenv plugin in the ~/.zshrc file. This is done by modifying the plugins line to include the virtualenv plugin
  • Make sure the following lines are in the file ~/.oh-my-zsh/plugins/virtualenv/virtualenv.plugin.zsh
# disables prompt mangling in virtual_env/bin/activate
export VIRTUAL_ENV_DISABLE_PROMPT=1

#Disable conda prompt changes
#https://conda.io/docs/user-guide/configuration/use-condarc.html#change-command-prompt-changeps1
#changeps1: False
`conda config --set changeps1 false`
@intaxwashere
intaxwashere / YourProjectEditorModule.cpp
Last active April 25, 2024 11:01
Automatically adding category sections to editor
// add this code to your StartupModule() function of your EDITOR module
// if it doesnt work, try setting loading phase to "postdefault" -- no idea if this will produce side effects though.
// basically idea is looping all CDOs (i.e. UClasses) and their properties, getting their "category" meta value and registering them to
// property sections
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
static constexpr bool bAddSubcategories = false; // you probably want this to be false
auto ProcessCategory = [&PropertyModule](const FName ClassName, const FString& Category)
@tomvon
tomvon / resize-image-keep-aspect-ratio.py
Created June 8, 2014 22:59
Python script to resize an image while keeping the original aspect ratio.
#Resizes an image and keeps aspect ratio. Set mywidth to the desired with in pixels.
import PIL
from PIL import Image
mywidth = 300
img = Image.open('someimage.jpg')
wpercent = (mywidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
@niradler
niradler / After_Installing_Kali.sh
Created May 5, 2019 20:28
The Top 10 Things to Do After Installing Kali Linux on Your Computer
# update & upgrade
sudo apt update && apt upgrade
# create user
adduser <username>
# install packages
apt install tilix maltego metasploit-framework burpsuite wireshark aircrack-ng hydra nmap beef-xss nikto
# install tor

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@evanesoteric
evanesoteric / nftables.conf
Created December 11, 2023 04:36
Nftables ruleset
#!/usr/bin/nft -f
flush ruleset
# home, office
# define admin = { 10.10.10.10. 172.10.10.10 }
table nat {
chain prerouting {
type nat hook prerouting priority 0
@osy
osy / xg_mobile_connector.md
Last active April 25, 2024 10:50
XG Mobile Connector Notes

These are notes written up about the XG Mobile connector which is found on the Asus ROG Ally as well as some ROG Flow models. The goal is to build a custom eGPU enclosure that is compatible with the XG Mobile connector.

XG Mobile Cable

The XG Mobile Cable comes with ROG XG Mobile and can be purchased from a [parts store][2] for $129 USD. It has a male XG Mobile Connector on one end and three cables on the other end: two 40-pin FPC cables and a 8-pin connector. The cable carries a USB-C connection, PCIe x8 signal pairs, PCIe clock, an SMBus/I2C connection, and some sideband signals for power detection and hot-plug support.

XG Mobile Connector

The pinout can be obtained from the [GV301QC schematic][1] (page 69).

Pin Name Pin Name
C1 PCIENB_TXP0_C D1 PCIENB_TXP5_C