Skip to content

Instantly share code, notes, and snippets.

View jeromecc's full-sized avatar
🤖
Building bots for my Riot / Matrix server

jeromecc jeromecc

🤖
Building bots for my Riot / Matrix server
View GitHub Profile
@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@gdamjan
gdamjan / README.md
Last active July 9, 2024 22:54
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@eighthave
eighthave / find-https-debian-archives.py
Last active May 26, 2024 03:45
Script to find official Debian mirrors that support HTTPS
#!/usr/bin/env python3
import urllib.request
import re
import ssl
import sys
# # find generic mirrors
mirrors = urllib.request.urlopen('http://www.debian.org/mirror/list')
https = []
@kfrancoi
kfrancoi / meshXML_Bio2RDF.py
Last active March 28, 2021 02:46
This script parse the MESH xml dump file and turn it into an rdf triple file following partially the bio2rdf convention.
import sys
import os
import itertools
from datetime import datetime
try:
from lxml import etree
except ImportError:
import xml.etree.ElementTree as etree
import RDF
#!/bin/bash
#
# Automate mysql secure installation for debian-baed systems
#
# - You can set a password for root accounts.
# - You can remove root accounts that are accessible from outside the local host.
# - You can remove anonymous-user accounts.
# - You can remove the test database (which by default can be accessed by all users, even anonymous users),
# and privileges that permit anyone to access databases with names that start with test_.
@xinomilo
xinomilo / find-https-debian-archives.py
Last active December 20, 2017 01:17 — forked from eighthave/find-https-debian-archives.py
Script to find official Debian mirrors that support HTTPS
#!/usr/bin/python
import urllib2
import re
import ssl
import sys
# # find generic mirrors
mirrors = urllib2.urlopen('https://www.debian.org/mirror/list')
https = []
@ricardodani
ricardodani / admin.py
Last active March 20, 2022 14:37
django admin textarea widget char counter
# admin
from django import admin
from django.db import models
from widget import TextareaWithCounter
class MyModelAdmin(admin.ModelAdmin):
formfield_overrides = {
models.TextField: {'widget': TextareaWithCounter},
}
class Media:
@kkirsanov
kkirsanov / multitask.py
Created April 26, 2017 09:04
run multiple django managememnt commands simultaneously
# coding=utf8
import logging
import threading
import time
from django.core.management import call_command
from django.core.management.base import BaseCommand
logger = logging.getLogger('multirunner')