Skip to content

Instantly share code, notes, and snippets.

View petergi's full-sized avatar
💭
Just Busy Living On The Side Of A Square

Peter Giannopoulos petergi

💭
Just Busy Living On The Side Of A Square
View GitHub Profile
@petergi
petergi / lsof examples.sh
Created May 7, 2025 14:25
You know.. a couple of handy examples of how to use lsof...
# Find what's using a volume on macOS
lsof | grep /Volumes/
# Check what processes are listening on port
lsof -iTCP -sTCP:LISTEN -P -n
# Kills a process using PID
#
# awk grabs the PIDs.
# tail gets rid of the pesky first entry: "PID".
Create a meeting agenda with the goal of discussing the progress of {{Project_Name}} based on {{Project_Document}}. This meeting is part of our regular {{meeting_frequency (weekly/bi-weekly/monthly)}} check-ins to ensure all team members are aligned and the project is on track, involving the development of
1. {{Project_task}}
2. {{Project_task}}
3. {{Project_task}}
The purpose of the meeting is to have a clear understanding of the current project status, any issues that need to be addressed, and the next steps for each team member. Outline expectations by asking all team members to come prepared with updates on their tasks, any challenges they are facing, and suggestions for improvement, encouraging active participation and open communication for a productive discussion.
@petergi
petergi / Prompt - Act As A Statistician
Last active April 2, 2025 20:45
Example User Input: I need help calculating how many million banknotes are in active use in the world
I want you to act as a Statistician. I will provide you with details related with statistics.
You should be knowledgeable of statistics terminology, statistical distributions, confidence interval, probability, hypothesis testing and statistical charts.
docker run --platform linux/amd64 --hostname=sqlpreview --user=root --env=ACCEPT_EULA=Y --env=MSSQL_SA_PASSWORD='yourStrong(!)Password' --env=MSSQL_PID=Evaluation --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env=MSSQL_RPC_PORT=135 --env=CONFIG_EDGE_BUILD= --network=bridge -p 1433:1433 --restart=no --label='com.microsoft.product=Microsoft SQL Server' --label='com.microsoft.version=16.0.4085.2' --label='org.opencontainers.image.ref.name=ubuntu' --label='org.opencontainers.image.version=22.04' --label='vendor=Microsoft' --runtime=runc --mount source=ChannelManagerData,target=/ChannelManager_Data -d mcr.microsoft.com/mssql/server:2022-latest
@petergi
petergi / GitHub Gist Downloader.py
Created October 28, 2024 13:26
Downloads and manages GitHub gists using the GitHub API.
import requests
import os
def create_directory(dirname):
#Creates a new directory if a directory with dirname does not exist
try:
os.stat(dirname)
except:
os.mkdir(dirname)

Essential Mac and Windows Shortcuts

Shortcut Windows 11 macOS
Basics
Copy Ctrl + C Command + C
Cut Ctrl + X Command + X
Paste Ctrl + V
@petergi
petergi / Globally replace a string in Neovim.txt
Created May 2, 2024 18:34
Replaces all occurrences of "PETER" with "pete".
:g/PETER/s//pete/g
"equivalent to:
:%s/PETER/pete/g

:1,10co20 "copy lines 1 through 10 after line 20"

:4,15t$ "copy lines 4 through 15 to end of document (t == co)"

:-t$ "copy previous line to end of document"

:m0 "move current line to line 0 (i.e. the top of document)"

:.,+3m$-1 "move current line +3 subsequent to the last line -1 (i.e. next to last)"

@petergi
petergi / Fast delete of all lines matching a pattern in Neovim.md
Last active July 4, 2024 22:34
When a line is deleted, it is first copied to a register—since no register is specified, the default (unnamed) register is used. If many thousands of lines are deleted, the copy process can take a significant time. To avoid that waste of time, the blackhole register (_) can be specified because any copy or cut into the blackhole register perform…

:g/pattern/d \_

@petergi
petergi / Add text to the end of a line that begins with a certain string in Neovim.txt
Created May 2, 2024 18:21
Add text to the end of a line that begins with a certain string
:g/^pattern/s/$/mytext