Skip to content

Instantly share code, notes, and snippets.

View tchiavegatti's full-sized avatar

Tiago Chiavegatti tchiavegatti

View GitHub Profile

Gitea to mirror github

In the instance you want to migrate all of your GitHub repositories to gitea, instead of manually importing all repos to github and setting them up to mirror we can import them all at once. When I add a repository to Gitea and specify I want it to be mirrored, Gitea will take charge of periodically querying the source repository and pulling changes in it. I’ve mentioned Gitea previously, and I find it’s improving as it matures. I’ve been doing this with version 1.7.5.

After setting up Gitea and creating a user, I create an API token in Gitea with which I can create repositories programatically. The following program will obtain a list of all Github repositories I have, skip those I’ve forked from elsewhere, and then create the repository in Gitea.

#!/usr/bin/env python -B
@tchiavegatti
tchiavegatti / install-python
Created July 28, 2022 18:32 — forked from SerhatTeker/install-python
Install Python (with desired version) on an Ubuntu Host
#!/usr/bin/env bash
# Bash safeties: exit on error, no unset variables, pipelines can't hide errors
set -o errexit
set -o nounset
set -o pipefail
# INFO
# --------------------------------------------------------------------------------------
# A shell script that downloads and installs Python on an Ubuntu host
@tchiavegatti
tchiavegatti / python-batchfile.bat
Created May 6, 2019 14:08 — forked from jadient/python-batchfile.bat
Run python code directly from a batch file
@echo off & python -x "%~f0" %* & goto :eof
# ==========================================================
# one way to place python script in a batch file
# place python code below (no need for .py file)
# ==========================================================
import sys
print "Hello World!"
for i,a in enumerate(sys.argv):
@tchiavegatti
tchiavegatti / instructions.md
Created April 1, 2018 20:56 — forked from zentralwerkstatt/instructions.md
Install Syncthing on Raspberry Pi
  • Install the necessary packages:
sudo apt-get install apt-transport-https ca-certificates
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb http://apt.syncthing.net/ syncthing release" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update
sudo apt-get install syncthing
sudo apt-get install git
  • Start syncthing once: