Skip to content

Instantly share code, notes, and snippets.

View DovieW's full-sized avatar

Dovie Weinstock DovieW

View GitHub Profile
@DovieW
DovieW / fzf.md
Last active December 4, 2024 18:24
My FZF Stuff

git-switcher

#!/bin/bash

branches=$(git branch --all | grep -v HEAD) &&
branch=$(echo "$branches" |
    fzf -d $(( 2 + $(wc -l <<< "$branches") )) +m) &&
git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##")
@DovieW
DovieW / logrotate-cheatsheet.md
Created October 2, 2024 15:10
logrotate Cheatsheet (by ChatGPT o1-preview)

Logrotate Cheatsheet

Logrotate is a powerful utility designed to manage and automate the rotation, compression, removal, and mailing of log files. This comprehensive guide covers all essential aspects of logrotate to help you effectively manage system logs.


Table of Contents

  1. Basic Concepts
  2. Configuration Files
@DovieW
DovieW / issues-gitea-to-github.sh
Created November 16, 2023 23:47
Transfer issues from Gitea to Github
#!/bin/bash
# Configuration
GITEA_REPO="username/repository"
GITEA_API_TOKEN="your_gitea_api_token"
GITHUB_REPO="username/repository"
GITHUB_API_TOKEN="your_github_api_token"
GITEA_API_URL="https://your_gitea_instance/api/v1"
GITHUB_API_URL="https://api.github.com"
ISSUE_FILE="gitea_issues.json"
@DovieW
DovieW / send_email.ps1
Created May 11, 2023 02:26
Send Email via PowerShell
$to = "user1@email.com,user2@email.com" # comma separate multiple recipients
$from = "sender@email.com"
$subject = "subject goes here"
$body = "message body goes here"
$smtpServer = "smtp.gmail.com"
$smtpClient = New-Object Net.Mail.SmtpClient($smtpServer, 587) # port 25 for non SSL, port 587 for SSL
$smtpClient.EnableSsl = $true # set to $true for SSL