Skip to content

Instantly share code, notes, and snippets.

@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
# pip install webdriver_manager
# pip install selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
@choco-bot
choco-bot / Update-AUPackages.md
Last active April 25, 2024 10:47
Update-AUPackages Report #powershell #chocolatey
@jauderho
jauderho / Public time servers with anycast NTP support.md
Last active April 25, 2024 10:47
This is a curated list of NTP time servers that have anycast IP addresses. This is useful for devices/appliances that can only use IP addresses for defined NTP servers.

Cloudflare (AS13335)

server 162.159.200.123

server 162.159.200.1

Facebook (AS32934)

server 129.134.28.123 # SJC