Skip to content

Instantly share code, notes, and snippets.

nginx for test.example.com

# https://hamidmosalla.com/2022/12/26/how-to-customize-windows-terminal-and-powershell-using-fzf-neovim-and-beautify-it-with-oh-my-posh/
# function prompt {"PS " + (get-location).drive.name+":\...\"+ $( ( get-item $pwd ).Name ) +">"}
function prompt {
$p = Split-Path -leaf -path (Get-Location)
"$p ~ "
}
Set-Alias vim nvim
Set-Alias vi nvim
project/
├── backend/
│   ├── app                  # "app" is a Python package
│   │   ├── __init__.py      # this file makes "app" a "Python package"
│   │   ├── main.py          # "main" module, e.g. import app.main
│   │   ├── dependencies.py  # "dependencies" module, e.g. import app.dependencies
│   │   ├── routers          # "routers" is a "Python subpackage"
│   │   │   ├── __init__.py  # makes "routers" a "Python subpackage"
│   │   │   ├── items.py     # "items" submodule, e.g. import app.routers.items
sudo systemctl daemon-reload
sudo systemctl stop 00waasu_scraper.service
sudo systemctl disable 00waasu_scraper.service
sudo systemctl enable --now waasu_scraper.timer
sudo systemctl status waasu_scraper.timer 00waasu_scraper.service
import socket
import csv
import subprocess
import os
with open('urls.txt', 'r') as input_file, open('results.csv', 'w', newline='') as output_file:
reader = csv.reader(input_file)
writer = csv.writer(output_file)
writer.writerow(['URL', 'IP Address'])
@jwc20
jwc20 / .bashrc
Last active April 21, 2024 10:40
export PYTHONPATH=$SCM_PATH/py
SHELL_NAME="\[\033[01;91m\]($name)\[\033[00m\]"
# https://gist.github.com/ckabalan/2732cf6368a0adfbe55f03be33286ab1
# Color codes for easy prompt building
COLOR_DIVIDER="\[\e[30;1m\]"
COLOR_CMDCOUNT="\[\e[34;1m\]"
COLOR_USERNAME="\[\e[34;1m\]"
COLOR_USERHOSTAT="\[\e[34;1m\]"
@jwc20
jwc20 / stitch.py
Created August 19, 2022 07:49
Stitch images vertically
import numpy as np
from PIL import Image
import glob
list_im = glob.glob("*.png")
total_width = 0
total_height = 0
max_width = 0
max_height = 0
min_width = 2000