Skip to content

Instantly share code, notes, and snippets.

@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
""""""""""""""""""""""
" Leader
""""""""""""""""""""""
" let mapleader=,
" can't set leaders in Obsidian vim, so the key just has to be used consistently.
" However, it needs to be unmapped, to not trigger default behavior: https://github.com/esm7/obsidian-vimrc-support#some-help-with-binding-space-chords-doom-and-spacemacs-fans
unmap ,
" map ; to : in normal mode, so that I don’t rely on the shift key
" nmap ; :
@volkbay
volkbay / fix_git_security_check_termux.md
Last active April 22, 2024 13:49
Disable Git security check on Termux

👾 Error

fatal: detected dubious ownership in repository at '/storage/emulated/0/<some_folder>'
To add an exception for this directory, call:

        git config --global --add safe.directory /storage/emulated/0/<some_folder>

🤔 Why do I see this error ?

This is a simple check (by Git) comparing current user ID and the ID of the owner of the current folder. If they do not match (in case of rootless Termux, root owns them all.), Git will not permit any action (even git status).

@raveenb
raveenb / ssh_into_android.md
Last active July 16, 2024 06:10
SSH into Android

Connecting to an Android device over SSH

Initial Setup

Install Android App Termux from APKPure or AppStore. If the app exists, just delete and re-install it to get the latest version, The APK can be downloaded from https://apkpure.com/termux/com.termux/ Install the APK using by running

adb install ~/Downloads/Termux_v0.73_apkpure.com.apk
@robin-a-meade
robin-a-meade / unofficial-bash-strict-mode.md
Last active June 17, 2024 15:33
Unofficial bash strict mode

Unofficial Bash Strict Mode

Sometimes a programming language has a "strict mode" to restrict unsafe constructs. E.g., Perl has use strict, Javascript has "use strict", and Visual Basic has Option Strict. But what about bash? Well, bash doesn't have a strict mode as such, but it does have an unofficial strict mode:

set -euo pipefail

set -e

@volks73
volks73 / AutoHotkey.ahk
Created September 26, 2017 14:47
AutoHotkey script to change Caps Lock to Control on hold and Escape on press and release
; Change Caps Lock to Control when held down; otherwise, Escape
;
; Originally based on the answer provided in
; [this](https://superuser.com/questions/581692/remap-caps-lock-in-windows-escape-and-control)
; StackExchange SuperUser question.
;
; A shortcut should be created for this script and placed in the Windows 10
; user's startup folder to automatically enable the feature on boot/startup.
; The user's startup folder can be found using the following steps:
;
@pascaliske
pascaliske / git-diff.md
Last active April 16, 2024 14:32
Collection of useful diff tools for git

Useful git diff tools

Overview

  • Word: docx2txt (brew install docx2txt)
  • Excel: xlsx2txt
  • PDF: pdf2txt (brew install poppler)
  • Images: exiftool (brew install exiftool)

Setup

Alice's Adventures in Wonderland
ALICE'S ADVENTURES IN WONDERLAND
Lewis Carroll
THE MILLENNIUM FULCRUM EDITION 3.0