Skip to content

Instantly share code, notes, and snippets.

View noplanman's full-sized avatar
🐲
Coding for the world

Armando Lüscher noplanman

🐲
Coding for the world
View GitHub Profile
@jgrodziski
jgrodziski / docker-aliases.sh
Last active April 29, 2025 20:50
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@kamermans
kamermans / get_docker_host_ip.php
Created November 1, 2016 15:53
Example of retrieving the Docker host IP from within a container via PHP by parsing the Linux kernel's routing table
<?php
$gw = "Unknown";
// Get the Docker host IP from the routing table
$table = file("/proc/net/route");
foreach ($table as $row) {
// Split the fields out of the routing table
$fields = preg_split("/[\t ]+/", trim($row));
@noplanman
noplanman / dns_cyon.sh
Last active October 27, 2016 09:57
Get Let's Encrypt certificates for cyon.ch domains using acme.sh DNS method.
#
# THIS SCRIPT HAS BEEN MOVED TO A NEW HOME:
#
# https://github.com/noplanman/cyon-api/blob/master/dns_cyon.sh
#
@gregecho
gregecho / git-ignore.sh
Created August 17, 2016 01:17 — forked from jeffjohnson9046/git-ignore.sh
Remove unwanted files from a git repo AFTER adding a .gitignore. The files will remain on disk.
## I just ran into this after initializing a Visual Studio project _before_ adding a .gitignore file (like an idiot).
## I felt real dumb commiting a bunch of files I didn't need to, so the commands below should do the trick. The first two commands
## came from the second answer on this post: http://stackoverflow.com/questions/7527982/applying-gitignore-to-committed-files
# See the unwanted files:
git ls-files -ci --exclude-standard
# Remove the unwanted files:
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
@evantahler
evantahler / main.yml
Last active March 22, 2025 07:11
CertBot + Ansible
# tasks/main.yml
- name: install certbot dependencies
apt: name={{ item }} state=present
with_items:
- build-essential
- libssl-dev
- libffi-dev
- python-dev
- git
@zauberstuhl
zauberstuhl / diaspora_api_register_client.sh
Created June 8, 2016 20:47
Diaspora API - Register a new application/client and retrieve an access token for your pod
#!/bin/bash
echo -n "Name your client (MyBot): "
read client_name
echo -n "Define your pod address (with https://): "
read domain
cookie_file="/tmp/.cookie"
openid_url="$domain/api/openid_connect"
@simonluijk
simonluijk / otp_to_qrcode.py
Created February 21, 2016 18:29
Simple command to create a QR code from an OTP secret
#!/usr/bin/env python
import argparse
import qrcode
def main():
parser = argparse.ArgumentParser(description='Generate QR code for OTP.')
parser.add_argument('user', nargs=1)
parser.add_argument('key', nargs=1)
parser.add_argument('issuer', nargs=1)
<?php
$loader = require __DIR__.'/vendor/autoload.php';
use Longman\TelegramBot\Request;
$API_KEY = '--botfather-api-keu--';
$BOT_NAME = '--bofather-bot-name--';
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
@Informatic
Informatic / README.md
Last active March 26, 2025 00:18
Minimal Tor hidden service on OpenWRT
  1. Format your storage
  2. Configure networking (it's easiest with LuCI, or just take a look at OpenWRT howtos)
  3. Configure /storage by adding proper options in /etc/config/fstab, or, again, just clicking around in LuCI
  4. opkg update && opkg install tor
  5. Copy proper configuration, namely /etc/tor/torrc and /etc/config/uhttpd
  6. Reboot (or /etc/init.d/uhttpd restart && /etc/init.d/tor restart)
  7. Check /etc/tor/hidden_service/hostname for your public .onion address
  8. ...
  9. PROFIT!
@MatthewVance
MatthewVance / build_nginx.sh
Last active August 28, 2018 12:15 — forked from MattWilcox/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# make script exit if a simple command fails and
# make script print commands being executed
set -e -x
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2f
export VERSION_NGINX=nginx-1.9.11