Skip to content

Instantly share code, notes, and snippets.

@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

@fjudith
fjudith / kubernetes_service_session_affinity.md
Last active April 25, 2024 10:48
Enable Session Affinity (a.k.a Sticky Session) to Kubernetes service
@duchelle5093
duchelle5093 / hello.c
Created April 25, 2024 10:41
mon hello world
int main ()
{
print("hello world");
return 0;
}