Skip to content

Instantly share code, notes, and snippets.

@Gilinho
Gilinho / Readme.md
Created October 9, 2018 07:28 — forked from ErikCH/Readme.md
@Gilinho
Gilinho / duck.sh
Created March 18, 2018 19:20 — forked from BlackthornYugen/duck.sh
Duckdns cron script
#!/usr/bin/env bash
DUCKPATH=~/duckdns
TOKEN=changeme
DOMAINS=steelcomputers
curl -sSv "https://www.duckdns.org/update?domains=${DOMAINS}&token=${TOKEN}&ip=" \
2>> ${DUCKPATH}/stderr.log \
>> ${DUCKPATH}/stdout.log
printf ' - ' >> ${DUCKPATH}/stdout.log
date >> ${DUCKPATH}/stdout.log
@Gilinho
Gilinho / startup.py
Created January 24, 2018 12:40 — forked from smithbr/startup.py
Startup script for my mac. Mount shares and start applications
#!/usr/bin/python
"""Startup script."""
import os
from subprocess import check_output
DRIVE_PARENT = '/Users/myusername/Shares'
@Gilinho
Gilinho / detective_conan.py
Created January 24, 2018 12:36 — forked from dfuenzalida/detective_conan.py
Detective Conan en DailyMotion
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Parsea la página de busquedas de DailyMotion para encontrar
# episodios de Detective Conan, busca las URL y las imprime,
# para usar junto con JDownloader
import urllib2
import time
from BeautifulSoup import BeautifulSoup
@Gilinho
Gilinho / DuckDNS.py
Created January 24, 2018 12:20 — forked from jfinstrom/DuckDNS.py
DuckDNS Updater.....
#!/usr/bin/env python
import requests
import sys
#************************************#
# User Serviceable Stuff #
#************************************#
TOKEN = 'YOUR TOKEN'
DOMAIN = 'YOURSUBDOMAIN'
DEBUG = False
## End of user serviceable stuff...
@Gilinho
Gilinho / duckdns_updater.py
Created January 24, 2018 12:17 — forked from tistaharahap/duckdns_updater.py
A Python script to update DuckDNS
import urllib2
domains = ['YOUR_DOMAIN1', 'YOUR_DOMAIN2']
token = 'YOUR_ACCESS_TOKEN'
ip_check_url = 'http://icanhazip.com'
def get_public_ip():
response = urllib2.urlopen(url=ip_check_url)
@Gilinho
Gilinho / 1-plexbox-setup-README.md
Created November 30, 2017 12:51 — forked from mturley/1-plexbox-setup-README.md
Ubuntu Server plexbox setup

Start with a fresh Ubuntu Server 16.04 installation. NOTE: In the commands and files below, be sure to replace <yourusername> with your username and <yourgroupname> with your group name (probably the same as your username). Also, replace <yourhostname> with your server's hostname.

Install Dependencies:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt update
import urllib, json
data = json.loads(urllib.urlopen("http://ip.jsontest.com/").read())
print data["ip"]
#OR Without json
#
#import urllib, re
#
#data = re.search('"([0-9.]*)"', urllib.urlopen("http://ip.jsontest.com/").read()).group(1)
@Gilinho
Gilinho / recover_source_code.md
Created November 9, 2017 15:17 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: