Skip to content

Instantly share code, notes, and snippets.

View antiops's full-sized avatar

Anti Ops antiops

View GitHub Profile
@antiops
antiops / readme.md
Last active August 23, 2021 16:43
Gitea: Change normal migrated repo to mirror mode

How to convert a migrated Gitea repository to a mirror

After looking around I couldn't find any place that had step by step instructions to do this. This will show you how to convert any migrated Gitea repo to a mirror repo. Only tested with gitHub repositories.

My use case: I migrated a GitHub repo and all of its issues/releases/etc with the API key option. When you create a fully cloned migration Gitea doesn't let you make it a mirror AFAIK. So you have to go digging through the Gitea database in order to change it to a mirror. And it does in fact work, you can migrate a remote repo in its entirety and thenchange it to mirror. Note: When you change to mirror, it will not mirror anything that requires an API key, it will just mirror the git repo.

For Gitea running with sqlite:

Open the Gitea database:

  • On default installations sqlite3 /opt/mailcow-dockerized/data/gitea/gitea/gitea.db
  • Or custom installation sqlite3 gitea.db in the gitea data directory wherever you installed it
@antiops
antiops / darkmode.js
Created March 7, 2021 06:16
darkmode on any site
const divs = document.querySelectorAll('*')
for (let i = 0; i < divs.length; i++){
divs[i].style.backgroundColor = 'rgb(34,34,34)'
divs[i].style.color = 'rgb(255 255 255)'
}
@antiops
antiops / docker-install.sh
Created February 9, 2021 03:26
Install Docker Ubuntu
# https://docs.docker.com/engine/install/ubuntu/
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
gnupg \
software-properties-common
@antiops
antiops / README.md
Last active January 10, 2021 21:09
Google Collab Remote Desktop

Setup

  1. Go Here and create a new notebook.
  2. Once in it click on the code box and enter the text below. (Edit USERNAME & PASSWORD with a simple username/password, youll need to enter the password when usig sudo).
! wget https://gist.githubusercontent.com/antiops/940092ac8ada95eadb69236d7d19dc68/raw/e5220f5ca7c153ace4c2c58709195fd43db7e555/setup-remote.sh  &> /dev/null
! chmod +x setup-remote.sh
! ./setup-remote.sh USERNAME PASSWORD
  1. Click the play button
@antiops
antiops / chromeinstall_ubu16.sh
Created November 16, 2020 23:04 — forked from LoganGray/chromeinstall_ubu16.sh
this worked to install selenium and google chrome on my Ubuntu 16 server.
#!/usr/bin/env bash
# used to install offical chrome and selenium on Ubuntu 16.04.1 LTS, 18.04 desktop, Jan 2020
# also tested and works on Elem OS 5.1 :)
cd ~
sudo apt-get update
sudo apt install python-pip
pip install simplejson
pip install bs4
pip install selenium
apt-get install libasound2 libnspr4 libnss3 libxss1 xdg-utils unzip
@antiops
antiops / pixieset-scrape.js
Created November 1, 2020 04:16
pixieset.com dumper
/* pixieset.com full size image scraper
*
* Rips all images in highest quality
*
* To use scroll to the very bottom of the album and press F12 then paste the below snippet in and press enter.
* The full file list will be copied to your clipboard afterwards. You can use jdownloader to easily download the full list.
*/
(() => {
const data = document.querySelectorAll('.masonry-brick img')
@antiops
antiops / tor-nyx-install.sh
Last active November 11, 2020 05:39
Tor relay install script
## Install Tor relay as non-root user in home folder
# Verify TORVER is latest stable version
# https://www.torproject.org/download/tor/
TORVER=0.4.4.5
TORDIR=$HOME/opt/tor
NYXDIR=$HOME/opt/nyx
echo '[INFO] Installing Tor'
mkdir -p TORDIR && cd ~/opt
wget https://dist.torproject.org/tor-$TORVER.tar.gz
@antiops
antiops / dump-proxyrack-proxy-data.js
Last active September 1, 2020 11:51
Dump free proxies from proxyrack.com api
/*
* Paste this in the dev tools console while on any webpage on https://www.proxyrack.com
*
* Grabs the total amount of proxies availble on the site
* via their api and outputs all the dead/live proxies in a comma seperated list
* -- (38216 total proxies as of writing) Alive: 20692, Dead: 17523
*/
(async () => {
let alive = [], dead = []
@antiops
antiops / remove-duplicates-v6c.js
Created July 26, 2020 05:10
Remove line duplicates tool
//Remove line duplicates tool
document.addEventListener('DOMContentLoaded', function () {
//Parameters
//var seperatorI;
//var newCode;
var newCodeArray = [];
//var inputSep;
//var outputSep;
// onclick="select_all(this)"
function select_all(el) {
if (typeof window.getSelection != "undefined" && typeof document.createRange != "undefined") {
var range = document.createRange();
range.selectNodeContents(el);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
} else if (typeof document.selection != "undefined" && typeof document.body.createTextRange != "undefined") {